Apply vertical seekbar hide logic to ReaderSettingsSheet

(cherry picked from commit 4e8006f329cc87438de9202cf0ac1d0d8ceb203f)
This commit is contained in:
CrepeTF 2021-03-21 15:27:54 +00:00 committed by Jobobby04
parent 565f005692
commit 1165c57ffa

View File

@ -4,6 +4,7 @@ import android.os.Bundle
import android.widget.CompoundButton
import android.widget.Spinner
import androidx.annotation.ArrayRes
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.core.widget.NestedScrollView
import androidx.lifecycle.lifecycleScope
@ -79,6 +80,17 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BaseBottomShee
binding.autoWebtoonMode.bindToPreference(preferences.useAutoWebtoon())
// SY <--
// Hides landscapeVerticalSeekbar & leftVerticalSeekbar option when forceHorizontalSeekbar is enabled
binding.forceHorzSeekbar.bindToPreference(preferences.forceHorizontalSeekbar())
preferences.forceHorizontalSeekbar()
.asImmediateFlow {
binding.landscapeVerticalSeekbar.isGone = it
binding.leftVerticalSeekbar.isGone = it
}
.launchIn(activity.lifecycleScope)
binding.landscapeVerticalSeekbar.bindToPreference(preferences.landscapeVerticalSeekbar())
binding.leftVerticalSeekbar.bindToPreference(preferences.leftVerticalSeekbar())
// If the preference is explicitly disabled, that means the setting was configured since there is a cutout
if (activity.hasCutout || !preferences.cutoutShort().get()) {
binding.cutoutShort.isVisible = true