diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 44fd05867..16fc9e3a3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -13,8 +13,8 @@ plugins { android { compileSdk = 34 - buildToolsVersion = "34.0" - ndkVersion = "26.1.10909125" + buildToolsVersion = "34.0.0" + ndkVersion = "26.3.11579264" splits { abi { diff --git a/app/src/main/java/com/hippo/easyrecyclerview/LinearDividerItemDecoration.kt b/app/src/main/java/com/hippo/easyrecyclerview/LinearDividerItemDecoration.kt index 67e4c0a8d..dfa8e6ff4 100644 --- a/app/src/main/java/com/hippo/easyrecyclerview/LinearDividerItemDecoration.kt +++ b/app/src/main/java/com/hippo/easyrecyclerview/LinearDividerItemDecoration.kt @@ -19,7 +19,6 @@ import android.graphics.Canvas import android.graphics.Paint import android.graphics.Rect import android.view.View -import androidx.core.view.ViewCompat import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView.ItemDecoration @@ -152,7 +151,7 @@ class LinearDividerItemDecoration(orientation: Int, color: Int, thickness: Int) val itemCount = adapter.itemCount val overlap = mOverlap if (mOrientation == VERTICAL) { - val isRtl = ViewCompat.getLayoutDirection(parent) == ViewCompat.LAYOUT_DIRECTION_RTL + val isRtl = parent.layoutDirection == View.LAYOUT_DIRECTION_RTL val mPaddingLeft: Int val mPaddingRight: Int if (isRtl) { diff --git a/app/src/main/java/com/hippo/ehviewer/client/EhEngine.kt b/app/src/main/java/com/hippo/ehviewer/client/EhEngine.kt index 414789d68..260bbd5fd 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/EhEngine.kt +++ b/app/src/main/java/com/hippo/ehviewer/client/EhEngine.kt @@ -61,7 +61,7 @@ import okhttp3.Request import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.executeAsync +import okhttp3.coroutines.executeAsync import org.json.JSONArray import org.json.JSONObject import org.jsoup.Jsoup diff --git a/app/src/main/java/com/hippo/ehviewer/client/EhRequestBuilder.kt b/app/src/main/java/com/hippo/ehviewer/client/EhRequestBuilder.kt index 504a6c528..236f39b93 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/EhRequestBuilder.kt +++ b/app/src/main/java/com/hippo/ehviewer/client/EhRequestBuilder.kt @@ -19,9 +19,9 @@ import com.hippo.ehviewer.EhApplication.Companion.noRedirectOkHttpClient import com.hippo.okhttp.ChromeRequestBuilder import okhttp3.Request import okhttp3.Response -import okhttp3.executeAsync +import okhttp3.coroutines.executeAsync -class EhRequestBuilder constructor( +class EhRequestBuilder( url: String, referer: String? = null, origin: String? = null, diff --git a/app/src/main/java/com/hippo/ehviewer/client/EhTagDatabase.kt b/app/src/main/java/com/hippo/ehviewer/client/EhTagDatabase.kt index dab64aba1..ed6fe388a 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/EhTagDatabase.kt +++ b/app/src/main/java/com/hippo/ehviewer/client/EhTagDatabase.kt @@ -30,7 +30,7 @@ import kotlinx.coroutines.flow.flow import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import okhttp3.Request -import okhttp3.executeAsync +import okhttp3.coroutines.executeAsync import okio.BufferedSource import okio.buffer import okio.source diff --git a/app/src/main/java/com/hippo/ehviewer/spider/SpiderDen.kt b/app/src/main/java/com/hippo/ehviewer/spider/SpiderDen.kt index c6f6dfade..0f8ef447a 100644 --- a/app/src/main/java/com/hippo/ehviewer/spider/SpiderDen.kt +++ b/app/src/main/java/com/hippo/ehviewer/spider/SpiderDen.kt @@ -37,7 +37,7 @@ import com.hippo.util.runSuspendCatching import com.hippo.util.sendTo import com.hippo.yorozuya.FileUtils import okhttp3.Response -import okhttp3.executeAsync +import okhttp3.coroutines.executeAsync import okio.buffer import okio.sink import java.io.File diff --git a/app/src/main/java/com/hippo/ehviewer/spider/SpiderQueen.kt b/app/src/main/java/com/hippo/ehviewer/spider/SpiderQueen.kt index 66bdcdfee..194daf4e9 100644 --- a/app/src/main/java/com/hippo/ehviewer/spider/SpiderQueen.kt +++ b/app/src/main/java/com/hippo/ehviewer/spider/SpiderQueen.kt @@ -56,7 +56,7 @@ import kotlinx.coroutines.sync.Semaphore import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.sync.withPermit import kotlinx.coroutines.withTimeout -import okhttp3.executeAsync +import okhttp3.coroutines.executeAsync import java.util.concurrent.atomic.AtomicInteger import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds diff --git a/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.kt b/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.kt index b8cff1dd6..e1da2c5c1 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.kt +++ b/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.kt @@ -118,7 +118,7 @@ class GalleryActivity : EhActivity(), OnSeekBarChangeListener, GalleryView.Liste private val requestStoragePermissionLauncher = registerForActivityResult( ActivityResultContracts.RequestPermission(), ) { result -> - if (result!! && mSavingPage != -1) { + if (result && mSavingPage != -1) { saveImage(mSavingPage) } else { Toast.makeText(this, R.string.error_cant_save_image, Toast.LENGTH_SHORT).show() @@ -288,7 +288,7 @@ class GalleryActivity : EhActivity(), OnSeekBarChangeListener, GalleryView.Liste buildProvider() } - override fun onNewIntent(intent: Intent?) { + override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) handleIntent(intent) buildProvider(true) diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt index 3ca8812bb..074ccb6dd 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt @@ -673,7 +673,7 @@ class GalleryDetailScene : } val w = mColorBg!!.width val h = mColorBg!!.height - return if (ViewCompat.isAttachedToWindow(mColorBg!!) && w != 0 && h != 0) { + return if (mColorBg!!.isAttachedToWindow && w != 0 && h != 0) { val resources = context.resources val keylineMargin = resources.getDimensionPixelSize(R.dimen.keyline_margin) val thumbWidth = resources.getDimensionPixelSize(R.dimen.gallery_detail_thumb_width) diff --git a/app/src/main/java/com/hippo/ehviewer/widget/EhStageLayout.kt b/app/src/main/java/com/hippo/ehviewer/widget/EhStageLayout.kt index 6a265c872..5541170df 100644 --- a/app/src/main/java/com/hippo/ehviewer/widget/EhStageLayout.kt +++ b/app/src/main/java/com/hippo/ehviewer/widget/EhStageLayout.kt @@ -23,7 +23,6 @@ import android.util.AttributeSet import android.view.View import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.coordinatorlayout.widget.CoordinatorLayout.AttachedBehavior -import androidx.core.view.ViewCompat import androidx.interpolator.view.animation.FastOutSlowInInterpolator import com.google.android.material.snackbar.Snackbar.SnackbarLayout import com.hippo.scene.StageLayout @@ -98,7 +97,7 @@ class EhStageLayout @JvmOverloads constructor( ) ).toDouble(), ).toFloat() - ViewCompat.animate(view).setInterpolator(FastOutSlowInInterpolator()) + view.animate().setInterpolator(FastOutSlowInInterpolator()) .translationY(translationY).setDuration(150).start() } } @@ -111,11 +110,8 @@ class EhStageLayout @JvmOverloads constructor( dependency: View, ) { for (i in 0 until child.aboveSnackViewCount) { - val view = child.getAboveSnackViewAt(i) - if (view != null) { - ViewCompat.animate(view).setInterpolator(FastOutSlowInInterpolator()) - .translationY(0f).setDuration(75).start() - } + child.getAboveSnackViewAt(i)?.animate()?.setInterpolator(FastOutSlowInInterpolator())?.translationY(0f) + ?.setDuration(75)?.start() } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 021f52e18..b412ecea3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,28 +1,31 @@ [versions] -agp = "8.2.2" +agp = "8.3.2" android-tools-r8 = "8.3.37" -androidx-activity = "1.8.2" -androidx-appcompat = "1.6.1" +androidx-activity = "1.9.0" +androidx-appcompat = "1.7.0-alpha03" androidx-biometric = "1.2.0-alpha05" androidx-browser = "1.8.0" androidx-collection = "1.4.0" -androidx-coordinatorlayout = "1.2.0" -androidx-core = "1.12.0" -androidx-fragment = "1.6.2" +androidx-coordinatorlayout = "1.3.0-alpha02" +androidx-core = "1.13.0" +androidx-fragment = "1.8.0-alpha02" androidx-lifecycle = "2.7.0" androidx-paging = "3.2.1" androidx-preference = "1.2.1" androidx-recyclerview = "1.3.2" androidx-room = "2.6.1" androidx-swiperefreshlayout = "1.2.0-alpha01" -coil = "2.5.0" +coil = "2.6.0" +drawer = "1.0.3" google-android-material = "1.11.0" +jsoup = "1.17.2" kotlin = "1.9.23" kotlinx-coroutines = "1.8.0" -ksp = "1.9.23-1.0.19" -okhttp3 = "5.0.0-alpha.11" +ksp = "1.9.23-1.0.20" +okhttp3 = "5.0.0-alpha.14" okio = "3.9.0" rikkax-material = { strictly = "1.6.6" } +spotless = "6.25.0" [libraries] androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" } @@ -37,14 +40,13 @@ androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", androidx-paging-runtime = { module = "androidx.paging:paging-runtime-ktx", version.ref = "androidx-paging" } androidx-preference = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preference" } androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidx-recyclerview" } - androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" } androidx-room-paging = { module = "androidx.room:room-paging", version.ref = "androidx-room" } - androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidx-swiperefreshlayout" } + coil = { module = "io.coil-kt:coil", version.ref = "coil" } -drawer = "com.drakeet.drawer:drawer:1.0.3" -jsoup = "org.jsoup:jsoup:1.17.2" +drawer = { module = "com.drakeet.drawer:drawer", version.ref = "drawer" } +jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } material = { module = "com.google.android.material:material", version.ref = "google-android-material" } @@ -68,4 +70,4 @@ android-application = { id = "com.android.application", version.ref = "agp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } -spotless = { id = "com.diffplug.spotless", version = "6.25.0" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a80b22ce5..b82aa23a4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME