Skip to content

Commit

Permalink
fix(l10n): hide on Android 6 and below as it has no effect
Browse files Browse the repository at this point in the history
  • Loading branch information
aliernfrog committed Jul 21, 2024
1 parent 814c4b0 commit 13f87ba
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.aliernfrog.pftool.ui.screen.settings

import android.os.Build
import androidx.annotation.StringRes
import androidx.compose.animation.AnimatedContentTransitionScope
import androidx.compose.animation.AnimatedVisibility
Expand Down Expand Up @@ -127,7 +128,7 @@ private fun SettingsRootPage(

SettingsPage.entries
.filter {
it != SettingsPage.ROOT && !(it == SettingsPage.EXPERIMENTAL && !mainViewModel.prefs.experimentalOptionsEnabled)
it.showInSettingsHome && !(it == SettingsPage.EXPERIMENTAL && !mainViewModel.prefs.experimentalOptionsEnabled)
}
.forEach { page ->
ButtonRow(
Expand Down Expand Up @@ -216,6 +217,7 @@ enum class SettingsPage(
@StringRes val title: Int,
@StringRes val description: Int,
val icon: ImageVector,
val showInSettingsHome: Boolean = true,
val content: @Composable (
onNavigateBackRequest: () -> Unit,
onNavigateRequest: (SettingsPage) -> Unit
Expand All @@ -226,6 +228,7 @@ enum class SettingsPage(
title = R.string.settings,
description = R.string.settings,
icon = Icons.Outlined.Settings,
showInSettingsHome = false,
content = { onNavigateBackRequest, onNavigateRequest ->
SettingsRootPage(
onNavigateBackRequest = onNavigateBackRequest,
Expand Down Expand Up @@ -271,6 +274,7 @@ enum class SettingsPage(
title = R.string.settings_language,
description = R.string.settings_language_description,
icon = Icons.Outlined.Translate,
showInSettingsHome = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N,
content = { onNavigateBackRequest, _ ->
LanguagePage(onNavigateBackRequest = onNavigateBackRequest)
}
Expand Down

0 comments on commit 13f87ba

Please sign in to comment.