diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt index f8b419bb6..dc6617740 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt @@ -15,7 +15,7 @@ object PreferenceKeys { const val hideBottomBarOnScroll = "pref_hide_bottom_bar_on_scroll" - const val showSideNavOnBottom = "pref_show_side_nav_on_bottom" + const val sideNavIconAlignment = "pref_side_nav_icon_alignment" const val enableTransitions = "pref_enable_transitions_key" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt index 7591b9446..a195fadfe 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt @@ -66,7 +66,7 @@ class PreferencesHelper(val context: Context) { fun hideBottomBarOnScroll() = flowPrefs.getBoolean(Keys.hideBottomBarOnScroll, true) - fun showSideNavOnBottom() = flowPrefs.getBoolean(Keys.showSideNavOnBottom, false) + fun sideNavIconAlignment() = flowPrefs.getInt(Keys.sideNavIconAlignment, 0) fun useAuthenticator() = flowPrefs.getBoolean(Keys.useAuthenticator, false) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 1b61d859a..c0180966c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -142,9 +142,13 @@ class MainActivity : BaseViewBindingActivity() { } if (binding.sideNav != null) { - preferences.showSideNavOnBottom() + preferences.sideNavIconAlignment() .asImmediateFlow { - binding.sideNav?.menuGravity = if (!it) Gravity.TOP else Gravity.BOTTOM + binding.sideNav?.menuGravity = when (it) { + 1 -> Gravity.CENTER + 2 -> Gravity.BOTTOM + else -> Gravity.TOP + } } .launchIn(lifecycleScope) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt index 1a86c17c7..1f8e902fe 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt @@ -26,7 +26,6 @@ import eu.kanade.tachiyomi.util.system.copyToClipboard import eu.kanade.tachiyomi.util.system.toast import timber.log.Timber import java.text.DateFormat -import java.text.ParseException import java.text.SimpleDateFormat import java.util.Locale import java.util.TimeZone diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt index 61a15ac2b..b3bcd4e41 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt @@ -47,10 +47,17 @@ class SettingsGeneralController : SettingsController() { defaultValue = false } if (context.isTablet()) { - switchPreference { - key = Keys.showSideNavOnBottom - titleRes = R.string.pref_move_side_nav_to_bottom - defaultValue = false + intListPreference { + key = Keys.sideNavIconAlignment + titleRes = R.string.pref_side_nav_icon_alignment + entriesRes = arrayOf( + R.string.alignment_top, + R.string.alignment_center, + R.string.alignment_bottom, + ) + entryValues = arrayOf("0", "1", "2") + defaultValue = "0" + summary = "%s" } } else { switchPreference { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 905d9ed87..90f6b5bc6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -161,7 +161,10 @@ Date format Confirm exit Hide bottom bar on scroll - Move side navigation buttons to bottom + Side navigation icon alignment + Top + Center + Bottom Manage notifications Security