Hide from reader sheet if tapping disabled and remove hard coded string

This commit is contained in:
Andreas E 2020-06-24 15:48:08 +02:00
parent 2eaf083eee
commit 1681437206
No known key found for this signature in database
GPG key ID: D7D48B26482380B8
2 changed files with 14 additions and 1 deletions

View file

@ -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())
}

View file

@ -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" />
<androidx.constraintlayout.widget.Group
android:id="@+id/navigation_prefs_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="navigation_prefs,tapping_inverted_text,end_navigation_preferences,tapping_inverted"
tools:layout_editor_absoluteX="24dp" />
</androidx.constraintlayout.widget.ConstraintLayout>