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 67e751ccf8..df748e177f 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 @@ -202,6 +202,8 @@ object PreferenceKeys { const val hideBottomNavOnScroll = "hide_bottom_nav_on_scroll" + const val showSideNavOnBottom = "show_side_nav_on_bottom" + const val showMangaAppShortcuts = "show_manga_app_shortcuts" const val createLegacyBackup = "create_legacy_backup" 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 8cf02c4a96..afdfa90e16 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 @@ -394,6 +394,8 @@ class PreferencesHelper(val context: Context) { fun hideBottomNavOnScroll() = flowPrefs.getBoolean(Keys.hideBottomNavOnScroll, true) + fun showSideNavOnBottom() = flowPrefs.getBoolean(Keys.showSideNavOnBottom, false) + fun showNsfwSource() = flowPrefs.getBoolean(Keys.showNsfwSource, true) fun showNsfwExtension() = flowPrefs.getBoolean(Keys.showNsfwExtension, true) fun labelNsfwExtension() = prefs.getBoolean(Keys.labelNsfwExtension, true) 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 a4985592de..bb9d20feb0 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 @@ -12,6 +12,7 @@ import android.os.Bundle import android.os.Handler import android.provider.Settings import android.view.GestureDetector +import android.view.Gravity import android.view.Menu import android.view.MenuItem import android.view.MotionEvent @@ -365,6 +366,10 @@ open class MainActivity : BaseActivity(), DownloadServiceLi binding.toolbar.setIncognitoMode(it) binding.cardToolbar.setIncognitoMode(it) } + preferences.showSideNavOnBottom() + .asImmediateFlowIn(lifecycleScope) { + binding.sideNav?.menuGravity = if (!it) Gravity.TOP else Gravity.BOTTOM + } setExtensionsBadge() setFloatingToolbar(canShowFloatingToolbar(router.backstack.lastOrNull()?.controller), changeBG = false) } 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 abfd9e9c34..fa93d23885 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 @@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.appDelegateNightMode import eu.kanade.tachiyomi.util.system.getPrefTheme import eu.kanade.tachiyomi.util.system.isInNightMode +import eu.kanade.tachiyomi.util.system.isTablet import kotlinx.coroutines.flow.launchIn import java.util.Locale import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys @@ -76,6 +77,13 @@ class SettingsGeneralController : SettingsController() { defaultValue = true } + switchPreference { + key = Keys.showSideNavOnBottom + titleRes = R.string.move_side_nav_to_bottom + defaultValue = false + isVisible = activity?.isTablet() == true + } + switchPreference { key = Keys.showMangaAppShortcuts titleRes = R.string.app_shortcuts diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 36c4f5bcf3..2a7d721427 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -610,6 +610,7 @@ Updated to v%1$s Secure screen Auto-hide bottom navigation + Move side navigation buttons to bottom App shortcuts Show recent sources and series in app shortcuts Follow system theme