Fix wonky webtoon layout when image is loaded at the top of the screen (#5660)
This commit is contained in:
parent
5aea21a194
commit
40aa3b7e18
@ -266,7 +266,6 @@ class WebtoonPageHolder(
|
|||||||
*/
|
*/
|
||||||
private fun setImage() {
|
private fun setImage() {
|
||||||
progressIndicator.setCompleteProgressAndHide()
|
progressIndicator.setCompleteProgressAndHide()
|
||||||
progressContainer.isVisible = false
|
|
||||||
retryContainer?.isVisible = false
|
retryContainer?.isVisible = false
|
||||||
removeDecodeErrorLayout()
|
removeDecodeErrorLayout()
|
||||||
|
|
||||||
@ -324,6 +323,13 @@ class WebtoonPageHolder(
|
|||||||
initRetryLayout().isVisible = true
|
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.
|
* Called when the image fails to decode.
|
||||||
*/
|
*/
|
||||||
@ -374,6 +380,10 @@ class WebtoonPageHolder(
|
|||||||
setCropBorders(cropBorders)
|
setCropBorders(cropBorders)
|
||||||
setOnImageEventListener(
|
setOnImageEventListener(
|
||||||
object : SubsamplingScaleImageView.DefaultOnImageEventListener() {
|
object : SubsamplingScaleImageView.DefaultOnImageEventListener() {
|
||||||
|
override fun onReady() {
|
||||||
|
onImageDecoded()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onImageLoadError(e: Exception) {
|
override fun onImageLoadError(e: Exception) {
|
||||||
onImageDecodeError()
|
onImageDecodeError()
|
||||||
}
|
}
|
||||||
@ -505,6 +515,7 @@ class WebtoonPageHolder(
|
|||||||
result.start()
|
result.start()
|
||||||
}
|
}
|
||||||
setImageDrawable(result)
|
setImageDrawable(result)
|
||||||
|
onImageDecoded()
|
||||||
},
|
},
|
||||||
onError = {
|
onError = {
|
||||||
onImageDecodeError()
|
onImageDecodeError()
|
||||||
|
Loading…
Reference in New Issue
Block a user