mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-05 08:38:56 +01:00
Remove side nav icon alignment preference
Simplifying it to just always be centered, which is what most Google apps seem to be doing anyway.
This commit is contained in:
@@ -19,7 +19,6 @@ import eu.kanade.domain.ui.model.setAppCompatDelegateThemeMode
|
||||
import eu.kanade.presentation.more.settings.Preference
|
||||
import eu.kanade.presentation.util.collectAsState
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.system.isAutoTabletUiAvailable
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.flow.drop
|
||||
@@ -105,22 +104,11 @@ class SettingsAppearanceScreen : SearchableSettings {
|
||||
context: Context,
|
||||
uiPreferences: UiPreferences,
|
||||
): Preference.PreferenceGroup {
|
||||
val tabletUiModePref = uiPreferences.tabletUiMode()
|
||||
val tabletUiMode by tabletUiModePref.collectAsState()
|
||||
|
||||
val isTabletUiAvailable = remember(tabletUiMode) { // won't survive config change
|
||||
when (tabletUiMode) {
|
||||
TabletUiMode.AUTOMATIC -> context.resources.configuration.isAutoTabletUiAvailable()
|
||||
TabletUiMode.NEVER -> false
|
||||
else -> true
|
||||
}
|
||||
}
|
||||
|
||||
return Preference.PreferenceGroup(
|
||||
title = stringResource(R.string.pref_category_display),
|
||||
preferenceItems = listOf(
|
||||
Preference.PreferenceItem.ListPreference(
|
||||
pref = tabletUiModePref,
|
||||
pref = uiPreferences.tabletUiMode(),
|
||||
title = stringResource(R.string.pref_tablet_ui_mode),
|
||||
entries = TabletUiMode.values().associateWith { stringResource(it.titleResId) },
|
||||
onValueChanged = {
|
||||
@@ -128,17 +116,6 @@ class SettingsAppearanceScreen : SearchableSettings {
|
||||
true
|
||||
},
|
||||
),
|
||||
Preference.PreferenceItem.ListPreference(
|
||||
pref = uiPreferences.sideNavIconAlignment(),
|
||||
title = stringResource(R.string.pref_side_nav_icon_alignment),
|
||||
subtitle = "%s",
|
||||
enabled = isTabletUiAvailable,
|
||||
entries = mapOf(
|
||||
0 to stringResource(R.string.alignment_top),
|
||||
1 to stringResource(R.string.alignment_center),
|
||||
2 to stringResource(R.string.alignment_bottom),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user