improve if readability

improve bottom edge readability
This commit is contained in:
CarlosEsco 2020-04-22 13:20:22 -04:00
parent 1d92c4474f
commit a029fc950e

View File

@ -52,9 +52,14 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) :
0 else -1 0 else -1
) )
window?.navigationBarColor = Color.TRANSPARENT window?.navigationBarColor = Color.TRANSPARENT
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && preferences.readerTheme() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
.getOrDefault() == 0 && activity.window.decorView.rootWindowInsets.systemWindowInsetRight == 0 && activity.window.decorView.rootWindowInsets.systemWindowInsetLeft == 0 preferences.readerTheme().getOrDefault() == 0 &&
) window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR activity.window.decorView.rootWindowInsets.systemWindowInsetRight == 0 &&
activity.window.decorView.rootWindowInsets.systemWindowInsetLeft == 0
) {
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
}
val height = activity.window.decorView.rootWindowInsets.systemWindowInsetBottom val height = activity.window.decorView.rootWindowInsets.systemWindowInsetBottom
sheetBehavior.peekHeight = 550.dpToPx + height sheetBehavior.peekHeight = 550.dpToPx + height
@ -87,9 +92,14 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) :
is WebtoonViewer -> initWebtoonPreferences() is WebtoonViewer -> initWebtoonPreferences()
} }
setBottomEdge(
if (activity.viewer is PagerViewer) page_transitions else webtoon_side_padding, activity
) val bottomEdgeView = when(activity.viewer is PagerViewer){
true -> page_transitions
false -> webtoon_side_padding
}
setBottomEdge(bottomEdgeView, activity)
close_button.setOnClickListener { close_button.setOnClickListener {
dismiss() dismiss()