mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-28 09:15:12 +03:00
Fix wonky webtoon layout when image is loaded at the top of the screen (#5660)
This commit is contained in:
parent
5aea21a194
commit
40aa3b7e18
1 changed files with 12 additions and 1 deletions
|
@ -266,7 +266,6 @@ class WebtoonPageHolder(
|
|||
*/
|
||||
private fun setImage() {
|
||||
progressIndicator.setCompleteProgressAndHide()
|
||||
progressContainer.isVisible = false
|
||||
retryContainer?.isVisible = false
|
||||
removeDecodeErrorLayout()
|
||||
|
||||
|
@ -324,6 +323,13 @@ class WebtoonPageHolder(
|
|||
initRetryLayout().isVisible = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the image is decoded and going to be displayed.
|
||||
*/
|
||||
private fun onImageDecoded() {
|
||||
progressContainer.isVisible = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the image fails to decode.
|
||||
*/
|
||||
|
@ -374,6 +380,10 @@ class WebtoonPageHolder(
|
|||
setCropBorders(cropBorders)
|
||||
setOnImageEventListener(
|
||||
object : SubsamplingScaleImageView.DefaultOnImageEventListener() {
|
||||
override fun onReady() {
|
||||
onImageDecoded()
|
||||
}
|
||||
|
||||
override fun onImageLoadError(e: Exception) {
|
||||
onImageDecodeError()
|
||||
}
|
||||
|
@ -505,6 +515,7 @@ class WebtoonPageHolder(
|
|||
result.start()
|
||||
}
|
||||
setImageDrawable(result)
|
||||
onImageDecoded()
|
||||
},
|
||||
onError = {
|
||||
onImageDecodeError()
|
||||
|
|
Loading…
Reference in a new issue