|
|
|
@ -10,6 +10,7 @@ class WebtoonImageView @JvmOverloads constructor(context: Context, attr: Attribu
|
|
|
|
SubsamplingScaleImageView(context, attr) {
|
|
|
|
SubsamplingScaleImageView(context, attr) {
|
|
|
|
|
|
|
|
|
|
|
|
private val ct = PointF()
|
|
|
|
private val ct = PointF()
|
|
|
|
|
|
|
|
private val displayHeight = resources.displayMetrics.heightPixels
|
|
|
|
|
|
|
|
|
|
|
|
private var scrollPos = 0
|
|
|
|
private var scrollPos = 0
|
|
|
|
private var scrollRange = SCROLL_UNKNOWN
|
|
|
|
private var scrollRange = SCROLL_UNKNOWN
|
|
|
|
@ -46,6 +47,14 @@ class WebtoonImageView @JvmOverloads constructor(context: Context, attr: Attribu
|
|
|
|
super.recycle()
|
|
|
|
super.recycle()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun getSuggestedMinimumHeight(): Int {
|
|
|
|
|
|
|
|
var desiredHeight = super.getSuggestedMinimumHeight()
|
|
|
|
|
|
|
|
if (sHeight == 0 && desiredHeight < displayHeight) {
|
|
|
|
|
|
|
|
desiredHeight = displayHeight
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return desiredHeight
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun scrollToInternal(pos: Int) {
|
|
|
|
private fun scrollToInternal(pos: Int) {
|
|
|
|
scrollPos = pos
|
|
|
|
scrollPos = pos
|
|
|
|
ct.set(sWidth / 2f, (height / 2f + pos.toFloat()) / minScale)
|
|
|
|
ct.set(sWidth / 2f, (height / 2f + pos.toFloat()) / minScale)
|
|
|
|
|