mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-15 02:36:12 -04:00
refactor(settings): Rename ProBadge to UpgradeBadge for flavor neutrality
The 'Pro' label is gplay-specific vocabulary — FOSS unlocks the same features via sponsorship. Aligns with the existing flavor-neutral terms already used in UpgradeRepo, Nav.Main.Upgrade and launchUpgrade(). Renames the proLocked parameter to requiresUpgrade across SettingsBaseItem and its three wrappers, and adds a new common_upgrade_required_label string (Requires upgrade) for the badge content description.
This commit is contained in:
@@ -38,7 +38,7 @@ fun SettingsBaseItem(
|
||||
iconSize: Dp = 24.dp,
|
||||
subtitle: String? = null,
|
||||
enabled: Boolean = true,
|
||||
proLocked: Boolean = false,
|
||||
requiresUpgrade: Boolean = false,
|
||||
onLongClick: (() -> Unit)? = null,
|
||||
trailingContent: @Composable (() -> Unit)? = null,
|
||||
) {
|
||||
@@ -97,9 +97,9 @@ fun SettingsBaseItem(
|
||||
fontWeight = FontWeight.Normal,
|
||||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = contentAlpha)
|
||||
)
|
||||
if (proLocked) {
|
||||
if (requiresUpgrade) {
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
ProBadge()
|
||||
UpgradeBadge()
|
||||
}
|
||||
}
|
||||
if (subtitle != null) {
|
||||
|
||||
@@ -38,7 +38,7 @@ fun <T> SettingsListPreferenceItem(
|
||||
modifier: Modifier = Modifier,
|
||||
subtitle: String? = null,
|
||||
enabled: Boolean = true,
|
||||
proLocked: Boolean = false,
|
||||
requiresUpgrade: Boolean = false,
|
||||
) {
|
||||
var showDialog by remember { mutableStateOf(false) }
|
||||
|
||||
@@ -49,7 +49,7 @@ fun <T> SettingsListPreferenceItem(
|
||||
onClick = { if (enabled) showDialog = true },
|
||||
modifier = modifier,
|
||||
enabled = enabled,
|
||||
proLocked = proLocked,
|
||||
requiresUpgrade = requiresUpgrade,
|
||||
)
|
||||
|
||||
if (showDialog) {
|
||||
|
||||
@@ -17,7 +17,7 @@ fun SettingsPreferenceItem(
|
||||
subtitle: String? = null,
|
||||
value: String? = null,
|
||||
enabled: Boolean = true,
|
||||
proLocked: Boolean = false,
|
||||
requiresUpgrade: Boolean = false,
|
||||
) {
|
||||
val contentAlpha = if (enabled) 1f else 0.5f
|
||||
|
||||
@@ -28,7 +28,7 @@ fun SettingsPreferenceItem(
|
||||
modifier = modifier,
|
||||
subtitle = subtitle,
|
||||
enabled = enabled,
|
||||
proLocked = proLocked,
|
||||
requiresUpgrade = requiresUpgrade,
|
||||
trailingContent = if (value != null) {
|
||||
{
|
||||
Text(
|
||||
|
||||
@@ -20,7 +20,7 @@ fun SettingsSwitchItem(
|
||||
onCheckedChange: (Boolean) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
proLocked: Boolean = false,
|
||||
requiresUpgrade: Boolean = false,
|
||||
) {
|
||||
SettingsBaseItem(
|
||||
icon = icon,
|
||||
@@ -29,7 +29,7 @@ fun SettingsSwitchItem(
|
||||
modifier = modifier,
|
||||
subtitle = subtitle,
|
||||
enabled = enabled,
|
||||
proLocked = proLocked,
|
||||
requiresUpgrade = requiresUpgrade,
|
||||
trailingContent = {
|
||||
Switch(
|
||||
checked = checked,
|
||||
|
||||
+4
-4
@@ -14,10 +14,10 @@ import eu.darken.capod.common.compose.Preview2
|
||||
import eu.darken.capod.common.compose.PreviewWrapper
|
||||
|
||||
@Composable
|
||||
fun ProBadge(modifier: Modifier = Modifier) {
|
||||
fun UpgradeBadge(modifier: Modifier = Modifier) {
|
||||
Icon(
|
||||
imageVector = Icons.TwoTone.Stars,
|
||||
contentDescription = stringResource(R.string.overview_anc_mode_requires_upgrade),
|
||||
contentDescription = stringResource(R.string.common_upgrade_required_label),
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
modifier = modifier.size(16.dp),
|
||||
)
|
||||
@@ -25,6 +25,6 @@ fun ProBadge(modifier: Modifier = Modifier) {
|
||||
|
||||
@Preview2
|
||||
@Composable
|
||||
private fun ProBadgePreview() = PreviewWrapper {
|
||||
ProBadge()
|
||||
private fun UpgradeBadgePreview() = PreviewWrapper {
|
||||
UpgradeBadge()
|
||||
}
|
||||
@@ -288,7 +288,7 @@ fun DeviceSettingsScreen(
|
||||
title = stringResource(R.string.device_settings_listening_mode_cycle_label),
|
||||
subtitle = stringResource(R.string.device_settings_listening_mode_cycle_description),
|
||||
onClick = onUpgrade,
|
||||
proLocked = true,
|
||||
requiresUpgrade = true,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -480,7 +480,7 @@ fun DeviceSettingsScreen(
|
||||
subtitle = stringResource(R.string.stem_actions_nav_description),
|
||||
onClick = onStemActionsClick,
|
||||
enabled = enabled,
|
||||
proLocked = !isPro,
|
||||
requiresUpgrade = !isPro,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -516,7 +516,7 @@ fun DeviceSettingsScreen(
|
||||
checked = sleepDet.enabled,
|
||||
onCheckedChange = onSleepDetectionChange,
|
||||
enabled = enabled,
|
||||
proLocked = !isPro,
|
||||
requiresUpgrade = !isPro,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ fun GeneralSettingsScreen(
|
||||
title = stringResource(R.string.ui_theme_mode_label),
|
||||
subtitle = stringResource(state.themeState.mode.labelRes),
|
||||
onClick = onUpgrade,
|
||||
proLocked = true,
|
||||
requiresUpgrade = true,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ fun GeneralSettingsScreen(
|
||||
title = stringResource(R.string.ui_theme_style_label),
|
||||
subtitle = stringResource(state.themeState.style.labelRes),
|
||||
onClick = onUpgrade,
|
||||
proLocked = true,
|
||||
requiresUpgrade = true,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ fun GeneralSettingsScreen(
|
||||
if (!state.isPro) onUpgrade() else showColorDialog = true
|
||||
},
|
||||
enabled = !isMaterialYouActive,
|
||||
proLocked = !state.isPro && !isMaterialYouActive,
|
||||
requiresUpgrade = !state.isPro && !isMaterialYouActive,
|
||||
)
|
||||
}
|
||||
item {
|
||||
|
||||
@@ -127,7 +127,7 @@ fun ReactionSettingsScreen(
|
||||
subtitle = stringResource(R.string.settings_autoplay_description),
|
||||
checked = state.autoPlay,
|
||||
onCheckedChange = onAutoPlayChanged,
|
||||
proLocked = !state.isPro,
|
||||
requiresUpgrade = !state.isPro,
|
||||
)
|
||||
}
|
||||
item {
|
||||
@@ -137,7 +137,7 @@ fun ReactionSettingsScreen(
|
||||
subtitle = stringResource(R.string.settings_autopause_description),
|
||||
checked = state.autoPause,
|
||||
onCheckedChange = onAutoPauseChanged,
|
||||
proLocked = !state.isPro,
|
||||
requiresUpgrade = !state.isPro,
|
||||
)
|
||||
}
|
||||
item {
|
||||
@@ -159,7 +159,7 @@ fun ReactionSettingsScreen(
|
||||
subtitle = stringResource(R.string.settings_autoconnect_description),
|
||||
checked = state.autoConnect,
|
||||
onCheckedChange = onAutoConnectChanged,
|
||||
proLocked = !state.isPro,
|
||||
requiresUpgrade = !state.isPro,
|
||||
)
|
||||
}
|
||||
item {
|
||||
@@ -181,7 +181,7 @@ fun ReactionSettingsScreen(
|
||||
subtitle = stringResource(R.string.settings_popup_caseopen_description),
|
||||
checked = state.showPopUpOnCaseOpen,
|
||||
onCheckedChange = onShowPopUpOnCaseOpenChanged,
|
||||
proLocked = !state.isPro,
|
||||
requiresUpgrade = !state.isPro,
|
||||
)
|
||||
}
|
||||
item {
|
||||
@@ -191,7 +191,7 @@ fun ReactionSettingsScreen(
|
||||
subtitle = stringResource(R.string.settings_popup_connected_description),
|
||||
checked = state.showPopUpOnConnection,
|
||||
onCheckedChange = onShowPopUpOnConnectionChanged,
|
||||
proLocked = !state.isPro,
|
||||
requiresUpgrade = !state.isPro,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<string name="general_thank_you_label">Thank you</string>
|
||||
<string name="general_upgrade_action">Upgrade</string>
|
||||
<string name="common_feature_requires_pro_msg">Upgrade to unlock.</string>
|
||||
<string name="common_upgrade_required_label">Requires upgrade</string>
|
||||
<string name="general_donate_action">Donate</string>
|
||||
<string name="general_check_action">Check</string>
|
||||
<string name="general_close_action">Close</string>
|
||||
|
||||
Reference in New Issue
Block a user