|
|
@ -108,7 +108,7 @@ fun SettingsDialog(
|
|
|
|
onDismissRequest = { onDismiss() },
|
|
|
|
onDismissRequest = { onDismiss() },
|
|
|
|
title = {
|
|
|
|
title = {
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = stringResource(string.settings_title),
|
|
|
|
text = stringResource(string.feature_settings_title),
|
|
|
|
style = MaterialTheme.typography.titleLarge,
|
|
|
|
style = MaterialTheme.typography.titleLarge,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -118,7 +118,7 @@ fun SettingsDialog(
|
|
|
|
when (settingsUiState) {
|
|
|
|
when (settingsUiState) {
|
|
|
|
Loading -> {
|
|
|
|
Loading -> {
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = stringResource(string.loading),
|
|
|
|
text = stringResource(string.feature_settings_loading),
|
|
|
|
modifier = Modifier.padding(vertical = 16.dp),
|
|
|
|
modifier = Modifier.padding(vertical = 16.dp),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -140,7 +140,7 @@ fun SettingsDialog(
|
|
|
|
},
|
|
|
|
},
|
|
|
|
confirmButton = {
|
|
|
|
confirmButton = {
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = stringResource(string.dismiss_dialog_button_text),
|
|
|
|
text = stringResource(string.feature_settings_dismiss_dialog_button_text),
|
|
|
|
style = MaterialTheme.typography.labelLarge,
|
|
|
|
style = MaterialTheme.typography.labelLarge,
|
|
|
|
color = MaterialTheme.colorScheme.primary,
|
|
|
|
color = MaterialTheme.colorScheme.primary,
|
|
|
|
modifier = Modifier
|
|
|
|
modifier = Modifier
|
|
|
@ -160,50 +160,50 @@ private fun ColumnScope.SettingsPanel(
|
|
|
|
onChangeDynamicColorPreference: (useDynamicColor: Boolean) -> Unit,
|
|
|
|
onChangeDynamicColorPreference: (useDynamicColor: Boolean) -> Unit,
|
|
|
|
onChangeDarkThemeConfig: (darkThemeConfig: DarkThemeConfig) -> Unit,
|
|
|
|
onChangeDarkThemeConfig: (darkThemeConfig: DarkThemeConfig) -> Unit,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
SettingsDialogSectionTitle(text = stringResource(string.theme))
|
|
|
|
SettingsDialogSectionTitle(text = stringResource(string.feature_settings_theme))
|
|
|
|
Column(Modifier.selectableGroup()) {
|
|
|
|
Column(Modifier.selectableGroup()) {
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
text = stringResource(string.brand_default),
|
|
|
|
text = stringResource(string.feature_settings_brand_default),
|
|
|
|
selected = settings.brand == DEFAULT,
|
|
|
|
selected = settings.brand == DEFAULT,
|
|
|
|
onClick = { onChangeThemeBrand(DEFAULT) },
|
|
|
|
onClick = { onChangeThemeBrand(DEFAULT) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
text = stringResource(string.brand_android),
|
|
|
|
text = stringResource(string.feature_settings_brand_android),
|
|
|
|
selected = settings.brand == ANDROID,
|
|
|
|
selected = settings.brand == ANDROID,
|
|
|
|
onClick = { onChangeThemeBrand(ANDROID) },
|
|
|
|
onClick = { onChangeThemeBrand(ANDROID) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AnimatedVisibility(visible = settings.brand == DEFAULT && supportDynamicColor) {
|
|
|
|
AnimatedVisibility(visible = settings.brand == DEFAULT && supportDynamicColor) {
|
|
|
|
Column {
|
|
|
|
Column {
|
|
|
|
SettingsDialogSectionTitle(text = stringResource(string.dynamic_color_preference))
|
|
|
|
SettingsDialogSectionTitle(text = stringResource(string.feature_settings_dynamic_color_preference))
|
|
|
|
Column(Modifier.selectableGroup()) {
|
|
|
|
Column(Modifier.selectableGroup()) {
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
text = stringResource(string.dynamic_color_yes),
|
|
|
|
text = stringResource(string.feature_settings_dynamic_color_yes),
|
|
|
|
selected = settings.useDynamicColor,
|
|
|
|
selected = settings.useDynamicColor,
|
|
|
|
onClick = { onChangeDynamicColorPreference(true) },
|
|
|
|
onClick = { onChangeDynamicColorPreference(true) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
text = stringResource(string.dynamic_color_no),
|
|
|
|
text = stringResource(string.feature_settings_dynamic_color_no),
|
|
|
|
selected = !settings.useDynamicColor,
|
|
|
|
selected = !settings.useDynamicColor,
|
|
|
|
onClick = { onChangeDynamicColorPreference(false) },
|
|
|
|
onClick = { onChangeDynamicColorPreference(false) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SettingsDialogSectionTitle(text = stringResource(string.dark_mode_preference))
|
|
|
|
SettingsDialogSectionTitle(text = stringResource(string.feature_settings_dark_mode_preference))
|
|
|
|
Column(Modifier.selectableGroup()) {
|
|
|
|
Column(Modifier.selectableGroup()) {
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
text = stringResource(string.dark_mode_config_system_default),
|
|
|
|
text = stringResource(string.feature_settings_dark_mode_config_system_default),
|
|
|
|
selected = settings.darkThemeConfig == FOLLOW_SYSTEM,
|
|
|
|
selected = settings.darkThemeConfig == FOLLOW_SYSTEM,
|
|
|
|
onClick = { onChangeDarkThemeConfig(FOLLOW_SYSTEM) },
|
|
|
|
onClick = { onChangeDarkThemeConfig(FOLLOW_SYSTEM) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
text = stringResource(string.dark_mode_config_light),
|
|
|
|
text = stringResource(string.feature_settings_dark_mode_config_light),
|
|
|
|
selected = settings.darkThemeConfig == LIGHT,
|
|
|
|
selected = settings.darkThemeConfig == LIGHT,
|
|
|
|
onClick = { onChangeDarkThemeConfig(LIGHT) },
|
|
|
|
onClick = { onChangeDarkThemeConfig(LIGHT) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
SettingsDialogThemeChooserRow(
|
|
|
|
text = stringResource(string.dark_mode_config_dark),
|
|
|
|
text = stringResource(string.feature_settings_dark_mode_config_dark),
|
|
|
|
selected = settings.darkThemeConfig == DARK,
|
|
|
|
selected = settings.darkThemeConfig == DARK,
|
|
|
|
onClick = { onChangeDarkThemeConfig(DARK) },
|
|
|
|
onClick = { onChangeDarkThemeConfig(DARK) },
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -259,7 +259,7 @@ private fun LinksPanel() {
|
|
|
|
NiaTextButton(
|
|
|
|
NiaTextButton(
|
|
|
|
onClick = { uriHandler.openUri(PRIVACY_POLICY_URL) },
|
|
|
|
onClick = { uriHandler.openUri(PRIVACY_POLICY_URL) },
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Text(text = stringResource(string.privacy_policy))
|
|
|
|
Text(text = stringResource(string.feature_settings_privacy_policy))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val context = LocalContext.current
|
|
|
|
val context = LocalContext.current
|
|
|
|
NiaTextButton(
|
|
|
|
NiaTextButton(
|
|
|
@ -267,17 +267,17 @@ private fun LinksPanel() {
|
|
|
|
context.startActivity(Intent(context, OssLicensesMenuActivity::class.java))
|
|
|
|
context.startActivity(Intent(context, OssLicensesMenuActivity::class.java))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Text(text = stringResource(string.licenses))
|
|
|
|
Text(text = stringResource(string.feature_settings_licenses))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
NiaTextButton(
|
|
|
|
NiaTextButton(
|
|
|
|
onClick = { uriHandler.openUri(BRAND_GUIDELINES_URL) },
|
|
|
|
onClick = { uriHandler.openUri(BRAND_GUIDELINES_URL) },
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Text(text = stringResource(string.brand_guidelines))
|
|
|
|
Text(text = stringResource(string.feature_settings_brand_guidelines))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
NiaTextButton(
|
|
|
|
NiaTextButton(
|
|
|
|
onClick = { uriHandler.openUri(FEEDBACK_URL) },
|
|
|
|
onClick = { uriHandler.openUri(FEEDBACK_URL) },
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Text(text = stringResource(string.feedback))
|
|
|
|
Text(text = stringResource(string.feature_settings_feedback))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|