Update copy
This commit is contained in:
committed by
Suphon Thanakornpakapong
parent
66d29195ac
commit
a6e7618e06
@@ -75,9 +75,10 @@
|
||||
<string name="design_and_development">Design & Development</string>
|
||||
<string name="translate">Translate</string>
|
||||
<string name="product">Product</string>
|
||||
<string name="hidden_apps_label">Hidden apps</string>
|
||||
<plurals name="hidden_apps_count">
|
||||
<item quantity="one">%1$d app hidden</item>
|
||||
<item quantity="other">%1$d apps hidden</item>
|
||||
<string name="hidden_apps_label">Hidden Apps</string>
|
||||
<string name="hidden_apps_label_with_count">Hidden Apps (%1$d)</string>
|
||||
<plurals name="apps_count">
|
||||
<item quantity="one">%1$d App</item>
|
||||
<item quantity="other">%1$d Apps</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
|
||||
@@ -18,6 +18,7 @@ package app.lawnchair.ui.preferences
|
||||
|
||||
import androidx.compose.animation.ExperimentalAnimationApi
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.navigation.NavGraphBuilder
|
||||
import app.lawnchair.ui.preferences.components.NavigationActionPreference
|
||||
@@ -45,12 +46,13 @@ fun NavGraphBuilder.appDrawerGraph(route: String) {
|
||||
@Composable
|
||||
fun AppDrawerPreferences() {
|
||||
val prefs = preferenceManager()
|
||||
val resources = LocalContext.current.resources
|
||||
pageMeta.provide(Meta(title = stringResource(id = R.string.app_drawer_label)))
|
||||
PreferenceLayout {
|
||||
PreferenceGroup(heading = stringResource(id = R.string.general_label), isFirstChild = true) {
|
||||
NavigationActionPreference(
|
||||
label = stringResource(id = R.string.hidden_apps_label),
|
||||
subtitle = hiddenAppsCount(),
|
||||
subtitle = resources.getQuantityString(R.plurals.apps_count, hiddenAppsCount(), hiddenAppsCount()),
|
||||
destination = subRoute(name = AppDrawerRoutes.HIDDEN_APPS),
|
||||
)
|
||||
SliderPreference(
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.navigation.NavGraphBuilder
|
||||
import app.lawnchair.DefaultAppFilter
|
||||
import app.lawnchair.ui.preferences.components.*
|
||||
@@ -27,7 +28,15 @@ fun NavGraphBuilder.hiddenAppsGraph(route: String) {
|
||||
@ExperimentalAnimationApi
|
||||
@Composable
|
||||
fun HiddenAppsPreferences() {
|
||||
pageMeta.provide(Meta(title = hiddenAppsCount()))
|
||||
val pageTitle =
|
||||
with (hiddenAppsCount()) {
|
||||
if (this == 0) {
|
||||
stringResource(id = R.string.hidden_apps_label)
|
||||
} else {
|
||||
stringResource(id = R.string.hidden_apps_label_with_count, this)
|
||||
}
|
||||
}
|
||||
pageMeta.provide(Meta(title = pageTitle))
|
||||
var hiddenApps by preferenceManager().hiddenAppSet.getAdapter()
|
||||
val optionalApps by appsList(
|
||||
filter = remember { DefaultAppFilter() },
|
||||
@@ -54,13 +63,7 @@ fun HiddenAppsPreferences() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun hiddenAppsCount(): String {
|
||||
val resources = LocalContext.current.resources
|
||||
val count = preferenceManager().hiddenAppSet.getState().value.size
|
||||
return remember(count) {
|
||||
resources.getQuantityString(R.plurals.hidden_apps_count, count, count)
|
||||
}
|
||||
}
|
||||
fun hiddenAppsCount(): Int = preferenceManager().hiddenAppSet.getState().value.size
|
||||
|
||||
@Composable
|
||||
fun hiddenAppsComparator(hiddenApps: Set<String>): Comparator<App> {
|
||||
|
||||
Reference in New Issue
Block a user