mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 19:55:11 +01:00
Only play animation for crop if crop has changed
Not when switching reading mode
This commit is contained in:
parent
73281871f9
commit
5a4632a99c
@ -189,6 +189,8 @@ class ReaderActivity :
|
|||||||
var indexPageToShift: Int? = null
|
var indexPageToShift: Int? = null
|
||||||
var indexChapterToShift: Long? = null
|
var indexChapterToShift: Long? = null
|
||||||
|
|
||||||
|
var lastCropRes = 0
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
const val LEFT_TO_RIGHT = 1
|
const val LEFT_TO_RIGHT = 1
|
||||||
@ -410,15 +412,17 @@ class ReaderActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
with(binding.chaptersSheet.cropBordersSheetButton) {
|
with(binding.chaptersSheet.cropBordersSheetButton) {
|
||||||
setImageResource(
|
val drawableRes = if (enabled) {
|
||||||
if (enabled) {
|
|
||||||
R.drawable.free_to_crop
|
R.drawable.free_to_crop
|
||||||
} else {
|
} else {
|
||||||
R.drawable.crop_to_free
|
R.drawable.crop_to_free
|
||||||
}
|
}
|
||||||
)
|
if (lastCropRes != drawableRes) {
|
||||||
|
setImageResource(drawableRes)
|
||||||
val animDrawable = drawable as AnimatedVectorDrawable
|
val animDrawable = drawable as AnimatedVectorDrawable
|
||||||
animDrawable.start()
|
animDrawable.start()
|
||||||
|
lastCropRes = drawableRes
|
||||||
|
}
|
||||||
compatToolTipText =
|
compatToolTipText =
|
||||||
getString(
|
getString(
|
||||||
if (enabled) R.string.remove_crop
|
if (enabled) R.string.remove_crop
|
||||||
|
Loading…
Reference in New Issue
Block a user