From 579845df45ca10dc850eb56bd3dc2d2d018cb846 Mon Sep 17 00:00:00 2001 From: Aleksandras Kostarevas Date: Mon, 29 Apr 2024 10:07:55 -0400 Subject: [PATCH] Update credits screen with linkbacks --- .../latin/uix/settings/pages/Credits.kt | 46 +++++++++++++++++-- .../latin/uix/settings/pages/Payment.kt | 4 +- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Credits.kt b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Credits.kt index cb8c466db..61d630154 100644 --- a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Credits.kt +++ b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Credits.kt @@ -1,21 +1,59 @@ package org.futo.inputmethod.latin.uix.settings.pages +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController import androidx.navigation.compose.rememberNavController import org.futo.inputmethod.latin.uix.settings.ScreenTitle import org.futo.inputmethod.latin.uix.settings.ScrollableList +import org.futo.inputmethod.updates.openURI @Preview(showBackground = true) @Composable fun CreditsScreen(navController: NavHostController = rememberNavController()) { + val context = LocalContext.current ScrollableList { ScreenTitle("Credits", showBack = true, navController) - ParagraphText("This keyboard is based on the LatinIME keyboard from the Android Open Source Project. Thank you to the original AOSP LatinIME Keyboard developers. The LatinIME keyboard is Apache-2.0 licensed and Copyright (C) 2011 The Android Open Source Project") - ParagraphText("Thank you to llama.cpp, whisper.cpp, ggml devs for making a compact machine learning inference library. These projects are MIT-licensed. Copyright (c) 2023 Georgi Gerganov") - ParagraphText("Thank you to OpenAI Whisper for the speech recognition model which is used for voice input. Whisper is MIT-licensed. Copyright (c) 2022 OpenAI") - ParagraphText("Thank you to Feather Icons for providing many of the icons seen in this app. Feather Icons is MIT-licensed. Copyright (c) 2013-2017 Cole Bemis") + ParagraphText("This project is made possible by the below projects!") + + ParagraphText("This keyboard is based on the LatinIME keyboard from the Android Open Source Project. Thank you to the original AOSP LatinIME Keyboard developers. The LatinIME keyboard is Apache-2.0 licensed and Copyright (C) 2011 The Android Open Source Project", + modifier = Modifier.clickable { + context.openURI("https://android.googlesource.com/platform/packages/inputmethods/LatinIME/") + }) + + ParagraphText("Thank you to llama.cpp, whisper.cpp, ggml devs for making a compact machine learning inference library. These projects are MIT-licensed. Copyright (c) 2023 Georgi Gerganov", + modifier = Modifier.clickable { + context.openURI("https://ggml.ai") + }) + + ParagraphText("Thank you to OpenAI Whisper for the speech recognition model which is used for local voice input. Whisper is MIT-licensed. Copyright (c) 2022 OpenAI", + modifier = Modifier.clickable { + context.openURI("https://github.com/openai/whisper") + }) + + ParagraphText("Thank you to Feather Icons for providing many of the icons seen in this app. Feather Icons is MIT-licensed. Copyright (c) 2013-2017 Cole Bemis", + modifier = Modifier.clickable { + context.openURI("https://feathericons.com") + }) + + ParagraphText("Thank you to the WebRTC project for the voice activity detection used to automatically stop voice input. WebRTC is BSD-3-Clause licensed. Copyright (c) 2011, The WebRTC project authors", + modifier = Modifier.clickable { + context.openURI("https://webrtc.org") + }) + + ParagraphText("Thank you to the android-vad project for providing Android bindings to the WebRTC voice activity detection. android-vad is MIT-licensed. Copyright (c) 2023 Georgiy Konovalov", + modifier = Modifier.clickable { + context.openURI("https://github.com/gkonovalov/android-vad") + }) + + Spacer(modifier = Modifier.height(16.dp)) + ParagraphText("Note: The authors listed above are not affiliated with us and do not endorse or promote us") } } \ No newline at end of file diff --git a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Payment.kt b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Payment.kt index 3b795ece0..fc1332ba8 100644 --- a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Payment.kt +++ b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Payment.kt @@ -111,8 +111,8 @@ fun useNumberOfDaysInstalled(): MutableIntState { } @Composable -fun ParagraphText(it: String) { - Text(it, modifier = Modifier.padding(16.dp, 8.dp), style = Typography.bodyMedium, +fun ParagraphText(it: String, modifier: Modifier = Modifier) { + Text(it, modifier = modifier.padding(16.dp, 8.dp), style = Typography.bodyMedium, color = MaterialTheme.colorScheme.onBackground) }