Fix images memory caching
parent
5ef1b4ac9c
commit
1a60df6d98
@ -0,0 +1,21 @@
|
|||||||
|
package org.koitharu.kotatsu.core.ui.util
|
||||||
|
|
||||||
|
import android.view.View
|
||||||
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
|
|
||||||
|
class BottomSheetNoHalfExpandedCallback() : BottomSheetBehavior.BottomSheetCallback() {
|
||||||
|
|
||||||
|
private var previousStableState = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
|
|
||||||
|
override fun onStateChanged(sheet: View, state: Int) {
|
||||||
|
if (state == BottomSheetBehavior.STATE_HALF_EXPANDED) {
|
||||||
|
val behavior = (sheet.layoutParams as? CoordinatorLayout.LayoutParams)?.behavior as? BottomSheetBehavior<*>
|
||||||
|
behavior?.state = previousStableState
|
||||||
|
} else if (state == BottomSheetBehavior.STATE_EXPANDED || state == BottomSheetBehavior.STATE_COLLAPSED) {
|
||||||
|
previousStableState = state
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSlide(sheet: View, offset: Float) = Unit
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package org.koitharu.kotatsu.details.ui.pager.pages
|
||||||
|
|
||||||
|
import coil.key.Keyer
|
||||||
|
import coil.request.Options
|
||||||
|
import org.koitharu.kotatsu.parsers.model.MangaPage
|
||||||
|
|
||||||
|
class MangaPageKeyer : Keyer<MangaPage> {
|
||||||
|
|
||||||
|
override fun key(data: MangaPage, options: Options) = data.url
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue