Fix pages max scale

This commit is contained in:
Koitharu
2020-03-22 17:35:42 +02:00
parent 418d0247f5
commit 798ae6aeb7
8 changed files with 17 additions and 9 deletions

View File

@@ -62,7 +62,7 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3'
implementation 'androidx.core:core-ktx:1.3.0-alpha02'
implementation 'androidx.fragment:fragment-ktx:1.2.2'
implementation 'androidx.fragment:fragment-ktx:1.2.3'
implementation 'androidx.appcompat:appcompat:1.2.0-alpha03'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-beta01'
@@ -70,9 +70,9 @@ dependencies {
implementation 'androidx.preference:preference:1.1.0'
implementation 'com.google.android.material:material:1.2.0-alpha05'
implementation 'androidx.room:room-runtime:2.2.4'
implementation 'androidx.room:room-ktx:2.2.4'
kapt 'androidx.room:room-compiler:2.2.4'
implementation 'androidx.room:room-runtime:2.2.5'
implementation 'androidx.room:room-ktx:2.2.5'
kapt 'androidx.room:room-compiler:2.2.5'
implementation 'com.github.moxy-community:moxy:2.1.1'
implementation 'com.github.moxy-community:moxy-androidx:2.1.1'
@@ -80,9 +80,9 @@ dependencies {
implementation 'com.github.moxy-community:moxy-ktx:2.1.1'
kapt 'com.github.moxy-community:moxy-compiler:2.1.1'
implementation 'com.squareup.okhttp3:okhttp:4.4.0'
implementation 'com.squareup.okio:okio:2.4.3'
implementation 'org.jsoup:jsoup:1.12.2'
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
implementation 'com.squareup.okio:okio:2.5.0'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'org.koin:koin-android:2.1.3'
implementation 'io.coil-kt:coil:0.9.5'

View File

@@ -49,7 +49,10 @@ class PageHolder(parent: ViewGroup, private val loader: PageLoader) :
}
}
override fun onReady() = Unit
override fun onReady() {
ssiv.maxScale = 2f * maxOf(ssiv.width / ssiv.sWidth.toFloat(), ssiv.height / ssiv.sHeight.toFloat())
ssiv.resetScaleAndCenter()
}
override fun onImageLoadError(e: Exception) = onError(e)

View File

@@ -52,6 +52,7 @@ class WebtoonHolder(parent: ViewGroup, private val loader: PageLoader) :
}
override fun onReady() {
ssiv.maxScale = 2f * ssiv.width / ssiv.sWidth.toFloat()
ssiv.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CUSTOM)
ssiv.minScale = ssiv.width / ssiv.sWidth.toFloat()
ssiv.setScaleAndCenter(

View File

@@ -16,6 +16,7 @@
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:scaleType="centerInside"
app:layout_constraintDimensionRatio="13:18"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@@ -16,6 +16,7 @@
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="13:18"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@@ -10,6 +10,7 @@
android:id="@+id/imageView_cover"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:orientation="vertical" />
<LinearLayout

View File

@@ -20,6 +20,7 @@
android:id="@+id/imageView_cover"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:orientation="vertical" />
<LinearLayout