diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7f73bc1b..785dfc341 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Install NDK run: | - echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;26.0.10404224" --channel=1 --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null + echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;26.0.10636728" --channel=1 --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null - name: Install Rust Toolchain run: rustup update && rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android && rustup component add rustfmt clippy diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7fac5f1ee..b79e605e9 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -20,7 +20,7 @@ jobs: - name: Install NDK run: | - echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;26.0.10404224" --channel=1 --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null + echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;26.0.10636728" --channel=1 --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null - name: Install Rust Toolchain run: rustup update && rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android && rustup component add rustfmt clippy diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 6902dabd1..01426e578 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -23,7 +23,7 @@ jobs: - name: Install NDK run: | - echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;26.0.10404224" --channel=1 --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null + echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;26.0.10636728" --channel=1 --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null - name: Install Rust Toolchain run: rustup update && rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7e262ad25..9e53df755 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -21,7 +21,7 @@ plugins { android { compileSdk = 34 buildToolsVersion = "34.0.0" - ndkVersion = "26.0.10404224" + ndkVersion = "26.0.10636728" splits { abi { @@ -159,7 +159,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion = "1.5.1" + kotlinCompilerExtensionVersion = "1.5.3" } namespace = "com.hippo.ehviewer" @@ -167,7 +167,7 @@ android { dependencies { // https://developer.android.com/jetpack/androidx/releases/activity - implementation("androidx.activity:activity-compose:1.8.0-alpha06") + implementation("androidx.activity:activity-compose:1.8.0-alpha07") implementation("androidx.appcompat:appcompat:1.6.1") implementation("androidx.biometric:biometric-ktx:1.2.0-alpha05") implementation("androidx.browser:browser:1.6.0") @@ -185,12 +185,12 @@ dependencies { implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha12") implementation("androidx.coordinatorlayout:coordinatorlayout:1.2.0") - implementation("androidx.fragment:fragment-ktx:1.7.0-alpha02") + implementation("androidx.fragment:fragment-ktx:1.7.0-alpha03") // https://developer.android.com/jetpack/androidx/releases/lifecycle implementation("androidx.lifecycle:lifecycle-process:2.6.1") // https://developer.android.com/jetpack/androidx/releases/navigation - val nav_version = "2.7.0" + val nav_version = "2.7.1" implementation("androidx.navigation:navigation-fragment-ktx:$nav_version") implementation("androidx.navigation:navigation-ui-ktx:$nav_version") implementation("androidx.navigation:navigation-compose:$nav_version") @@ -203,7 +203,7 @@ dependencies { implementation("androidx.recyclerview:recyclerview-selection:1.2.0-alpha01") // https://developer.android.com/jetpack/androidx/releases/room - val room_version = "2.6.0-alpha03" + val room_version = "2.6.0-beta01" ksp("androidx.room:room-compiler:$room_version") implementation("androidx.room:room-paging:$room_version") @@ -213,7 +213,7 @@ dependencies { implementation("com.github.chrisbanes:PhotoView:2.3.0") // Dead Dependency implementation("com.github.tachiyomiorg:DirectionalViewPager:1.0.0") // Dead Dependency // https://github.com/google/accompanist/releases - val accompanist_version = "0.31.6-rc" + val accompanist_version = "0.32.0" implementation("com.google.accompanist:accompanist-themeadapter-material3:$accompanist_version") implementation("com.google.accompanist:accompanist-webview:$accompanist_version") implementation("com.google.android.material:material:1.11.0-alpha02") @@ -253,7 +253,7 @@ dependencies { implementation("org.chromium.net:cronet-api:113.5672.61") implementation("com.google.android.gms:play-services-cronet:18.0.1") - val serialization = "1.5.1" + val serialization = "1.6.0" implementation("org.jetbrains.kotlinx:kotlinx-serialization-cbor:$serialization") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-okio:$serialization") @@ -299,6 +299,6 @@ tasks.configureEach { if ((name == "mergeDebugJniLibFolders" || name == "mergeReleaseJniLibFolders")) { dependsOn("cargoBuild") // fix mergeDebugJniLibFolders UP-TO-DATE - inputs.dir(buildDir.resolve("rustJniLibs/android")) + inputs.dir(layout.buildDirectory.dir("rustJniLibs/android")) } } diff --git a/app/src/main/java/com/hippo/ehviewer/dao/DownloadInfo.kt b/app/src/main/java/com/hippo/ehviewer/dao/DownloadInfo.kt index 3cc4e826e..bb6694769 100644 --- a/app/src/main/java/com/hippo/ehviewer/dao/DownloadInfo.kt +++ b/app/src/main/java/com/hippo/ehviewer/dao/DownloadInfo.kt @@ -44,21 +44,23 @@ data class DownloadEntity( @ColumnInfo(name = "POSITION") override var position: Int = 0, + + @Ignore + override var speed: Long = 0, + + @Ignore + override var remaining: Long = 0, + + @Ignore + override var finished: Int = 0, + + @Ignore + override var downloaded: Int = 0, + + @Ignore + override var total: Int = 0, ) : AbstractDownloadInfo { - @Ignore - override var speed: Long = 0 - - @Ignore - override var remaining: Long = 0 - - @Ignore - override var finished = 0 - - @Ignore - override var downloaded = 0 - - @Ignore - override var total = 0 + constructor() : this(0) } data class DownloadInfo( diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/DownloadsScene.kt b/app/src/main/java/com/hippo/ehviewer/ui/scene/DownloadsScene.kt index 370f869eb..cc6c3cf46 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/DownloadsScene.kt +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/DownloadsScene.kt @@ -202,7 +202,7 @@ class DownloadsScene : getString(R.string.default_download_label_name) -> DownloadManager.defaultInfoList else -> DownloadManager.getLabelDownloadInfoList(mLabel) ?: DownloadManager.allInfoList.also { mLabel = null } - }.filter(::filter) + }.mapNotNull { it.takeIf(::filter)?.copy(downloadInfo = it.downloadInfo.copy()) } submitList(list) { if (mGid != -1L) { val position = list.indexOfFirst { it.gid == mGid } 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 d012ec689..6c59f1afd 100755 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.kt @@ -105,6 +105,7 @@ import arrow.core.partially1 import coil.imageLoader import com.google.android.material.snackbar.Snackbar import com.hippo.ehviewer.EhApplication.Companion.galleryDetailCache +import com.hippo.ehviewer.EhApplication.Companion.imageCache import com.hippo.ehviewer.EhDB import com.hippo.ehviewer.R import com.hippo.ehviewer.Settings @@ -122,6 +123,7 @@ import com.hippo.ehviewer.client.data.GalleryTagGroup import com.hippo.ehviewer.client.data.ListUrlBuilder import com.hippo.ehviewer.client.exception.EhException import com.hippo.ehviewer.client.exception.NoHAtHClientException +import com.hippo.ehviewer.client.getImageKey import com.hippo.ehviewer.client.parser.ArchiveParser import com.hippo.ehviewer.client.parser.HomeParser import com.hippo.ehviewer.client.parser.TorrentResult @@ -341,6 +343,24 @@ class GalleryDetailScene : BaseScene() { } } + private fun actionClearCache() { + val gd = composeBindingGD ?: return + lifecycleScope.launchIO { + dialogState.awaitPermissionOrCancel( + confirmText = R.string.clear_all, + dismissText = android.R.string.cancel, + title = R.string.clear_image_cache, + ) { + Text(text = stringResource(id = R.string.clear_image_cache_confirm)) + } + (0..刷新 刷新(原图) 在其他应用中打开 + 清除图片缓存 + 清除该画廊的所有图片缓存? + 已清除图片缓存 评分成功 评分失败 没有种子 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 161e15fab..ec57d15ac 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -191,6 +191,9 @@ Refresh Refresh (Original image) Open with other app + Clear image cache + Clear all cached images for this gallery? + Image cache cleared Rate successfully Rate failed No torrents diff --git a/build.gradle.kts b/build.gradle.kts index 0ede20c7b..f2852e193 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - id("com.android.application") version "8.1.0" apply false - kotlin("android") version "1.9.0" apply false - kotlin("plugin.serialization") version "1.9.0" apply false - id("com.google.devtools.ksp") version "1.9.0-1.0.13" apply false + id("com.android.application") version "8.1.1" apply false + kotlin("android") version "1.9.10" apply false + kotlin("plugin.serialization") version "1.9.10" apply false + id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false id("com.mikepenz.aboutlibraries.plugin") version "10.8.3" apply false id("org.mozilla.rust-android-gradle.rust-android") version "0.9.3" apply false id("dev.shreyaspatil.compose-compiler-report-generator") version "1.1.0" apply false @@ -13,7 +13,7 @@ allprojects { } tasks.register("Delete", Delete::class) { - delete(rootProject.buildDir) + delete(rootProject.layout.buildDirectory) } buildscript {