From 402efc07ced528fc939d5d645e1f8a8f07636f40 Mon Sep 17 00:00:00 2001 From: 15dd Date: Fri, 18 Oct 2024 23:04:23 +0800 Subject: [PATCH] v3.1.1 --- .idea/deploymentTargetSelector.xml | 11 ++ app/build.gradle.kts | 11 +- app/release/app-release.apk | Bin 9855287 -> 9855287 bytes .../java/com/cyh128/hikari_novel/HikariApp.kt | 3 +- .../data/repository/Wenku8Repository.kt | 129 ++++++++---------- .../ui/view/other/CrashActivity.kt | 5 + .../ui/view/read/horizontal/ReadActivity.kt | 2 +- .../ui/view/read/vertical/ReadFragment.kt | 2 +- .../ui/view/splash/SplashActivity.kt | 5 +- app/src/main/res/layout/activity_crash.xml | 7 + .../layout/view_horizontal_read_config.xml | 18 +-- .../res/layout/view_vertical_read_config.xml | 10 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 10 +- 14 files changed, 115 insertions(+), 100 deletions(-) diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml index b268ef3..2ee877e 100644 --- a/.idea/deploymentTargetSelector.xml +++ b/.idea/deploymentTargetSelector.xml @@ -4,6 +4,17 @@ + + diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8046a38..f923f5b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -15,8 +15,8 @@ android { applicationId = "com.cyh128.hikari_novel" minSdk = 24 targetSdk = 34 - versionCode = 241007 - versionName = "3.1.0" + versionCode = 241018 + versionName = "3.1.1" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -80,12 +80,13 @@ dependencies { //android相关 implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.appcompat:appcompat:1.7.0") - implementation("com.google.android.material:material:1.13.0-alpha06") + implementation("com.google.android.material:material:1.13.0-alpha07") implementation("androidx.constraintlayout:constraintlayout:2.1.4") implementation("androidx.recyclerview:recyclerview:1.3.2") implementation("androidx.viewpager2:viewpager2:1.1.0") - implementation("androidx.navigation:navigation-fragment-ktx:2.8.2") - implementation("androidx.navigation:navigation-ui-ktx:2.8.2") + + implementation("androidx.navigation:navigation-fragment-ktx:2.8.3") + implementation("androidx.navigation:navigation-ui-ktx:2.8.3") //数据库 implementation("androidx.room:room-ktx:2.6.1") diff --git a/app/release/app-release.apk b/app/release/app-release.apk index b53e3a8efe874fc5ce779c693744955a3a8691da..97ab5787f270ae0a951a17fecfaddb46d21651a6 100644 GIT binary patch delta 978 zcmW;L`%er20KoBH&Z#_mE0wzBk_s15)G4PE$%!5asjgD=xFXU+>BVuPGdW|dEI%|V z-Sk6xOq1KlhSDO#YBt%J_cFfx@c9!y`kohNdT1`1Nt&#J&R#y|DVB|;h{yV6Y1*^} z;*>sdQ=e8)p%n^Wg?}h~R+*@Weuh;e|!;#$x!u7k*fRrC0_D z{IMJ>5P+3fg+K&hHP#>)A&_D%LJ@{_kYPQ-A;$(pU?Vmm5}Of)El^-9qOlFz5rbI7 zAs#!h6T6Ur-PnV@NW?xQAsH!9A{A*!$9`lW69;e*S;$5Xa-l*V@^J`jib5Pi z5sFcQQXEGa%5ee}s6-X2QG=5>1vO6N3^X{4TAagqz0|la*wj_^{jF(d!ie%_nDg)6 zZ@T1Gxs%VxY4hI&my#xnN4o~}SIz1=Op2$hKCIKoFSSG#+`se9)VAdD;N~ac9cvns z+Ts;{2Y=YK`gF&3d8mSWJKL)a(nptlKip`yl{VZSmkk(c`>pQQoboVC46e(J_IUX; zIWosD?CYd^mOgS+c2jsn(qs25r9<>;gE~Mr-2M8xaw4#FxOQZ4*HB^m=f!W`G=rYS zI(1xjTwA)qEq=DUD9V4r;fhGD>hkweCaObx$8&93a{tWAN{x9SXgKgQHZ=d2#Py+( zw%p>GwK}_b$mLduOM67OW4)_Ry3(;~y;sptl(|#km$J{LIUnt>N!}=)HwQTP6u!In wDet;cXlRghF11wjXo@bRe+jIAzrxtUBt2FiFRaV-{vWr}AgR+EB-#w`zseL=>i_@% delta 978 zcmW;L`%er20KoC;t|Y0D^SDq_iInOpdDZo}I?`M3LgjQRibx(s>CRPpx?Wb!%uPR7 z9?d1jm^H1YXl7~iSb2{hFq_Qy^26s(_!#bw2@R-k6YiCTxHohhb5UwU1Fp(uvo2+q zOr}&R6mo@9p%_qf$@^XPt}2zYs9*n9q^Xb^tEI;Om_Ps_Oksv;FvoOQU z4Q63B=D-$nA;LV&#{w*b7bdo3}O+7cx*)i5|M;t zq#zY(NJj>?VLNsp6IsZ{PAISoIZz@OyOD={?7?0Xpb-18A4NETgDA!!l;ALq;3$rv z6lFM$6DUUoPNEVjsBsD!RG}I*IE`A=p&kurL=(;!q{i9+f&F-AQBZET*7(=P$;j`` zqx#>CH5bn|`_=6;yPh~SRjf1UgxWrnGTpGhs_#jYtbD9Pug?%$l!TSsnzV~8-`%uc z9$|BC_{Qt3Lq>wB%85|*r|*Xyd?wF(X(ls$gXPI1zNw`T8s3%53oODOes%u&{HlkQ zsKK__D7f9Jy`^g^Iey|r!J}_iL_6#KE#I59-L%Zl&6ecYbzJT-bO$P%N(*$Y{$=x1 zod*lUVg|m2sQo_d`SNkx+bT~OSuZ|rB(^pUxI0pKd#GAgb+hdAW8a=W_w3l0PlFt# zZ`ynASw;QuNca)5w({s2LG_82&&htRnrowfEHXs3vd;9*H;XRl7RO1)Y6ab|!Y`Rd wKkMzWZz)P!Cr { - requestUrl = "https://${getWenku8Node()}/modules/article/toplist.php?sort=$ranking&page=$index" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/toplist.php?sort=$ranking&page=$index&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/toplist.php?sort=$ranking&page=$index" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -101,15 +100,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/modules/article/tags.php?t=$category&v=$sort&page=$index" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/tags.php?t=$category&v=$sort&page=$index&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/tags.php?t=$category&v=$sort&page=$index" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -128,15 +126,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = url - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "$url&charset=big5" charset = "BIG5-HKSCS" //不能使用普通的big5编码,不然无法显示日文 } - else -> throw RuntimeException() + else -> { + requestUrl = url + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -155,15 +152,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = url - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "$url?charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = url + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -181,15 +177,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/modules/article/addbookcase.php?bid=$aid" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/addbookcase.php?bid=$aid&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/addbookcase.php?bid=$aid" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -218,15 +213,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/modules/article/bookcase.php" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/bookcase.php?charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/bookcase.php" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -244,15 +238,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/modules/article/reviews.php?aid=$aid&page=$index" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/reviews.php?aid=$aid&page=$index&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/reviews.php?aid=$aid&page=$index" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -270,15 +263,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "$url&page=$index" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "$url&page=$index&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "$url&page=$index" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -295,15 +287,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/index.php" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/index.php?charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/index.php" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -321,15 +312,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/modules/article/uservote.php?id=$aid" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/uservote.php?id=$aid&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/uservote.php?id=$aid" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -347,15 +337,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=articlename&searchkey=$title&page=$index" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=articlename&searchkey=$title&page=$index&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=articlename&searchkey=$title&page=$index" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -380,15 +369,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=author&searchkey=$author&page=$index" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=author&searchkey=$author&page=$index&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/search.php?searchtype=author&searchkey=$author&page=$index" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -418,15 +406,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/userdetail.php" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/userdetail.php?charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/userdetail.php" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -444,15 +431,14 @@ class Wenku8Repository @Inject constructor( val requestUrl: String? val charset: String? when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> { - requestUrl = "https://${getWenku8Node()}/modules/article/articlelist.php?fullflag=1&page=$index" - charset = "GBK" - } Locale.TRADITIONAL_CHINESE -> { requestUrl = "https://${getWenku8Node()}/modules/article/articlelist.php?fullflag=1&page=$index&charset=big5" charset = "BIG5-HKSCS" } - else -> throw RuntimeException() + else -> { + requestUrl = "https://${getWenku8Node()}/modules/article/articlelist.php?fullflag=1&page=$index" + charset = "GBK" + } } network.getData(requestUrl) .awaitResult { body -> @@ -473,9 +459,8 @@ class Wenku8Repository @Inject constructor( //获取小说内容 suspend fun getNovelContent(aid: String, cid: String): Result { val requestUrl = when(Lingver.getInstance().getLocale()) { - Locale.SIMPLIFIED_CHINESE -> "action=book&do=text&aid=$aid&cid=$cid&t=0" Locale.TRADITIONAL_CHINESE -> "action=book&do=text&aid=$aid&cid=$cid&t=1" - else -> throw RuntimeException() + else -> "action=book&do=text&aid=$aid&cid=$cid&t=0" } network.getDataFromAppWenku8Com(requestUrl) .awaitResult { diff --git a/app/src/main/java/com/cyh128/hikari_novel/ui/view/other/CrashActivity.kt b/app/src/main/java/com/cyh128/hikari_novel/ui/view/other/CrashActivity.kt index 313d6c3..e522489 100644 --- a/app/src/main/java/com/cyh128/hikari_novel/ui/view/other/CrashActivity.kt +++ b/app/src/main/java/com/cyh128/hikari_novel/ui/view/other/CrashActivity.kt @@ -3,7 +3,9 @@ package com.cyh128.hikari_novel.ui.view.other import android.os.Bundle import com.cyh128.hikari_novel.base.BaseActivity import com.cyh128.hikari_novel.databinding.ActivityCrashBinding +import com.cyh128.hikari_novel.ui.view.main.more.more.setting.SettingActivity import com.cyh128.hikari_novel.util.openUrl +import com.cyh128.hikari_novel.util.startActivity import com.developer.crashx.CrashActivity class CrashActivity: BaseActivity() { @@ -17,5 +19,8 @@ class CrashActivity: BaseActivity() { binding.bACrashReport.setOnClickListener { openUrl("https://github.com/15dd/wenku8reader/issues") } + binding.bACrashSetting.setOnClickListener { + startActivity() + } } } \ No newline at end of file diff --git a/app/src/main/java/com/cyh128/hikari_novel/ui/view/read/horizontal/ReadActivity.kt b/app/src/main/java/com/cyh128/hikari_novel/ui/view/read/horizontal/ReadActivity.kt index 902116d..8565adc 100644 --- a/app/src/main/java/com/cyh128/hikari_novel/ui/view/read/horizontal/ReadActivity.kt +++ b/app/src/main/java/com/cyh128/hikari_novel/ui/view/read/horizontal/ReadActivity.kt @@ -91,7 +91,7 @@ class ReadActivity : BaseActivity() { bottomViewBinding.sVHReadConfigRestoreChapterReadHistory.isChecked = false } .setNegativeButton(R.string.not_restore) { _, _ -> } - .setPositiveButton(R.string.restore_chapter_read_history) { _, _ -> + .setPositiveButton(R.string.restore_chapter_read_history_with_confirm) { _, _ -> binding.pvAHRead.pageNum = it.location } .show() diff --git a/app/src/main/java/com/cyh128/hikari_novel/ui/view/read/vertical/ReadFragment.kt b/app/src/main/java/com/cyh128/hikari_novel/ui/view/read/vertical/ReadFragment.kt index 036aceb..1d651eb 100644 --- a/app/src/main/java/com/cyh128/hikari_novel/ui/view/read/vertical/ReadFragment.kt +++ b/app/src/main/java/com/cyh128/hikari_novel/ui/view/read/vertical/ReadFragment.kt @@ -113,7 +113,7 @@ class ReadFragment : BaseFragment() { (requireActivity() as ReadActivity).setRestoreChapterReadHistoryDisable() } .setNegativeButton(R.string.not_restore) { _, _ -> } - .setPositiveButton(R.string.restore_chapter_read_history) { _, _ -> + .setPositiveButton(R.string.restore_chapter_read_history_with_confirm) { _, _ -> binding.nsvFVRead.scrollTo(0, it.location) //滚动到指定位置 } .show() diff --git a/app/src/main/java/com/cyh128/hikari_novel/ui/view/splash/SplashActivity.kt b/app/src/main/java/com/cyh128/hikari_novel/ui/view/splash/SplashActivity.kt index 1dad009..66f894d 100644 --- a/app/src/main/java/com/cyh128/hikari_novel/ui/view/splash/SplashActivity.kt +++ b/app/src/main/java/com/cyh128/hikari_novel/ui/view/splash/SplashActivity.kt @@ -56,10 +56,7 @@ class SplashActivity : BaseActivity() { } when (viewModel.getLanguage()) { - Language.FOLLOW_SYSTEM -> { - Lingver.getInstance().setFollowSystemLocale(this) - if (Lingver.getInstance().getLanguage() != "zh") Lingver.getInstance().setLocale(this, Locale.SIMPLIFIED_CHINESE) - } + Language.FOLLOW_SYSTEM -> Lingver.getInstance().setFollowSystemLocale(this) Language.ZH_CN -> Lingver.getInstance().setLocale(this, Locale.SIMPLIFIED_CHINESE) Language.ZH_TW -> Lingver.getInstance().setLocale(this, Locale.TRADITIONAL_CHINESE) } diff --git a/app/src/main/res/layout/activity_crash.xml b/app/src/main/res/layout/activity_crash.xml index 8f7ff1e..5d653b7 100644 --- a/app/src/main/res/layout/activity_crash.xml +++ b/app/src/main/res/layout/activity_crash.xml @@ -54,6 +54,13 @@ android:orientation="vertical" android:padding="20dp"> + + + android:text="@string/modify" /> diff --git a/app/src/main/res/layout/view_vertical_read_config.xml b/app/src/main/res/layout/view_vertical_read_config.xml index 9b8f1df..0e865c6 100644 --- a/app/src/main/res/layout/view_vertical_read_config.xml +++ b/app/src/main/res/layout/view_vertical_read_config.xml @@ -21,7 +21,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:text="@string/fontsize" + android:text="@string/font_size" android:textSize="16sp" /> + android:text="@string/modify"/> diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 3836758..63c3710 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -227,7 +227,7 @@ 未閱讀 歷史 此章節有你的歷史閱讀記錄,是否恢復? - 恢復章節歷史記錄 + 恢復章節歷史記錄 不恢復 永不顯示此提示(僅當前閱讀模式) 閱讀完成 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e87d7e0..26e3cc4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -229,7 +229,7 @@ 未阅读 历史 此章节有你的历史阅读记录,是否恢复? - 恢复章节历史记录 + 恢复章节历史记录 不恢复 永不显示此提示(仅当前阅读模式) 阅读完成 @@ -255,5 +255,13 @@ 热度 上升指数 冷启动默认Tab + 直接恢复历史记录并且不提醒 + 翻页动画 + 音量键翻页 + 屏幕常亮 + 进度提示字体大小 + 字体大小 + 修改 + 字体颜色和背景颜色 \ No newline at end of file