mirror of
https://github.com/mihonapp/mihon.git
synced 2024-10-31 21:20:59 -04:00
da16110e1c
* Prepare for edge-to-edge MangaController * Fix derpy liftToScroll with our own implementation * Edge-to-edge MangaController Except when legacy blue theme is used. * Save app bar lift state for controller backstack * Fix expanded cover position after the view recycled * Handle overlap changes when incognito mode disabled * Tablet fixes * Revert "Handle overlap changes when incognito mode disabled" This reverts commit 1f492449 Breaks on rotation changes. * Fix MangaController's swipe refresh position * All controllers are now doing lift app bar on scroll by default They are already doing that before so this pretty much just a cleanups. * TachiyomiCoordinatorLayout: Support ViewPager for app bar lift state check I'm willing to revert this if this minute detail solution is deemed too hacky xD * Fix app bar not lifted when scrolled without fling * Save app bar lift state across configuration changes * Fix MangaController's swipe refresh position after configuration change * TachiyomiCoordinatorLayout: Update ViewPager reference when controller is changed
38 lines
1.3 KiB
Kotlin
38 lines
1.3 KiB
Kotlin
package eu.kanade.tachiyomi.widget
|
|
|
|
import android.content.Context
|
|
import android.util.AttributeSet
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
import com.bluelinelabs.conductor.ChangeHandlerFrameLayout
|
|
|
|
/**
|
|
* [ChangeHandlerFrameLayout] with the ability to draw behind the header sibling in [CoordinatorLayout].
|
|
* The layout behavior of this view is set to [TachiyomiScrollingViewBehavior] and should not be changed.
|
|
*/
|
|
class TachiyomiChangeHandlerFrameLayout(
|
|
context: Context,
|
|
attrs: AttributeSet
|
|
) : ChangeHandlerFrameLayout(context, attrs), CoordinatorLayout.AttachedBehavior {
|
|
|
|
/**
|
|
* If true, this view will draw behind the header sibling.
|
|
*
|
|
* @see TachiyomiScrollingViewBehavior.shouldHeaderOverlap
|
|
*/
|
|
var overlapHeader = false
|
|
set(value) {
|
|
if (field != value) {
|
|
field = value
|
|
(layoutParams as? CoordinatorLayout.LayoutParams)?.behavior = behavior.apply {
|
|
shouldHeaderOverlap = value
|
|
}
|
|
if (!value) {
|
|
// The behavior doesn't reset translationY when shouldHeaderOverlap is false
|
|
translationY = 0F
|
|
}
|
|
forceLayout()
|
|
}
|
|
}
|
|
|
|
override fun getBehavior() = TachiyomiScrollingViewBehavior()
|
|
}
|