@ -13,9 +13,9 @@ import eu.kanade.tachiyomi.databinding.ReaderReadingModeSettingsBinding
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerViewer
import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer
import eu.kanade.tachiyomi.util.preference.asHotFlow
import eu.kanade.tachiyomi.util.preference.bindToPreference
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import uy.kohesive.injekt.injectLazy
/ * *
@ -74,8 +74,8 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr
binding . pagerPrefsGroup . navigatePan . bindToPreference ( readerPreferences . navigateToPan ( ) )
binding . pagerPrefsGroup . pagerNav . bindToPreference ( readerPreferences . navigationModePager ( ) )
readerPreferences . navigationModePager ( )
. asHotFlow {
readerPreferences . navigationModePager ( ) . changes ( )
. onEach {
val isTappingEnabled = it != 5
binding . pagerPrefsGroup . tappingInverted . isVisible = isTappingEnabled
binding . pagerPrefsGroup . navigatePan . isVisible = isTappingEnabled
@ -83,8 +83,8 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr
. launchIn ( ( context as ReaderActivity ) . lifecycleScope )
// Makes so that landscape zoom gets hidden away when image scale type is not fit screen
binding . pagerPrefsGroup . scaleType . bindToPreference ( readerPreferences . imageScaleType ( ) , 1 )
readerPreferences . imageScaleType ( )
. asHotFlow { binding . pagerPrefsGroup . landscapeZoom . isVisible = it == 1 }
readerPreferences . imageScaleType ( ) . changes ( )
. onEach { binding . pagerPrefsGroup . landscapeZoom . isVisible = it == 1 }
. launchIn ( ( context as ReaderActivity ) . lifecycleScope )
binding . pagerPrefsGroup . landscapeZoom . bindToPreference ( readerPreferences . landscapeZoom ( ) )
@ -92,8 +92,8 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr
binding . pagerPrefsGroup . cropBorders . bindToPreference ( readerPreferences . cropBorders ( ) )
binding . pagerPrefsGroup . dualPageSplit . bindToPreference ( readerPreferences . dualPageSplitPaged ( ) )
readerPreferences . dualPageSplitPaged ( )
. asHotFlow {
readerPreferences . dualPageSplitPaged ( ) . changes ( )
. onEach {
binding . pagerPrefsGroup . dualPageInvert . isVisible = it
if ( it ) {
binding . pagerPrefsGroup . dualPageRotateToFit . isChecked = false
@ -103,8 +103,8 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr
binding . pagerPrefsGroup . dualPageInvert . bindToPreference ( readerPreferences . dualPageInvertPaged ( ) )
binding . pagerPrefsGroup . dualPageRotateToFit . bindToPreference ( readerPreferences . dualPageRotateToFit ( ) )
readerPreferences . dualPageRotateToFit ( )
. asHotFlow {
readerPreferences . dualPageRotateToFit ( ) . changes ( )
. onEach {
binding . pagerPrefsGroup . dualPageRotateToFitInvert . isVisible = it
if ( it ) {
binding . pagerPrefsGroup . dualPageSplit . isChecked = false
@ -124,16 +124,16 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr
binding . webtoonPrefsGroup . tappingInverted . bindToPreference ( readerPreferences . webtoonNavInverted ( ) , ReaderPreferences . TappingInvertMode :: class . java )
binding . webtoonPrefsGroup . webtoonNav . bindToPreference ( readerPreferences . navigationModeWebtoon ( ) )
readerPreferences . navigationModeWebtoon ( )
. asHotFlow { binding . webtoonPrefsGroup . tappingInverted . isVisible = it != 5 }
readerPreferences . navigationModeWebtoon ( ) . changes ( )
. onEach { binding . webtoonPrefsGroup . tappingInverted . isVisible = it != 5 }
. launchIn ( ( context as ReaderActivity ) . lifecycleScope )
binding . webtoonPrefsGroup . cropBordersWebtoon . bindToPreference ( readerPreferences . cropBordersWebtoon ( ) )
binding . webtoonPrefsGroup . webtoonSidePadding . bindToIntPreference ( readerPreferences . webtoonSidePadding ( ) , R . array . webtoon _side _padding _values )
binding . webtoonPrefsGroup . dualPageSplit . bindToPreference ( readerPreferences . dualPageSplitWebtoon ( ) )
// Makes it so that dual page invert gets hidden away when dual page split is turned off
readerPreferences . dualPageSplitWebtoon ( )
. asHotFlow { binding . webtoonPrefsGroup . dualPageInvert . isVisible = it }
readerPreferences . dualPageSplitWebtoon ( ) . changes ( )
. onEach { binding . webtoonPrefsGroup . dualPageInvert . isVisible = it }
. launchIn ( ( context as ReaderActivity ) . lifecycleScope )
binding . webtoonPrefsGroup . dualPageInvert . bindToPreference ( readerPreferences . dualPageInvertWebtoon ( ) )
binding . webtoonPrefsGroup . longStripSplit . bindToPreference ( readerPreferences . longStripSplitWebtoon ( ) )