From 1681437206937c652cd453ac82ead103d057e94f Mon Sep 17 00:00:00 2001 From: Andreas E Date: Wed, 24 Jun 2020 15:48:08 +0200 Subject: [PATCH] Hide from reader sheet if tapping disabled and remove hard coded string --- .../eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt | 6 ++++++ app/src/main/res/layout/reader_settings_sheet.xml | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt index 017cc0f5e1..87d50f85e9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt @@ -12,6 +12,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer +import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener @@ -23,6 +24,7 @@ import kotlinx.android.synthetic.main.reader_settings_sheet.cutout_short import kotlinx.android.synthetic.main.reader_settings_sheet.fullscreen import kotlinx.android.synthetic.main.reader_settings_sheet.keepscreen import kotlinx.android.synthetic.main.reader_settings_sheet.long_tap +import kotlinx.android.synthetic.main.reader_settings_sheet.navigation_prefs_group import kotlinx.android.synthetic.main.reader_settings_sheet.page_transitions import kotlinx.android.synthetic.main.reader_settings_sheet.pager_prefs_group import kotlinx.android.synthetic.main.reader_settings_sheet.rotation_mode @@ -125,6 +127,10 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia * Init the preferences for navigation. */ private fun initNavigationPreferences() { + if (!preferences.readWithTapping().get()) { + navigation_prefs_group.gone() + } + tapping_inverted.bindToPreference(preferences.readWithTappingInverted()) } diff --git a/app/src/main/res/layout/reader_settings_sheet.xml b/app/src/main/res/layout/reader_settings_sheet.xml index 0a64fadb80..66a7938525 100644 --- a/app/src/main/res/layout/reader_settings_sheet.xml +++ b/app/src/main/res/layout/reader_settings_sheet.xml @@ -257,7 +257,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="24dp" - android:text="Navigation" + android:text="@string/pref_reader_navigation" android:textColor="?attr/colorAccent" android:textStyle="bold" app:layout_constraintStart_toStartOf="parent" @@ -354,4 +354,11 @@ android:orientation="vertical" app:layout_constraintGuide_percent="0.5" /> + +