|
|
|
|
@ -25,12 +25,12 @@ class WebtoonHolder(
|
|
|
|
|
View.OnClickListener {
|
|
|
|
|
|
|
|
|
|
private var scrollToRestore = 0
|
|
|
|
|
private val goneOnInvisibleListener = GoneOnInvisibleListener(bindingInfo.progressBar)
|
|
|
|
|
|
|
|
|
|
init {
|
|
|
|
|
binding.ssiv.regionDecoderFactory = SkiaPooledImageRegionDecoder.Factory()
|
|
|
|
|
binding.ssiv.addOnImageEventListener(delegate)
|
|
|
|
|
bindingInfo.buttonRetry.setOnClickListener(this)
|
|
|
|
|
GoneOnInvisibleListener(bindingInfo.progressBar).attach()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onBind(data: ReaderPage) {
|
|
|
|
|
@ -42,6 +42,16 @@ class WebtoonHolder(
|
|
|
|
|
binding.ssiv.recycle()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onAttachedToWindow() {
|
|
|
|
|
super.onAttachedToWindow()
|
|
|
|
|
goneOnInvisibleListener.attach()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onDetachedFromWindow() {
|
|
|
|
|
super.onDetachedFromWindow()
|
|
|
|
|
goneOnInvisibleListener.detach()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onLoadingStarted() {
|
|
|
|
|
bindingInfo.layoutError.isVisible = false
|
|
|
|
|
bindingInfo.progressBar.showCompat()
|
|
|
|
|
|