From adfe20b54cd9d57f61dd6bea1dc7d4d78768729a Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Fri, 11 Nov 2022 13:50:49 +0300 Subject: [PATCH] android: Support info (#1347) * android: Support info * Dirrectly to Play Store * Different icon * text Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --- .../app/views/usersettings/SettingsView.kt | 64 +++++++++++++++++-- .../app/src/main/res/values-de/strings.xml | 8 ++- .../app/src/main/res/values-ru/strings.xml | 8 ++- .../app/src/main/res/values/strings.xml | 8 ++- 4 files changed, 76 insertions(+), 12 deletions(-) diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/SettingsView.kt b/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/SettingsView.kt index 012c77ba4f..94f523d83f 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/SettingsView.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/SettingsView.kt @@ -146,13 +146,25 @@ fun SettingsLayout( } SectionSpacer() + SectionView(stringResource(R.string.settings_section_title_support)) { + ContributeItem(uriHandler) + SectionDivider() + RateAppItem(uriHandler) + SectionDivider() + StarOnGithubItem(uriHandler) + } + SectionSpacer() + SectionView(stringResource(R.string.settings_section_title_develop)) { - ChatConsoleItem(showTerminal) - SectionDivider() - SettingsPreferenceItem(Icons.Outlined.Construction, stringResource(R.string.settings_developer_tools), developerTools) - SectionDivider() - InstallTerminalAppItem(uriHandler) - SectionDivider() + val devTools = remember { mutableStateOf(developerTools.get()) } + SettingsPreferenceItem(Icons.Outlined.Construction, stringResource(R.string.settings_developer_tools), developerTools, devTools) + if (devTools.value) { + SectionDivider() + ChatConsoleItem(showTerminal) + SectionDivider() + InstallTerminalAppItem(uriHandler) + SectionDivider() + } // SettingsActionItem(Icons.Outlined.Science, stringResource(R.string.settings_experimental_features), showSettingsModal { ExperimentalFeaturesView(it, enableCalls) }) // SectionDivider() AppVersionItem() @@ -252,6 +264,46 @@ fun MaintainIncognitoState(chatModel: ChatModel) { } } +@Composable private fun ContributeItem(uriHandler: UriHandler) { + SectionItemView({ uriHandler.openUri("https://github.com/simplex-chat/simplex-chat#contribute") }) { + Icon( + Icons.Outlined.Keyboard, + contentDescription = "GitHub", + tint = HighOrLowlight, + ) + Spacer(Modifier.padding(horizontal = 4.dp)) + Text(generalGetString(R.string.contribute), color = MaterialTheme.colors.primary) + } +} + +@Composable private fun RateAppItem(uriHandler: UriHandler) { + SectionItemView({ + runCatching { uriHandler.openUri("market://details?id=chat.simplex.app") } + .onFailure { uriHandler.openUri("https://play.google.com/store/apps/details?id=chat.simplex.app") } + } + ) { + Icon( + Icons.Outlined.StarOutline, + contentDescription = "Google Play", + tint = HighOrLowlight, + ) + Spacer(Modifier.padding(horizontal = 4.dp)) + Text(generalGetString(R.string.rate_the_app), color = MaterialTheme.colors.primary) + } +} + +@Composable private fun StarOnGithubItem(uriHandler: UriHandler) { + SectionItemView({ uriHandler.openUri("https://github.com/simplex-chat/simplex-chat") }) { + Icon( + painter = painterResource(id = R.drawable.ic_github), + contentDescription = "GitHub", + tint = HighOrLowlight, + ) + Spacer(Modifier.padding(horizontal = 4.dp)) + Text(generalGetString(R.string.star_on_github), color = MaterialTheme.colors.primary) + } +} + @Composable private fun ChatConsoleItem(showTerminal: () -> Unit) { SectionItemView(showTerminal) { Icon( diff --git a/apps/android/app/src/main/res/values-de/strings.xml b/apps/android/app/src/main/res/values-de/strings.xml index c543f6c38c..303d088473 100644 --- a/apps/android/app/src/main/res/values-de/strings.xml +++ b/apps/android/app/src/main/res/values-de/strings.xml @@ -58,7 +58,7 @@ Fehler beim Empfangen der Datei Fehler beim Erstellen der Adresse Kontakt ist bereits vorhanden - Sie sind bereits über diesen Link mit %1$s! verbunden. + Sie sind bereits mit %1$s! verbunden. Ungültiger Verbindungslink Überprüfen Sie bitte, ob Sie den richtigen Link genutzt haben oder bitten Sie Ihren Kontakt darum, Ihnen nochmal einen Link zuzusenden. Verbindungsfehler (AUTH) @@ -356,12 +356,15 @@ Wie man SimpleX nutzt Markdown Hilfe Markdown in Nachrichten - Verbinden Sie sich mit den Entwicklern + ***Send questions and ideas Senden Sie uns eine E-Mail SimpleX Sperre Chat Konsole SMP-Server Installieren Sie SimpleX Chat als Terminalanwendung + ***Star on GitHub + ***Contribute + ***Rate the app Verwenden Sie SimpleX Chat Server? Gespeicherte SMP-Server werden entfernt. Ihre SMP-Server @@ -562,6 +565,7 @@ MEINE DATEN EINSTELLUNGEN HILFE + ***SUPPORT SIMPLEX CHAT ENTWICKLUNG GERÄT CHATS diff --git a/apps/android/app/src/main/res/values-ru/strings.xml b/apps/android/app/src/main/res/values-ru/strings.xml index ca1f0db918..1c3e258665 100644 --- a/apps/android/app/src/main/res/values-ru/strings.xml +++ b/apps/android/app/src/main/res/values-ru/strings.xml @@ -58,7 +58,7 @@ Ошибка при получении файла Ошибка при создании адреса Существующий контакт - Вы уже соединены с %1$s! через эту ссылку. + Вы уже соединены с контактом %1$s!. Ошибка в ссылке контакта Пожалуйста, проверьте, что вы использовали правильную ссылку, или попросите ваш контакт отправить вам новую. Ошибка соединения (AUTH) @@ -353,12 +353,15 @@ Как использовать Форматирование сообщений Форматирование сообщений - Соединиться с разработчиками + Отправьте вопросы и идеи Отправить email Блокировка SimpleX Консоль SMP серверы SimpleX Chat для терминала + Поставить звездочку в GitHub + Внести свой вклад + Оценить приложение Использовать серверы предосталенные SimpleX Chat? Сохраненные SMP серверы будут удалены. Ваши SMP серверы @@ -562,6 +565,7 @@ ВЫ НАСТРОЙКИ ПОМОЩЬ + ПОДДЕРЖАТЬ SIMPLEX CHAT ДЛЯ РАЗРАБОТЧИКОВ УСТРОЙСТВО ЧАТЫ diff --git a/apps/android/app/src/main/res/values/strings.xml b/apps/android/app/src/main/res/values/strings.xml index 5efcc80432..a1c83add72 100644 --- a/apps/android/app/src/main/res/values/strings.xml +++ b/apps/android/app/src/main/res/values/strings.xml @@ -58,7 +58,7 @@ Error receiving file Error creating address Contact already exists - You are already connected to %1$s! via this link. + You are already connected to %1$s!. Invalid connection link Please check that you used the correct link or ask your contact to send you another one. Connection error (AUTH) @@ -356,12 +356,15 @@ How to use it Markdown help Markdown in messages - Connect to the developers + Send questions and ideas Send us email SimpleX Lock Chat console SMP servers Install SimpleX Chat for terminal + Star on GitHub + Contribute + Rate the app Use SimpleX Chat servers? Saved SMP servers will be removed. Your SMP servers @@ -562,6 +565,7 @@ YOU SETTINGS HELP + SUPPORT SIMPLEX CHAT DEVELOP DEVICE CHATS