diff --git a/README.md b/README.md index 42db2fb9..b18a2a37 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@
(A New Integration View)
- AniVu, an all-in-one tool for RSS subscription and updates, bit torrent downloads, and video playback. + An all-in-one tool for RSS subscription and updates, bit torrent downloads, and video playback.
AniVu utilizes the MVI architecture and fully adopts the Material You design style. All pages are developed using Jetpack Compose.
- 中文   |   正體中文   |   Help us translate + 简体中文   |   正體中文   |   Help us translate
+ ## 💡 Features diff --git a/app/build.gradle.kts b/app/build.gradle.kts index fba9e25e..107901fe 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -22,7 +22,7 @@ android { minSdk = 24 targetSdk = 35 versionCode = 24 - versionName = "2.1-beta06" + versionName = "2.1-beta07" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/com/skyd/anivu/ext/NavExt.kt b/app/src/main/java/com/skyd/anivu/ext/NavExt.kt index 40b436d1..3783753f 100644 --- a/app/src/main/java/com/skyd/anivu/ext/NavExt.kt +++ b/app/src/main/java/com/skyd/anivu/ext/NavExt.kt @@ -1,12 +1,9 @@ package com.skyd.anivu.ext import android.os.Bundle -import androidx.core.net.toUri import androidx.lifecycle.Lifecycle import androidx.navigation.NavBackStackEntry import androidx.navigation.NavController -import androidx.navigation.NavDeepLinkRequest -import androidx.navigation.NavDestination import androidx.navigation.NavOptions import androidx.navigation.Navigator @@ -16,23 +13,9 @@ fun NavController.navigate( navOptions: NavOptions? = null, navigatorExtras: Navigator.Extras? = null ) { - val routeLink = NavDeepLinkRequest - .Builder - .fromUri(NavDestination.createRoute(route).toUri()) - .build() - - val deepLinkMatch = graph.matchDeepLink(routeLink) - if (deepLinkMatch != null) { - val destination = deepLinkMatch.destination - val id = destination.id - navigate( - id, - args.apply { putAll(deepLinkMatch.matchingArgs ?: Bundle()) }, - navOptions, - navigatorExtras - ) - } else { - navigate(route, navOptions, navigatorExtras) + val nodeId = graph.findNode(route = route)?.id + if (nodeId != null) { + navigate(nodeId, args, navOptions, navigatorExtras) } } diff --git a/app/src/main/java/com/skyd/anivu/ext/PreferenceExt.kt b/app/src/main/java/com/skyd/anivu/ext/PreferenceExt.kt index 5096c946..ebf8beb9 100644 --- a/app/src/main/java/com/skyd/anivu/ext/PreferenceExt.kt +++ b/app/src/main/java/com/skyd/anivu/ext/PreferenceExt.kt @@ -33,6 +33,8 @@ import com.skyd.anivu.model.preference.behavior.feed.HideEmptyDefaultPreference import com.skyd.anivu.model.preference.data.OpmlExportDirPreference import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleBeforePreference import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleFrequencyPreference +import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleKeepFavoritePreference +import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleKeepUnreadPreference import com.skyd.anivu.model.preference.data.autodelete.UseAutoDeletePreference import com.skyd.anivu.model.preference.data.medialib.MediaLibLocationPreference import com.skyd.anivu.model.preference.player.HardwareDecodePreference @@ -118,6 +120,8 @@ fun Preferences.toSettings(): Settings { useAutoDelete = UseAutoDeletePreference.fromPreferences(this), autoDeleteArticleFrequency = AutoDeleteArticleFrequencyPreference.fromPreferences(this), autoDeleteArticleBefore = AutoDeleteArticleBeforePreference.fromPreferences(this), + autoDeleteArticleKeepUnread = AutoDeleteArticleKeepUnreadPreference.fromPreferences(this), + autoDeleteArticleKeepFavorite = AutoDeleteArticleKeepFavoritePreference.fromPreferences(this), opmlExportDir = OpmlExportDirPreference.fromPreferences(this), mediaLibLocation = MediaLibLocationPreference.fromPreferences(this), diff --git a/app/src/main/java/com/skyd/anivu/model/db/dao/ArticleDao.kt b/app/src/main/java/com/skyd/anivu/model/db/dao/ArticleDao.kt index 1199df46..a5694dc0 100644 --- a/app/src/main/java/com/skyd/anivu/model/db/dao/ArticleDao.kt +++ b/app/src/main/java/com/skyd/anivu/model/db/dao/ArticleDao.kt @@ -133,11 +133,17 @@ interface ArticleDao { @Query( """ DELETE FROM $ARTICLE_TABLE_NAME - WHERE ${ArticleBean.UPDATE_AT_COLUMN} IS NULL - OR ${ArticleBean.UPDATE_AT_COLUMN} <= :timestamp + WHERE (${ArticleBean.UPDATE_AT_COLUMN} IS NULL + OR ${ArticleBean.UPDATE_AT_COLUMN} <= :timestamp) + AND (:keepUnread = 0 OR ${ArticleBean.IS_READ_COLUMN} = 1) + AND (:keepFavorite = 0 OR ${ArticleBean.IS_FAVORITE_COLUMN} = 0) """ ) - suspend fun deleteArticleBefore(timestamp: Long): Int + suspend fun deleteArticleBefore( + timestamp: Long, + keepUnread: Boolean = true, + keepFavorite: Boolean = true, + ): Int @Transaction @RawQuery(observedEntities = [FeedBean::class, ArticleBean::class, EnclosureBean::class]) diff --git a/app/src/main/java/com/skyd/anivu/model/preference/Settings.kt b/app/src/main/java/com/skyd/anivu/model/preference/Settings.kt index 8fd909d5..b100c736 100644 --- a/app/src/main/java/com/skyd/anivu/model/preference/Settings.kt +++ b/app/src/main/java/com/skyd/anivu/model/preference/Settings.kt @@ -23,8 +23,8 @@ import com.skyd.anivu.model.preference.appearance.feed.FeedDefaultGroupExpandPre import com.skyd.anivu.model.preference.appearance.feed.FeedListTonalElevationPreference import com.skyd.anivu.model.preference.appearance.feed.FeedTopBarTonalElevationPreference import com.skyd.anivu.model.preference.appearance.media.MediaShowThumbnailPreference -import com.skyd.anivu.model.preference.appearance.read.ReadTextSizePreference import com.skyd.anivu.model.preference.appearance.read.ReadContentTonalElevationPreference +import com.skyd.anivu.model.preference.appearance.read.ReadTextSizePreference import com.skyd.anivu.model.preference.appearance.read.ReadTopBarTonalElevationPreference import com.skyd.anivu.model.preference.appearance.search.SearchItemMinWidthPreference import com.skyd.anivu.model.preference.appearance.search.SearchListTonalElevationPreference @@ -38,6 +38,8 @@ import com.skyd.anivu.model.preference.behavior.feed.HideEmptyDefaultPreference import com.skyd.anivu.model.preference.data.OpmlExportDirPreference import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleBeforePreference import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleFrequencyPreference +import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleKeepFavoritePreference +import com.skyd.anivu.model.preference.data.autodelete.AutoDeleteArticleKeepUnreadPreference import com.skyd.anivu.model.preference.data.autodelete.UseAutoDeletePreference import com.skyd.anivu.model.preference.data.medialib.MediaLibLocationPreference import com.skyd.anivu.model.preference.player.HardwareDecodePreference @@ -71,6 +73,8 @@ import com.skyd.anivu.ui.local.LocalArticleTapAction import com.skyd.anivu.ui.local.LocalArticleTopBarTonalElevation import com.skyd.anivu.ui.local.LocalAutoDeleteArticleBefore import com.skyd.anivu.ui.local.LocalAutoDeleteArticleFrequency +import com.skyd.anivu.ui.local.LocalAutoDeleteArticleKeepFavorite +import com.skyd.anivu.ui.local.LocalAutoDeleteArticleKeepUnread import com.skyd.anivu.ui.local.LocalDarkMode import com.skyd.anivu.ui.local.LocalDateStyle import com.skyd.anivu.ui.local.LocalDeduplicateTitleInDesc @@ -100,8 +104,8 @@ import com.skyd.anivu.ui.local.LocalProxyPassword import com.skyd.anivu.ui.local.LocalProxyPort import com.skyd.anivu.ui.local.LocalProxyType import com.skyd.anivu.ui.local.LocalProxyUsername -import com.skyd.anivu.ui.local.LocalReadTextSize import com.skyd.anivu.ui.local.LocalReadContentTonalElevation +import com.skyd.anivu.ui.local.LocalReadTextSize import com.skyd.anivu.ui.local.LocalReadTopBarTonalElevation import com.skyd.anivu.ui.local.LocalRssSyncBatteryNotLowConstraint import com.skyd.anivu.ui.local.LocalRssSyncChargingConstraint @@ -172,6 +176,8 @@ data class Settings( val useAutoDelete: Boolean = UseAutoDeletePreference.default, val autoDeleteArticleFrequency: Long = AutoDeleteArticleFrequencyPreference.default, val autoDeleteArticleBefore: Long = AutoDeleteArticleBeforePreference.default, + val autoDeleteArticleKeepUnread: Boolean = AutoDeleteArticleKeepUnreadPreference.default, + val autoDeleteArticleKeepFavorite: Boolean = AutoDeleteArticleKeepFavoritePreference.default, val opmlExportDir: String = OpmlExportDirPreference.default, val mediaLibLocation: String = MediaLibLocationPreference.default, // Transmission @@ -245,6 +251,8 @@ fun SettingsProvider( LocalUseAutoDelete provides settings.useAutoDelete, LocalAutoDeleteArticleFrequency provides settings.autoDeleteArticleFrequency, LocalAutoDeleteArticleBefore provides settings.autoDeleteArticleBefore, + LocalAutoDeleteArticleKeepUnread provides settings.autoDeleteArticleKeepUnread, + LocalAutoDeleteArticleKeepFavorite provides settings.autoDeleteArticleKeepFavorite, LocalOpmlExportDir provides settings.opmlExportDir, LocalMediaLibLocation provides settings.mediaLibLocation, // Transmission diff --git a/app/src/main/java/com/skyd/anivu/model/preference/data/autodelete/AutoDeleteArticleKeepFavoritePreference.kt b/app/src/main/java/com/skyd/anivu/model/preference/data/autodelete/AutoDeleteArticleKeepFavoritePreference.kt new file mode 100644 index 00000000..0cf05ddd --- /dev/null +++ b/app/src/main/java/com/skyd/anivu/model/preference/data/autodelete/AutoDeleteArticleKeepFavoritePreference.kt @@ -0,0 +1,27 @@ +package com.skyd.anivu.model.preference.data.autodelete + +import android.content.Context +import androidx.datastore.preferences.core.Preferences +import androidx.datastore.preferences.core.booleanPreferencesKey +import com.skyd.anivu.base.BasePreference +import com.skyd.anivu.ext.dataStore +import com.skyd.anivu.ext.put +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch + +object AutoDeleteArticleKeepFavoritePreference : BasePreference(A New Integration View)
@@ -30,7 +31,7 @@ 使用 MVI 架构,完全采用 Material You 设计风格。使用 Jetpack Compose 开发。
- English   |   中文   |   正體中文   |   帮助我们翻译 + English   |   简体中文   |   正體中文   |   帮助我们翻译
diff --git a/doc/readme/README-zh-rTW.md b/doc/readme/README-zh-rTW.md index 5b741df7..533d1c93 100644 --- a/doc/readme/README-zh-rTW.md +++ b/doc/readme/README-zh-rTW.md @@ -3,6 +3,7 @@(A New Integration View)
@@ -30,10 +31,11 @@ 使用 MVI 架構,完全採用 Material You 設計風格。使用 Jetpack Compose 開發。
- English   |   中文   |   正體中文   |   幫助我們翻譯 + English   |   简体中文   |   正體中文   |   幫助我們翻譯
+ ## 💡主要功能 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 806dbc96..905caa25 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ adaptive = "1.0.0" coil = "2.7.0" hilt = "2.52" libtorrent4j = "2.1.0-31" -composeMaterial = "1.7.1" +composeMaterial = "1.7.3" composeMaterial3 = "1.3.0" okhttp3 = "4.12.0" rome = "2.1.0" @@ -16,9 +16,9 @@ androidx-core-ktx = { module = "androidx.core:core-ktx", version = "1.13.1" } androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" } androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version = "1.9.2" } androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version = "1.1.0-beta01" } -androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version = "2.8.0" } -androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version = "2.8.5" } -androidx-compose-ui = { module = "androidx.compose.ui:ui", version = "1.7.1" } +androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version = "2.8.2" } +androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version = "2.8.6" } +androidx-compose-ui = { module = "androidx.compose.ui:ui", version = "1.7.3" } androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "composeMaterial" } androidx-compose-icons = { module = "androidx.compose.material:material-icons-extended", version.ref = "composeMaterial" } androidx-compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "composeMaterial3" } @@ -35,10 +35,10 @@ androidx-datastore-preferences = { module = "androidx.datastore:datastore-prefer androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version = "1.0.1" } androidx-paging-compose = { module = "androidx.paging:paging-compose", version = "3.3.2" } androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version = "1.2.0" } -androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version = "1.3.1" } +androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version = "1.4.1" } material = { module = "com.google.android.material:material", version = "1.12.0" } -material-kolor = { module = "com.materialkolor:material-kolor", version = "1.7.0" } +material-kolor = { module = "com.materialkolor:material-kolor", version = "2.0.0" } accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version = "0.36.0" } hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } @@ -49,7 +49,7 @@ okhttp3-coroutines-jvm = { module = "com.squareup.okhttp3:okhttp-coroutines-jvm" okhttp3-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp3" } retrofit2 = { module = "com.squareup.retrofit2:retrofit", version = "2.11.0" } retrofit2-kotlinx-serialization-converter = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version = "1.0.0" } -kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.7.2" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.7.3" } kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version = "1.9.0" } aniyomi-mpv-lib = { module = "com.github.aniyomiorg:aniyomi-mpv-lib", version = "1.15.n" }