mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 08:29:17 +01:00
Option to move nav rail buttons to bottom of screen
This commit is contained in:
parent
d82d738f38
commit
c84526274a
@ -202,6 +202,8 @@ object PreferenceKeys {
|
|||||||
|
|
||||||
const val hideBottomNavOnScroll = "hide_bottom_nav_on_scroll"
|
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 showMangaAppShortcuts = "show_manga_app_shortcuts"
|
||||||
|
|
||||||
const val createLegacyBackup = "create_legacy_backup"
|
const val createLegacyBackup = "create_legacy_backup"
|
||||||
|
@ -394,6 +394,8 @@ class PreferencesHelper(val context: Context) {
|
|||||||
|
|
||||||
fun hideBottomNavOnScroll() = flowPrefs.getBoolean(Keys.hideBottomNavOnScroll, true)
|
fun hideBottomNavOnScroll() = flowPrefs.getBoolean(Keys.hideBottomNavOnScroll, true)
|
||||||
|
|
||||||
|
fun showSideNavOnBottom() = flowPrefs.getBoolean(Keys.showSideNavOnBottom, false)
|
||||||
|
|
||||||
fun showNsfwSource() = flowPrefs.getBoolean(Keys.showNsfwSource, true)
|
fun showNsfwSource() = flowPrefs.getBoolean(Keys.showNsfwSource, true)
|
||||||
fun showNsfwExtension() = flowPrefs.getBoolean(Keys.showNsfwExtension, true)
|
fun showNsfwExtension() = flowPrefs.getBoolean(Keys.showNsfwExtension, true)
|
||||||
fun labelNsfwExtension() = prefs.getBoolean(Keys.labelNsfwExtension, true)
|
fun labelNsfwExtension() = prefs.getBoolean(Keys.labelNsfwExtension, true)
|
||||||
|
@ -12,6 +12,7 @@ import android.os.Bundle
|
|||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.view.GestureDetector
|
import android.view.GestureDetector
|
||||||
|
import android.view.Gravity
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
@ -365,6 +366,10 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
|||||||
binding.toolbar.setIncognitoMode(it)
|
binding.toolbar.setIncognitoMode(it)
|
||||||
binding.cardToolbar.setIncognitoMode(it)
|
binding.cardToolbar.setIncognitoMode(it)
|
||||||
}
|
}
|
||||||
|
preferences.showSideNavOnBottom()
|
||||||
|
.asImmediateFlowIn(lifecycleScope) {
|
||||||
|
binding.sideNav?.menuGravity = if (!it) Gravity.TOP else Gravity.BOTTOM
|
||||||
|
}
|
||||||
setExtensionsBadge()
|
setExtensionsBadge()
|
||||||
setFloatingToolbar(canShowFloatingToolbar(router.backstack.lastOrNull()?.controller), changeBG = false)
|
setFloatingToolbar(canShowFloatingToolbar(router.backstack.lastOrNull()?.controller), changeBG = false)
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.util.system.LocaleHelper
|
|||||||
import eu.kanade.tachiyomi.util.system.appDelegateNightMode
|
import eu.kanade.tachiyomi.util.system.appDelegateNightMode
|
||||||
import eu.kanade.tachiyomi.util.system.getPrefTheme
|
import eu.kanade.tachiyomi.util.system.getPrefTheme
|
||||||
import eu.kanade.tachiyomi.util.system.isInNightMode
|
import eu.kanade.tachiyomi.util.system.isInNightMode
|
||||||
|
import eu.kanade.tachiyomi.util.system.isTablet
|
||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||||
@ -76,6 +77,13 @@ class SettingsGeneralController : SettingsController() {
|
|||||||
defaultValue = true
|
defaultValue = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switchPreference {
|
||||||
|
key = Keys.showSideNavOnBottom
|
||||||
|
titleRes = R.string.move_side_nav_to_bottom
|
||||||
|
defaultValue = false
|
||||||
|
isVisible = activity?.isTablet() == true
|
||||||
|
}
|
||||||
|
|
||||||
switchPreference {
|
switchPreference {
|
||||||
key = Keys.showMangaAppShortcuts
|
key = Keys.showMangaAppShortcuts
|
||||||
titleRes = R.string.app_shortcuts
|
titleRes = R.string.app_shortcuts
|
||||||
|
@ -610,6 +610,7 @@
|
|||||||
<string name="updated_to_">Updated to v%1$s</string>
|
<string name="updated_to_">Updated to v%1$s</string>
|
||||||
<string name="secure_screen">Secure screen</string>
|
<string name="secure_screen">Secure screen</string>
|
||||||
<string name="hide_bottom_nav">Auto-hide bottom navigation</string>
|
<string name="hide_bottom_nav">Auto-hide bottom navigation</string>
|
||||||
|
<string name="move_side_nav_to_bottom">Move side navigation buttons to bottom</string>
|
||||||
<string name="app_shortcuts">App shortcuts</string>
|
<string name="app_shortcuts">App shortcuts</string>
|
||||||
<string name="show_recent_in_shortcuts">Show recent sources and series in app shortcuts</string>
|
<string name="show_recent_in_shortcuts">Show recent sources and series in app shortcuts</string>
|
||||||
<string name="follow_system_theme">Follow system theme</string>
|
<string name="follow_system_theme">Follow system theme</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user