mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-25 02:21:49 +01:00
Fixed blank page bug... again
This commit is contained in:
parent
8cd4f158d8
commit
c0eb0b62c7
@ -50,6 +50,8 @@ import eu.kanade.tachiyomi.util.lang.plusAssign
|
|||||||
import eu.kanade.tachiyomi.util.storage.getUriCompat
|
import eu.kanade.tachiyomi.util.storage.getUriCompat
|
||||||
import eu.kanade.tachiyomi.util.system.GLUtil
|
import eu.kanade.tachiyomi.util.system.GLUtil
|
||||||
import eu.kanade.tachiyomi.util.system.ThemeUtil
|
import eu.kanade.tachiyomi.util.system.ThemeUtil
|
||||||
|
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||||
|
import eu.kanade.tachiyomi.util.system.getBottomGestureInsets
|
||||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
import eu.kanade.tachiyomi.util.system.hasSideNavBar
|
import eu.kanade.tachiyomi.util.system.hasSideNavBar
|
||||||
import eu.kanade.tachiyomi.util.system.isBottomTappable
|
import eu.kanade.tachiyomi.util.system.isBottomTappable
|
||||||
@ -59,6 +61,7 @@ import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
|
|||||||
import eu.kanade.tachiyomi.util.view.gone
|
import eu.kanade.tachiyomi.util.view.gone
|
||||||
import eu.kanade.tachiyomi.util.view.snack
|
import eu.kanade.tachiyomi.util.view.snack
|
||||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
||||||
|
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
||||||
import eu.kanade.tachiyomi.util.view.visible
|
import eu.kanade.tachiyomi.util.view.visible
|
||||||
import eu.kanade.tachiyomi.widget.SimpleAnimationListener
|
import eu.kanade.tachiyomi.widget.SimpleAnimationListener
|
||||||
import eu.kanade.tachiyomi.widget.SimpleSeekBarListener
|
import eu.kanade.tachiyomi.widget.SimpleSeekBarListener
|
||||||
@ -335,6 +338,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
|||||||
chapters_bottom_sheet.sheetBehavior?.isHideable = !menuVisible
|
chapters_bottom_sheet.sheetBehavior?.isHideable = !menuVisible
|
||||||
if (!menuVisible) chapters_bottom_sheet.sheetBehavior?.state =
|
if (!menuVisible) chapters_bottom_sheet.sheetBehavior?.state =
|
||||||
BottomSheetBehavior.STATE_HIDDEN
|
BottomSheetBehavior.STATE_HIDDEN
|
||||||
|
val peek = chapters_bottom_sheet.sheetBehavior?.peekHeight ?: 30.dpToPx
|
||||||
reader_layout.doOnApplyWindowInsets { v, insets, _ ->
|
reader_layout.doOnApplyWindowInsets { v, insets, _ ->
|
||||||
sheetManageNavColor = when {
|
sheetManageNavColor = when {
|
||||||
insets.isBottomTappable() -> {
|
insets.isBottomTappable() -> {
|
||||||
@ -361,7 +365,11 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
|||||||
chapters_bottom_sheet.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
chapters_bottom_sheet.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
leftMargin = insets.systemWindowInsetLeft
|
leftMargin = insets.systemWindowInsetLeft
|
||||||
rightMargin = insets.systemWindowInsetRight
|
rightMargin = insets.systemWindowInsetRight
|
||||||
|
height = 280.dpToPx + insets.systemWindowInsetBottom
|
||||||
}
|
}
|
||||||
|
chapters_bottom_sheet.sheetBehavior?.peekHeight = peek + insets.getBottomGestureInsets()
|
||||||
|
chapter_recycler.updatePaddingRelative(bottom = insets.systemWindowInsetBottom)
|
||||||
|
viewer_container.requestLayout()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,6 +380,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
|||||||
private fun setMenuVisibility(visible: Boolean, animate: Boolean = true) {
|
private fun setMenuVisibility(visible: Boolean, animate: Boolean = true) {
|
||||||
menuVisible = visible
|
menuVisible = visible
|
||||||
if (visible) coroutine?.cancel()
|
if (visible) coroutine?.cancel()
|
||||||
|
viewer_container.requestLayout()
|
||||||
if (visible) {
|
if (visible) {
|
||||||
snackbar?.dismiss()
|
snackbar?.dismiss()
|
||||||
systemUi?.show()
|
systemUi?.show()
|
||||||
|
@ -15,12 +15,8 @@ import com.mikepenz.fastadapter.adapters.ItemAdapter
|
|||||||
import com.mikepenz.fastadapter.listeners.ClickEventHook
|
import com.mikepenz.fastadapter.listeners.ClickEventHook
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||||
import eu.kanade.tachiyomi.util.system.getBottomGestureInsets
|
|
||||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
import eu.kanade.tachiyomi.util.system.launchUI
|
import eu.kanade.tachiyomi.util.system.launchUI
|
||||||
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
|
|
||||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
|
||||||
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
|
||||||
import kotlinx.android.synthetic.main.reader_chapters_sheet.view.*
|
import kotlinx.android.synthetic.main.reader_chapters_sheet.view.*
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
@ -50,7 +46,6 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val peek = sheetBehavior?.peekHeight ?: 30.dpToPx
|
|
||||||
post {
|
post {
|
||||||
chapter_recycler.alpha = when (sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
|
chapter_recycler.alpha = when (sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
|
||||||
true -> 1f
|
true -> 1f
|
||||||
@ -58,14 +53,6 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chapters_bottom_sheet.doOnApplyWindowInsets { _, insets, _ ->
|
|
||||||
sheetBehavior?.peekHeight = peek + insets.getBottomGestureInsets()
|
|
||||||
|
|
||||||
chapters_bottom_sheet.updateLayoutParams<MarginLayoutParams> {
|
|
||||||
height = 280.dpToPx + insets.systemWindowInsetBottom
|
|
||||||
}
|
|
||||||
chapter_recycler.updatePaddingRelative(bottom = insets.systemWindowInsetBottom)
|
|
||||||
}
|
|
||||||
sheetBehavior?.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
|
sheetBehavior?.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
|
||||||
override fun onSlide(bottomSheet: View, progress: Float) {
|
override fun onSlide(bottomSheet: View, progress: Float) {
|
||||||
pill.alpha = (1 - max(0f, progress)) * 0.25f
|
pill.alpha = (1 - max(0f, progress)) * 0.25f
|
||||||
|
@ -6,34 +6,28 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/reader_container"
|
android:id="@+id/viewer_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<FrameLayout
|
<ProgressBar
|
||||||
android:id="@+id/viewer_container"
|
android:id="@+id/please_wait"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="56dp"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="56dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ProgressBar
|
<eu.kanade.tachiyomi.ui.reader.PageIndicatorTextView
|
||||||
android:id="@+id/please_wait"
|
android:id="@+id/page_number"
|
||||||
android:layout_width="56dp"
|
style="@style/TextAppearance.Regular.Caption"
|
||||||
android:layout_height="56dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:layout_gravity="bottom|center_horizontal"
|
||||||
tools:visibility="visible" />
|
android:padding="4dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
<eu.kanade.tachiyomi.ui.reader.PageIndicatorTextView
|
|
||||||
android:id="@+id/page_number"
|
|
||||||
style="@style/TextAppearance.Regular.Caption"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|center_horizontal"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.ui.reader.ReaderColorFilterView
|
<eu.kanade.tachiyomi.ui.reader.ReaderColorFilterView
|
||||||
android:id="@+id/color_overlay"
|
android:id="@+id/color_overlay"
|
||||||
|
Loading…
Reference in New Issue
Block a user