diff --git a/app/src/main/java/helium314/keyboard/latin/settings/Settings.kt b/app/src/main/java/helium314/keyboard/latin/settings/Settings.kt index 5a69869558..e37fc6fb53 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/Settings.kt +++ b/app/src/main/java/helium314/keyboard/latin/settings/Settings.kt @@ -595,6 +595,7 @@ class Settings private constructor() : SharedPreferences.OnSharedPreferenceChang const val PREF_SAVED_APP_SUBTYPE_PREFIX = "saved_app_subtype_" const val PREF_DONT_SHOW_SPONSOR_DIALOG = "dont_show_sponsor_dialog" const val PREF_LAST_SPONSOR_DIALOG_SHOWN = "last_sponsor_dialog_shown" + const val PREF_LAST_WHATS_NEW_VERSION = "last_whats_new_version" private val sInstance = Settings() @@ -612,6 +613,7 @@ class Settings private constructor() : SharedPreferences.OnSharedPreferenceChang PREF_SELECTED_SUBTYPE, PREF_USER_DICT_SORT_ORDER, PREF_LAST_SPONSOR_DIALOG_SHOWN, + PREF_LAST_WHATS_NEW_VERSION, "last_shown_emoticon_group", "last_shown_unicode_symbol_group", "last_dismissed_clipboard_text", diff --git a/app/src/main/java/helium314/keyboard/settings/SettingsJump.kt b/app/src/main/java/helium314/keyboard/settings/SettingsJump.kt index 711761ce0c..ac0eee71a9 100644 --- a/app/src/main/java/helium314/keyboard/settings/SettingsJump.kt +++ b/app/src/main/java/helium314/keyboard/settings/SettingsJump.kt @@ -6,6 +6,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.staticCompositionLocalOf +import androidx.core.content.edit import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner import androidx.navigation.NavBackStackEntry @@ -56,6 +57,13 @@ fun jumpOpenedSections(): Set { fun fineTuneExpanded(prefs: SharedPreferences, key: String, default: Boolean): Boolean = prefs.getBoolean(key, default) || key in jumpOpenedSections() +/** Closes all fine-tune sections, so the next opened settings page starts with them closed */ +fun collapseFineTuneSections(prefs: SharedPreferences) { + val open = prefs.all.keys.filter { it.startsWith(FINE_TUNE_SECTION_PREFIX) } + if (open.isEmpty()) return + prefs.edit { open.forEach { remove(it) } } +} + /** Changes of this screen's jump state, for use outside of composition */ class JumpState internal constructor(private val state: SavedStateHandle?) { fun setOpenedSections(sections: Collection) { state?.set(JUMP_OPENED_SECTIONS, ArrayList(sections)) } diff --git a/app/src/main/java/helium314/keyboard/settings/SettingsNavHost.kt b/app/src/main/java/helium314/keyboard/settings/SettingsNavHost.kt index b5fda5bddf..4132313d67 100644 --- a/app/src/main/java/helium314/keyboard/settings/SettingsNavHost.kt +++ b/app/src/main/java/helium314/keyboard/settings/SettingsNavHost.kt @@ -10,6 +10,10 @@ import androidx.compose.animation.slideOutHorizontally import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.unit.IntOffset @@ -20,6 +24,8 @@ import androidx.navigation.compose.rememberNavController import helium314.keyboard.latin.common.LocaleUtils.constructLocale import helium314.keyboard.latin.settings.SettingsSubtype.Companion.toSettingsSubtype import helium314.keyboard.latin.settings.getTransitionAnimationScale +import helium314.keyboard.latin.utils.getActivity +import helium314.keyboard.latin.utils.prefs import helium314.keyboard.settings.screens.AIIntegrationScreen import helium314.keyboard.settings.screens.AboutScreen import helium314.keyboard.settings.screens.AdvancedSettingsScreen @@ -66,6 +72,19 @@ fun SettingsNavHost( } } + // fine-tune sections start closed on every page opened from the main page (and on a fresh settings start); + // moving between a page and its sub-pages keeps them as the user left them + val ctx = LocalContext.current + var collapsedAtStart by rememberSaveable { mutableStateOf(false) } + LaunchedEffect(navController) { + navController.currentBackStackEntryFlow.collect { entry -> + if (collapsedAtStart && entry.destination.route != SettingsDestination.Settings) return@collect + collapsedAtStart = true + collapseFineTuneSections(ctx.prefs()) + (ctx.getActivity() as? SettingsActivity)?.prefChanged() + } + } + // duration does not change when system setting changes, but that's rare enough to not care val duration = (250 * getTransitionAnimationScale(LocalContext.current)).toInt() val animation = tween(durationMillis = duration) diff --git a/app/src/main/java/helium314/keyboard/settings/dialogs/SponsorDialog.kt b/app/src/main/java/helium314/keyboard/settings/dialogs/SponsorDialog.kt index 559819810d..59d9f1a0a1 100644 --- a/app/src/main/java/helium314/keyboard/settings/dialogs/SponsorDialog.kt +++ b/app/src/main/java/helium314/keyboard/settings/dialogs/SponsorDialog.kt @@ -3,7 +3,6 @@ package helium314.keyboard.settings.dialogs import android.content.SharedPreferences import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues @@ -15,37 +14,24 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.widthIn -import androidx.compose.foundation.layout.offset import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults -import androidx.compose.material3.Card -import androidx.compose.material3.CardDefaults -import androidx.compose.material3.Checkbox -import androidx.compose.material3.CheckboxDefaults -import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.OutlinedButton +import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Brush -import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.DialogProperties import androidx.core.content.edit import helium314.keyboard.latin.R import helium314.keyboard.latin.settings.Settings @@ -60,129 +46,123 @@ fun SponsorDialog( onSponsorOpenCollective: () -> Unit, prefs: SharedPreferences ) { - var neverShowAgain by remember { mutableStateOf(false) } - - val onDismiss = { - if (neverShowAgain) - prefs.edit { putBoolean(Settings.PREF_DONT_SHOW_SPONSOR_DIALOG, true) } + val onNeverShowAgain = { + prefs.edit { putBoolean(Settings.PREF_DONT_SHOW_SPONSOR_DIALOG, true) } onDismissRequest() } PreferenceDialog( - onDismissRequest = onDismiss, - title = stringResource(R.string.sponsor_dialog_title), - properties = DialogProperties(usePlatformDefaultWidth = false), - buttons = { - Column( + onDismissRequest = onDismissRequest, + showCloseButton = false, + icon = { + Box( + modifier = Modifier + .size(36.dp) + .background(MaterialTheme.colorScheme.primaryContainer, CircleShape), + contentAlignment = Alignment.Center + ) { + Icon( + painter = painterResource(R.drawable.ic_heart), + contentDescription = null, + modifier = Modifier.size(20.dp), + tint = MaterialTheme.colorScheme.onPrimaryContainer + ) + } + }, + titleComposable = { + Row( modifier = Modifier.fillMaxWidth(), - horizontalAlignment = Alignment.CenterHorizontally + verticalAlignment = Alignment.CenterVertically ) { + Text( + text = stringResource(R.string.sponsor_dialog_title), + modifier = Modifier.weight(1f) + ) + TextButton( + onClick = onNeverShowAgain, + modifier = Modifier.widthIn(max = 96.dp), + contentPadding = PaddingValues(horizontal = 8.dp, vertical = 4.dp), + colors = ButtonDefaults.textButtonColors( + contentColor = MaterialTheme.colorScheme.onSurfaceVariant + ) + ) { + Text( + text = stringResource(R.string.sponsor_dialog_never_show_again), + style = MaterialTheme.typography.labelMedium, + textAlign = TextAlign.Center, + maxLines = 2 + ) + } + } + }, + buttons = { + Column(modifier = Modifier.fillMaxWidth()) { Button( - onClick = { - if (neverShowAgain) - prefs.edit { putBoolean(Settings.PREF_DONT_SHOW_SPONSOR_DIALOG, true) } - onSponsorGitHub() - }, + onClick = onSponsorGitHub, modifier = Modifier.fillMaxWidth(), - shape = RoundedCornerShape(20.dp), - colors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.primary - ), - contentPadding = PaddingValues(vertical = 12.dp) + shape = RoundedCornerShape(16.dp), + contentPadding = PaddingValues(vertical = 14.dp) ) { Icon( painter = painterResource(R.drawable.ic_settings_about_github), contentDescription = null, - modifier = Modifier.size(20.dp), - tint = MaterialTheme.colorScheme.onPrimary + modifier = Modifier.size(20.dp) ) - Spacer(modifier = Modifier.width(8.dp)) + Spacer(modifier = Modifier.width(10.dp)) Text( text = stringResource(R.string.sponsor_github_button), - fontWeight = FontWeight.Bold + fontWeight = FontWeight.SemiBold ) } - Spacer(modifier = Modifier.height(10.dp)) + Spacer(modifier = Modifier.height(8.dp)) - OutlinedButton( - onClick = { - if (neverShowAgain) - prefs.edit { putBoolean(Settings.PREF_DONT_SHOW_SPONSOR_DIALOG, true) } - onSponsorOpenCollective() - }, + FilledTonalButton( + onClick = onSponsorOpenCollective, modifier = Modifier.fillMaxWidth(), - shape = RoundedCornerShape(20.dp), - contentPadding = PaddingValues(vertical = 12.dp) + shape = RoundedCornerShape(16.dp), + contentPadding = PaddingValues(vertical = 14.dp) ) { Icon( painter = painterResource(R.drawable.ic_opencollective), contentDescription = null, - modifier = Modifier.size(20.dp), - tint = MaterialTheme.colorScheme.primary + modifier = Modifier.size(20.dp) ) - Spacer(modifier = Modifier.width(8.dp)) + Spacer(modifier = Modifier.width(10.dp)) Text( text = stringResource(R.string.sponsor_opencollective_button), - fontWeight = FontWeight.Bold + fontWeight = FontWeight.SemiBold ) } - Spacer(modifier = Modifier.height(10.dp)) + Spacer(modifier = Modifier.height(12.dp)) - TextButton( - onClick = onDismiss, - colors = ButtonDefaults.textButtonColors( - contentColor = MaterialTheme.colorScheme.onSurfaceVariant - ) + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically ) { - Text( - text = stringResource(R.string.sponsor_dialog_not_now), - fontWeight = FontWeight.SemiBold - ) + TextButton(onClick = onDismissRequest) { + Text( + text = stringResource(R.string.sponsor_dialog_not_now), + fontWeight = FontWeight.SemiBold + ) + } } } } ) { - Column( - modifier = Modifier.fillMaxWidth(), - horizontalAlignment = Alignment.CenterHorizontally + Surface( + shape = RoundedCornerShape(20.dp), + color = MaterialTheme.colorScheme.surfaceContainerHigh, + modifier = Modifier.fillMaxWidth() ) { Text( text = stringResource(R.string.sponsor_dialog_message), style = MaterialTheme.typography.bodyMedium, lineHeight = MaterialTheme.typography.bodyMedium.lineHeight * 1.25f, - textAlign = TextAlign.Center, - color = MaterialTheme.colorScheme.onSurfaceVariant + color = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.padding(16.dp) ) - - Spacer(modifier = Modifier.height(20.dp)) - - HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.4f)) - - Spacer(modifier = Modifier.height(8.dp)) - - Row( - modifier = Modifier - .fillMaxWidth() - .offset(x = (-12).dp), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.Start - ) { - Checkbox( - checked = neverShowAgain, - onCheckedChange = { neverShowAgain = it }, - colors = CheckboxDefaults.colors( - checkedColor = MaterialTheme.colorScheme.primary - ) - ) - Spacer(modifier = Modifier.width(4.dp)) - Text( - text = stringResource(R.string.sponsor_dialog_never_show_again), - color = MaterialTheme.colorScheme.onSurfaceVariant, - style = MaterialTheme.typography.bodyMedium - ) - } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/helium314/keyboard/settings/dialogs/WhatsNewDialog.kt b/app/src/main/java/helium314/keyboard/settings/dialogs/WhatsNewDialog.kt new file mode 100644 index 0000000000..14f46597a3 --- /dev/null +++ b/app/src/main/java/helium314/keyboard/settings/dialogs/WhatsNewDialog.kt @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: GPL-3.0-only +package helium314.keyboard.settings.dialogs + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.OutlinedButton +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import helium314.keyboard.latin.BuildConfig +import helium314.keyboard.latin.R + +/** + * Shown once per app version on the first settings open after an update. + * Changelog first, support links below in a low-key style. + */ +@Composable +fun WhatsNewDialog( + changelogItems: List, + onDismissRequest: () -> Unit, + onSponsorGitHub: () -> Unit, + onSponsorOpenCollective: () -> Unit, +) { + PreferenceDialog( + onDismissRequest = onDismissRequest, + title = stringResource(R.string.updates_whats_new_title, BuildConfig.VERSION_NAME), + scrollContent = true, + buttons = { + Column(modifier = Modifier.fillMaxWidth()) { + HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.4f)) + Spacer(modifier = Modifier.height(12.dp)) + Text( + text = stringResource(R.string.updates_support_title), + style = MaterialTheme.typography.labelLarge, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + Spacer(modifier = Modifier.height(8.dp)) + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + SupportLinkButton( + iconRes = R.drawable.ic_settings_about_github, + label = stringResource(R.string.updates_github_sponsor_title), + onClick = onSponsorGitHub, + modifier = Modifier.weight(1f) + ) + SupportLinkButton( + iconRes = R.drawable.ic_opencollective, + label = stringResource(R.string.open_collective), + onClick = onSponsorOpenCollective, + modifier = Modifier.weight(1f) + ) + } + } + } + ) { + Column { + for (item in changelogItems) { + Text( + text = item, + style = MaterialTheme.typography.bodyMedium, + lineHeight = MaterialTheme.typography.bodyMedium.lineHeight * 1.2f, + color = MaterialTheme.colorScheme.onSurface, + modifier = Modifier.padding(vertical = 4.dp) + ) + } + } + } +} + +@Composable +private fun SupportLinkButton(iconRes: Int, label: String, onClick: () -> Unit, modifier: Modifier) { + OutlinedButton( + onClick = onClick, + modifier = modifier, + shape = RoundedCornerShape(12.dp), + contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp) + ) { + Icon( + painter = painterResource(iconRes), + contentDescription = null, + modifier = Modifier.size(18.dp) + ) + Spacer(modifier = Modifier.width(6.dp)) + Text( + text = label, + style = MaterialTheme.typography.labelLarge, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.align(Alignment.CenterVertically) + ) + } +} diff --git a/app/src/main/java/helium314/keyboard/settings/screens/MainSettingsScreen.kt b/app/src/main/java/helium314/keyboard/settings/screens/MainSettingsScreen.kt index 81d0d178b8..5b90c4bd37 100644 --- a/app/src/main/java/helium314/keyboard/settings/screens/MainSettingsScreen.kt +++ b/app/src/main/java/helium314/keyboard/settings/screens/MainSettingsScreen.kt @@ -54,6 +54,7 @@ import helium314.keyboard.settings.SettingsActivity import helium314.keyboard.settings.updates.AppUpdatesManager import helium314.keyboard.settings.Theme import helium314.keyboard.settings.dialogs.SponsorDialog +import helium314.keyboard.settings.dialogs.WhatsNewDialog import helium314.keyboard.settings.initPreview import helium314.keyboard.settings.preferences.Preference import helium314.keyboard.settings.previewDark @@ -94,6 +95,18 @@ fun MainSettingsScreen( Defaults.PREF_LAST_SPONSOR_DIALOG_SHOWN ) var settingsOpenCount by remember { mutableStateOf(prefs.getInt("settings_open_count", 0)) } + // Show the changelog once per version, but not on a fresh install (no earlier settings open) + val whatsNewPending = remember { + prefs.getInt(Settings.PREF_LAST_WHATS_NEW_VERSION, 0) < BuildConfig.VERSION_CODE + } + var showWhatsNew by rememberSaveable { mutableStateOf(false) } + if (whatsNewPending) { + LaunchedEffect(Unit) { + if (settingsOpenCount > 0 && currentChangelogItems.isNotEmpty()) + showWhatsNew = true + prefs.edit { putInt(Settings.PREF_LAST_WHATS_NEW_VERSION, BuildConfig.VERSION_CODE) } + } + } LaunchedEffect(Unit) { val newCount = settingsOpenCount + 1 prefs.edit { putInt("settings_open_count", newCount) } @@ -109,11 +122,21 @@ fun MainSettingsScreen( ) var showSponsorDialog by rememberSaveable { mutableStateOf(false) } - if (shouldShow) { + // what's new takes precedence, the sponsor dialog then shows on a later settings open + if (shouldShow && !whatsNewPending) { LaunchedEffect(Unit) { showSponsorDialog = true } } + + if (showWhatsNew) { + WhatsNewDialog( + changelogItems = currentChangelogItems, + onDismissRequest = { showWhatsNew = false }, + onSponsorGitHub = { ctx.startActivity(Intent(Intent.ACTION_VIEW, Links.SPONSOR.toUri())) }, + onSponsorOpenCollective = { ctx.startActivity(Intent(Intent.ACTION_VIEW, Links.OPEN_COLLECTIVE.toUri())) } + ) + } if (showSponsorDialog) { LaunchedEffect(Unit) { diff --git a/app/src/main/java/helium314/keyboard/settings/screens/UpdatesScreen.kt b/app/src/main/java/helium314/keyboard/settings/screens/UpdatesScreen.kt index 2acc11a4ea..a27ca1ac08 100644 --- a/app/src/main/java/helium314/keyboard/settings/screens/UpdatesScreen.kt +++ b/app/src/main/java/helium314/keyboard/settings/screens/UpdatesScreen.kt @@ -63,7 +63,7 @@ import helium314.keyboard.settings.preferences.SwitchPreference import helium314.keyboard.settings.updates.AppUpdatesManager import kotlinx.coroutines.launch -private val currentChangelogItems = listOf( +internal val currentChangelogItems = listOf( "• PC QWERTY: Caps lock no longer shifts the number row and punctuation", "• Hebrew: Symbols page uses the normal layout again instead of Arabic symbols", "• Delete Word Swipe: One swipe deletes the word you are still typing" @@ -152,6 +152,53 @@ fun UpdatesScreen( .padding(innerPadding) .padding(vertical = 8.dp) ) { + // Support & Sponsorship (top, so it is easy to find) + Card( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp, vertical = 8.dp), + colors = CardDefaults.cardColors( + containerColor = MaterialTheme.colorScheme.surfaceContainer + ) + ) { + Column(modifier = Modifier.padding(vertical = 4.dp)) { + Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 12.dp)) { + Text( + text = stringResource(R.string.updates_support_title), + style = MaterialTheme.typography.titleMedium, + color = MaterialTheme.colorScheme.primary, + fontWeight = FontWeight.SemiBold + ) + Spacer(modifier = Modifier.height(4.dp)) + Text( + text = stringResource(R.string.updates_support_summary), + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + } + + Preference( + name = stringResource(R.string.updates_github_sponsor_title), + description = stringResource(R.string.updates_github_sponsor_desc), + icon = R.drawable.ic_settings_about_github, + onClick = { + val intent = Intent(Intent.ACTION_VIEW, Links.SPONSOR.toUri()) + context.startActivity(intent) + } + ) + + Preference( + name = stringResource(R.string.updates_opencollective_title), + description = stringResource(R.string.updates_opencollective_desc), + icon = R.drawable.ic_opencollective, + onClick = { + val intent = Intent(Intent.ACTION_VIEW, Links.OPEN_COLLECTIVE.toUri()) + context.startActivity(intent) + } + ) + } + } + // Section 1: App Updates (OMITTED entirely on offline flavor) if (isOnlineFlavor) { // Minimal Update Indicator Banner if update is available @@ -378,53 +425,6 @@ fun UpdatesScreen( } } - // Section 2: Support & Sponsorship - Card( - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp, vertical = 8.dp), - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceContainer - ) - ) { - Column(modifier = Modifier.padding(vertical = 4.dp)) { - Column(modifier = Modifier.padding(horizontal = 16.dp, vertical = 12.dp)) { - Text( - text = stringResource(R.string.updates_support_title), - style = MaterialTheme.typography.titleMedium, - color = MaterialTheme.colorScheme.primary, - fontWeight = FontWeight.SemiBold - ) - Spacer(modifier = Modifier.height(4.dp)) - Text( - text = stringResource(R.string.updates_support_summary), - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant - ) - } - - Preference( - name = stringResource(R.string.updates_github_sponsor_title), - description = stringResource(R.string.updates_github_sponsor_desc), - icon = R.drawable.ic_settings_about_github, - onClick = { - val intent = Intent(Intent.ACTION_VIEW, Links.SPONSOR.toUri()) - context.startActivity(intent) - } - ) - - Preference( - name = stringResource(R.string.updates_opencollective_title), - description = stringResource(R.string.updates_opencollective_desc), - icon = R.drawable.ic_opencollective, - onClick = { - val intent = Intent(Intent.ACTION_VIEW, Links.OPEN_COLLECTIVE.toUri()) - context.startActivity(intent) - } - ) - } - } - // Section 3: Changelog (Current Version Only) var isChangelogExpanded by remember { mutableStateOf(false) } Card( diff --git a/app/src/main/res/drawable/ic_heart.xml b/app/src/main/res/drawable/ic_heart.xml new file mode 100644 index 0000000000..8ef74ea6a7 --- /dev/null +++ b/app/src/main/res/drawable/ic_heart.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 2f6ecc0c1c..4d05dabf83 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -75,5 +75,6 @@ Tamil LeanType + Open Collective