Support no-fullheight pages in webtoon mode
This commit is contained in:
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -23,6 +23,7 @@
|
||||
<entry key="app/src/main/res/layout/item_manga_grid.xml" value="0.26042632066728455" />
|
||||
<entry key="app/src/main/res/layout/item_manga_list_details.xml" value="0.2601851851851852" />
|
||||
<entry key="app/src/main/res/layout/item_page_thumb.xml" value="0.2601851851851852" />
|
||||
<entry key="app/src/main/res/layout/item_page_webtoon.xml" value="0.13095238095238096" />
|
||||
<entry key="app/src/main/res/layout/item_recent.xml" value="0.2601851851851852" />
|
||||
<entry key="app/src/main/res/layout/sheet_pages.xml" value="0.2601851851851852" />
|
||||
<entry key="app/src/main/res/menu/popup_category.xml" value="0.2601851851851852" />
|
||||
|
||||
@@ -10,6 +10,7 @@ class WebtoonImageView @JvmOverloads constructor(context: Context, attr: Attribu
|
||||
SubsamplingScaleImageView(context, attr) {
|
||||
|
||||
private val ct = PointF()
|
||||
private val displayHeight = resources.displayMetrics.heightPixels
|
||||
|
||||
private var scrollPos = 0
|
||||
private var scrollRange = SCROLL_UNKNOWN
|
||||
@@ -46,6 +47,14 @@ class WebtoonImageView @JvmOverloads constructor(context: Context, attr: Attribu
|
||||
super.recycle()
|
||||
}
|
||||
|
||||
override fun getSuggestedMinimumHeight(): Int {
|
||||
var desiredHeight = super.getSuggestedMinimumHeight()
|
||||
if (sHeight == 0 && desiredHeight < displayHeight) {
|
||||
desiredHeight = displayHeight
|
||||
}
|
||||
return desiredHeight
|
||||
}
|
||||
|
||||
private fun scrollToInternal(pos: Int) {
|
||||
scrollPos = pos
|
||||
ct.set(sWidth / 2f, (height / 2f + pos.toFloat()) / minScale)
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.koitharu.kotatsu.reader.ui.pager.wetoon.WebtoonImageView
|
||||
android:id="@+id/ssiv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:zoomEnabled="false"
|
||||
app:quickScaleEnabled="false"
|
||||
app:panEnabled="false" />
|
||||
|
||||
Reference in New Issue
Block a user