From 84a2bae3f0a4d3f35c6f33dcb1648113c240044c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Aug 2022 04:36:13 +0000 Subject: [PATCH 01/18] Bump desugar_jdk_libs from 1.1.6 to 1.2.2 in /app Bumps [desugar_jdk_libs](https://github.com/google/desugar_jdk_libs) from 1.1.6 to 1.2.2. - [Release notes](https://github.com/google/desugar_jdk_libs/releases) - [Changelog](https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/desugar_jdk_libs/commits) --- updated-dependencies: - dependency-name: com.android.tools:desugar_jdk_libs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 8778d4394..a03796fc6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -135,7 +135,7 @@ resourcePlaceholders { dependencies { //noinspection GradleDependency - coreLibraryDesugaring('com.android.tools:desugar_jdk_libs:1.1.6') + coreLibraryDesugaring('com.android.tools:desugar_jdk_libs:1.2.2') testImplementation('junit:junit:4.13.2') androidTestImplementation('androidx.test:runner:1.4.0') androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0') From 431d726b65d15039537c15bf3d996bed9811d5b3 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Thu, 15 Sep 2022 23:28:53 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/BookHelp.kt | 5 ++++- .../io/legado/app/ui/association/VerificationCodeActivity.kt | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 608d593b2..aa31d30c7 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -139,8 +139,11 @@ object BookHelp { var bytes = analyzeUrl.getByteArrayAwait() //某些图片被加密,需要进一步解密 bookSource?.getContentRule()?.imageDecode?.let { + if (it.isBlank()) { + return@let + } kotlin.runCatching { - bookSource?.evalJS(it) { + bookSource.evalJS(it) { put("book", book) put("result", bytes) put("src", src) diff --git a/app/src/main/java/io/legado/app/ui/association/VerificationCodeActivity.kt b/app/src/main/java/io/legado/app/ui/association/VerificationCodeActivity.kt index 13ade4694..1166abef5 100644 --- a/app/src/main/java/io/legado/app/ui/association/VerificationCodeActivity.kt +++ b/app/src/main/java/io/legado/app/ui/association/VerificationCodeActivity.kt @@ -17,8 +17,9 @@ class VerificationCodeActivity : override fun onActivityCreated(savedInstanceState: Bundle?) { intent.getStringExtra("imageUrl")?.let { val sourceOrigin = intent.getStringExtra("sourceOrigin") + val sourceName = intent.getStringExtra("sourceName") showDialogFragment( - VerificationCodeDialog(it, sourceOrigin) + VerificationCodeDialog(it, sourceOrigin, sourceName) ) } ?: finish() } From 5a07143ab4e848c8d09b524837f59ead2b3a0b65 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Thu, 15 Sep 2022 23:58:52 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/local/ImportBookActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt index 4ea28ac68..113fb5f25 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt @@ -200,7 +200,7 @@ class ImportBookActivity : VMBaseActivity Date: Fri, 16 Sep 2022 08:11:40 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7abfd3409..94e8f6e7f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ def version = "3." + releaseTime() def gitCommits = Integer.parseInt('git rev-list HEAD --count'.execute().text.trim()) android { - compileSdkVersion 33 - buildToolsVersion "33.0.0" + compileSdkVersion 32 + buildToolsVersion "32.0.0" namespace 'io.legado.app' kotlinOptions { jvmTarget = "11" @@ -41,7 +41,7 @@ android { defaultConfig { applicationId "io.legado.app" minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 32 versionCode 10000 + gitCommits versionName version testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" From 5070f60141416ca2132f57496ca18cf1f6d304db Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 08:20:49 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 94e8f6e7f..7abfd3409 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ def version = "3." + releaseTime() def gitCommits = Integer.parseInt('git rev-list HEAD --count'.execute().text.trim()) android { - compileSdkVersion 32 - buildToolsVersion "32.0.0" + compileSdkVersion 33 + buildToolsVersion "33.0.0" namespace 'io.legado.app' kotlinOptions { jvmTarget = "11" @@ -41,7 +41,7 @@ android { defaultConfig { applicationId "io.legado.app" minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 versionCode 10000 + gitCommits versionName version testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" From 4f22488c4c853a67e14504df404faac766d58fee Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 08:29:23 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/BookHelp.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 608d593b2..c8e230cd5 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -140,7 +140,7 @@ object BookHelp { //某些图片被加密,需要进一步解密 bookSource?.getContentRule()?.imageDecode?.let { kotlin.runCatching { - bookSource?.evalJS(it) { + bookSource.evalJS(it) { put("book", book) put("result", bytes) put("src", src) From 0f8c0c19e34de33a451a94be973325e19834bae9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 08:44:29 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 27d2ef894..b9e15233a 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { kotlin_version = '1.7.10' compose_version = '1.2.1' compose_compiler_version = '1.3.0' - agp_version= '7.2.2' + agp_version = '7.3.0' exoplayer_version = '2.18.1' splitties_version = '3.0.0' room_version = '2.4.3' From 25a3014af9df15ca232cb229b510faba46932f64 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 08:56:05 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/dialog_bookmark.xml | 3 ++- app/src/main/res/layout/dialog_http_tts_edit.xml | 3 ++- app/src/main/res/layout/dialog_login.xml | 3 ++- app/src/main/res/layout/dialog_url_option_edit.xml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/layout/dialog_bookmark.xml b/app/src/main/res/layout/dialog_bookmark.xml index 7c1f49627..b3c9f1796 100644 --- a/app/src/main/res/layout/dialog_bookmark.xml +++ b/app/src/main/res/layout/dialog_bookmark.xml @@ -35,7 +35,8 @@ + android:layout_weight="1" + android:overScrollMode="ifContentScrolls"> + android:layout_height="match_parent" + android:overScrollMode="ifContentScrolls"> + android:layout_height="wrap_content" + android:overScrollMode="ifContentScrolls"> + android:layout_height="wrap_content" + android:overScrollMode="ifContentScrolls"> Date: Fri, 16 Sep 2022 09:15:36 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/association/FileAssociationViewModel.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt b/app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt index 3ad302d5d..0f6a924e1 100644 --- a/app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt @@ -7,13 +7,11 @@ import androidx.lifecycle.MutableLiveData import io.legado.app.constant.AppLog import io.legado.app.constant.AppPattern.bookFileRegex import io.legado.app.exception.NoStackTraceException -import io.legado.app.help.IntentData import io.legado.app.model.localBook.LocalBook import io.legado.app.utils.inputStream import io.legado.app.utils.isJson import io.legado.app.utils.printOnDebug import java.io.File -import java.io.InputStream class FileAssociationViewModel(application: Application) : BaseAssociationViewModel(application) { val importBookLiveData = MutableLiveData() From 16a6683d7a551b635d069ec919d3160ad958c36a Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 09:32:45 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/main/explore/ExploreAdapter.kt | 8 ++------ .../io/legado/app/ui/main/explore/ExploreFragment.kt | 11 +++++++++++ .../io/legado/app/ui/main/explore/ExploreViewModel.kt | 8 ++++++++ app/src/main/res/layout/item_change_source.xml | 2 ++ app/src/main/res/values-es-rES/strings.xml | 4 ++-- app/src/main/res/values-ja-rJP/strings.xml | 4 ++-- app/src/main/res/values-pt-rBR/strings.xml | 4 ++-- app/src/main/res/values-zh-rHK/strings.xml | 4 ++-- app/src/main/res/values-zh-rTW/strings.xml | 4 ++-- app/src/main/res/values-zh/strings.xml | 4 ++-- app/src/main/res/values/strings.xml | 4 ++-- 11 files changed, 37 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt index 41890da49..a06dfee5c 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt @@ -10,12 +10,10 @@ import com.google.android.flexbox.FlexboxLayout import io.legado.app.R import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.RecyclerAdapter -import io.legado.app.data.appDb import io.legado.app.data.entities.BookSource import io.legado.app.data.entities.rule.ExploreKind import io.legado.app.databinding.ItemFilletTextBinding import io.legado.app.databinding.ItemFindBookBinding -import io.legado.app.help.config.SourceConfig import io.legado.app.help.coroutine.Coroutine import io.legado.app.lib.theme.accentColor import io.legado.app.ui.login.SourceLoginActivity @@ -173,10 +171,7 @@ class ExploreAdapter(context: Context, val callBack: CallBack) : }.onSuccess { callBack.refreshData() } - R.id.menu_del -> Coroutine.async(callBack.scope) { - appDb.bookSourceDao.delete(source) - SourceConfig.removeSource(source.bookSourceUrl) - } + R.id.menu_del -> callBack.deleteSource(source) } true } @@ -191,5 +186,6 @@ class ExploreAdapter(context: Context, val callBack: CallBack) : fun openExplore(sourceUrl: String, title: String, exploreUrl: String?) fun editSource(sourceUrl: String) fun toTop(source: BookSource) + fun deleteSource(source: BookSource) } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt index 46b1cd1c1..d9d29b4b0 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt @@ -18,6 +18,7 @@ import io.legado.app.data.appDb import io.legado.app.data.entities.BookSource import io.legado.app.databinding.FragmentExploreBinding import io.legado.app.help.config.AppConfig +import io.legado.app.lib.dialogs.alert import io.legado.app.lib.theme.primaryColor import io.legado.app.lib.theme.primaryTextColor import io.legado.app.ui.book.explore.ExploreShowActivity @@ -183,6 +184,16 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_explo viewModel.topSource(source) } + override fun deleteSource(source: BookSource) { + alert(R.string.draw) { + setMessage(getString(R.string.sure_del) + "\n" + source.bookSourceName) + noButton() + yesButton { + viewModel.deleteSource(source) + } + } + } + fun compressExplore() { if (!adapter.compressExplore()) { if (AppConfig.isEInkMode) { diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreViewModel.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreViewModel.kt index e6a2cc569..34bf44b9b 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreViewModel.kt @@ -4,6 +4,7 @@ import android.app.Application import io.legado.app.base.BaseViewModel import io.legado.app.data.appDb import io.legado.app.data.entities.BookSource +import io.legado.app.help.config.SourceConfig class ExploreViewModel(application: Application) : BaseViewModel(application) { @@ -15,4 +16,11 @@ class ExploreViewModel(application: Application) : BaseViewModel(application) { } } + fun deleteSource(source: BookSource) { + execute { + appDb.bookSourceDao.delete(source) + SourceConfig.removeSource(source.bookSourceUrl) + } + } + } \ No newline at end of file diff --git a/app/src/main/res/layout/item_change_source.xml b/app/src/main/res/layout/item_change_source.xml index 4be15d5b3..672c8545c 100644 --- a/app/src/main/res/layout/item_change_source.xml +++ b/app/src/main/res/layout/item_change_source.xml @@ -14,6 +14,7 @@ android:layout_marginTop="5dp" android:padding="5dp" android:src="@drawable/ic_praise" + android:contentDescription="赞" app:layout_constraintBottom_toTopOf="@+id/iv_bad" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -27,6 +28,7 @@ android:padding="5dp" android:rotationX="180" android:src="@drawable/ic_praise" + android:contentDescription="踩" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toBottomOf="@+id/iv_good" diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index b4e47cd47..d80056edd 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -1016,8 +1016,8 @@ 段评内容(contentRule) 段评回复URL(reviewQuoteUrl) 段评发布时间(postTimeRule) - 点踩URL(voteUpUrl) - 点赞URL(voteDownUrl) + 点踩URL(voteDownUrl) + 点赞URL(voteUpUrl) 发送回复URL(postReviewUrl) 发送回复段评URL(postQuoteUrl) 删除段评URL(deleteUrl) diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index e1cdf5197..86f762a25 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -1019,8 +1019,8 @@ 段评内容(contentRule) 段评发布时间(postTimeRule) 段评回复URL(reviewQuoteUrl) - 点踩URL(voteUpUrl) - 点赞URL(voteDownUrl) + 点踩URL(voteDownUrl) + 点赞URL(voteUpUrl) 发送回复URL(postReviewUrl) 发送回复段评URL(postQuoteUrl) 删除段评URL(deleteUrl) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 6c7f0b320..85dd66c8f 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1019,8 +1019,8 @@ 段评内容(contentRule) 段评发布时间(postTimeRule) 段评回复URL(reviewQuoteUrl) - 点踩URL(voteUpUrl) - 点赞URL(voteDownUrl) + 点踩URL(voteDownUrl) + 点赞URL(voteUpUrl) 发送回复URL(postReviewUrl) 发送回复段评URL(postQuoteUrl) 删除段评URL(deleteUrl) diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 0857f25d7..c3ed8508d 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -1016,8 +1016,8 @@ 段评内容(contentRule) 段评发布时间(postTimeRule) 段评回复URL(reviewQuoteUrl) - 点踩URL(voteUpUrl) - 点赞URL(voteDownUrl) + 点踩URL(voteDownUrl) + 点赞URL(voteUpUrl) 发送回复URL(postReviewUrl) 发送回复段评URL(postQuoteUrl) 删除段评URL(deleteUrl) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index dbc30e0e4..1735d2c71 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1018,8 +1018,8 @@ 段评内容(contentRule) 段评发布时间(postTimeRule) 段评回复URL(reviewQuoteUrl) - 点踩URL(voteUpUrl) - 点赞URL(voteDownUrl) + 点踩URL(voteDownUrl) + 点赞URL(voteUpUrl) 发送回复URL(postReviewUrl) 发送回复段评URL(postQuoteUrl) 删除段评URL(deleteUrl) diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 014b0e727..a8479735a 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1018,8 +1018,8 @@ 段评内容(contentRule) 段评发布时间(postTimeRule) 段评回复URL(reviewQuoteUrl) - 点踩URL(voteUpUrl) - 点赞URL(voteDownUrl) + 点踩URL(voteDownUrl) + 点赞URL(voteUpUrl) 发送回复URL(postReviewUrl) 发送回复段评URL(postQuoteUrl) 删除段评URL(deleteUrl) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b8e307ae6..1774d7326 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1019,8 +1019,8 @@ 段评内容(contentRule) 段评发布时间(postTimeRule) 段评回复URL(reviewQuoteUrl) - 点踩URL(voteUpUrl) - 点赞URL(voteDownUrl) + 点踩URL(voteDownUrl) + 点赞URL(voteUpUrl) 发送回复URL(postReviewUrl) 发送回复段评URL(postQuoteUrl) 删除段评URL(deleteUrl) From 14d1ecc27a5ab534266a6c8c02367b2ded11d0ce Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 09:50:27 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_change_source.xml | 4 ++-- app/src/main/res/values-es-rES/strings.xml | 2 ++ app/src/main/res/values-ja-rJP/strings.xml | 2 ++ app/src/main/res/values-pt-rBR/strings.xml | 2 ++ app/src/main/res/values-zh-rHK/strings.xml | 2 ++ app/src/main/res/values-zh-rTW/strings.xml | 2 ++ app/src/main/res/values-zh/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 8 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/item_change_source.xml b/app/src/main/res/layout/item_change_source.xml index 672c8545c..7605978e8 100644 --- a/app/src/main/res/layout/item_change_source.xml +++ b/app/src/main/res/layout/item_change_source.xml @@ -14,7 +14,7 @@ android:layout_marginTop="5dp" android:padding="5dp" android:src="@drawable/ic_praise" - android:contentDescription="赞" + android:contentDescription="@string/like_source" app:layout_constraintBottom_toTopOf="@+id/iv_bad" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -28,7 +28,7 @@ android:padding="5dp" android:rotationX="180" android:src="@drawable/ic_praise" - android:contentDescription="踩" + android:contentDescription="@string/not_like_source" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toBottomOf="@+id/iv_good" diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index d80056edd..44af359c8 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -1026,4 +1026,6 @@ show read title addition area read bar style follow page Decode Image(imageDecode) + + diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 86f762a25..ada590af6 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -1029,4 +1029,6 @@ show read title addition area read bar style follow page Decode Image(imageDecode) + + diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 85dd66c8f..12d27e110 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1029,4 +1029,6 @@ show read title addition area read bar style follow page Decode Image(imageDecode) + + diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index c3ed8508d..ddd5bef78 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -1026,4 +1026,6 @@ 展示顶部工具栏附加区域 工具栏样式跟随页面 图片解密(imageDecode) + + diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 1735d2c71..0f11cdd39 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1028,4 +1028,6 @@ 展示顶部工具栏附加区域 工具栏样式跟随页面 图片解密(imageDecode) + + diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index a8479735a..9df14a606 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1028,4 +1028,6 @@ 展示顶部工具栏附加区域 工具栏样式跟随页面 图片解密(imageDecode) + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1774d7326..3dba52629 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1029,4 +1029,6 @@ show read title addition area read bar style follow page Decode Image(imageDecode) + + From b50f38b6816958f2712540541e4ca02e7e3be5b0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 10:14:04 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/AppWebDav.kt | 4 +++- app/src/main/java/io/legado/app/help/glide/ImageLoader.kt | 2 +- .../main/java/io/legado/app/ui/about/ReadRecordActivity.kt | 2 +- app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt | 1 - app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt | 3 ++- .../io/legado/app/ui/book/read/page/provider/ImageProvider.kt | 4 +++- .../io/legado/app/ui/book/source/manage/BookSourceActivity.kt | 1 - app/src/main/java/io/legado/app/utils/EncoderUtils.kt | 2 +- app/src/main/java/io/legado/app/utils/StringExtensions.kt | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/AppWebDav.kt b/app/src/main/java/io/legado/app/help/AppWebDav.kt index 3c498c315..2ef0bce5e 100644 --- a/app/src/main/java/io/legado/app/help/AppWebDav.kt +++ b/app/src/main/java/io/legado/app/help/AppWebDav.kt @@ -19,9 +19,11 @@ import io.legado.app.lib.webdav.WebDavException import io.legado.app.lib.webdav.WebDavFile import io.legado.app.ui.widget.dialog.WaitDialog import io.legado.app.utils.* -import kotlinx.coroutines.* import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main +import kotlinx.coroutines.ensureActive +import kotlinx.coroutines.runBlocking +import kotlinx.coroutines.withContext import splitties.init.appCtx import java.io.File import java.text.SimpleDateFormat diff --git a/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt b/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt index 4bfc46d30..e5cc66e35 100644 --- a/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt +++ b/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt @@ -7,8 +7,8 @@ import android.net.Uri import androidx.annotation.DrawableRes import com.bumptech.glide.RequestBuilder import io.legado.app.utils.isAbsUrl -import io.legado.app.utils.isDataUrl import io.legado.app.utils.isContentScheme +import io.legado.app.utils.isDataUrl import java.io.File @Suppress("unused") diff --git a/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt b/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt index 3984fbdda..f551f3d6f 100644 --- a/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt +++ b/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt @@ -1,6 +1,5 @@ package io.legado.app.ui.about -import java.text.SimpleDateFormat import android.content.Context import android.os.Bundle import android.view.Menu @@ -26,6 +25,7 @@ import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import java.text.SimpleDateFormat class ReadRecordActivity : BaseActivity() { diff --git a/app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt index 59e8238ad..33224a3c6 100644 --- a/app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt @@ -15,7 +15,6 @@ import io.legado.app.lib.theme.backgroundColor import io.legado.app.ui.widget.recycler.DragSelectTouchHelper import io.legado.app.ui.widget.recycler.ItemTouchCallback import java.util.* -import kotlin.collections.HashSet class BookAdapter(context: Context, val callBack: CallBack) : RecyclerAdapter(context), diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt index 5a1aab20d..8efb51994 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt @@ -15,7 +15,8 @@ import android.view.animation.Animation import android.widget.FrameLayout import android.widget.SeekBar import androidx.appcompat.widget.PopupMenu -import androidx.core.view.* +import androidx.core.view.isGone +import androidx.core.view.isVisible import io.legado.app.R import io.legado.app.constant.PreferKey import io.legado.app.databinding.ViewReadMenuBinding diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt index 90ec2fa9a..7a778fc29 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt @@ -15,7 +15,9 @@ import io.legado.app.help.config.AppConfig import io.legado.app.help.coroutine.Coroutine import io.legado.app.model.ReadBook import io.legado.app.model.localBook.EpubFile -import io.legado.app.utils.* +import io.legado.app.utils.BitmapUtils +import io.legado.app.utils.FileUtils +import io.legado.app.utils.toastOnUi import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.withContext diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 29a60b2b7..0883ccf65 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -21,7 +21,6 @@ import io.legado.app.data.entities.BookSource import io.legado.app.databinding.ActivityBookSourceBinding import io.legado.app.databinding.DialogEditTextBinding import io.legado.app.help.DirectLinkUpload -import io.legado.app.help.IntentData import io.legado.app.help.config.LocalConfig import io.legado.app.lib.dialogs.alert import io.legado.app.lib.theme.primaryColor diff --git a/app/src/main/java/io/legado/app/utils/EncoderUtils.kt b/app/src/main/java/io/legado/app/utils/EncoderUtils.kt index 208261289..a9adacb30 100644 --- a/app/src/main/java/io/legado/app/utils/EncoderUtils.kt +++ b/app/src/main/java/io/legado/app/utils/EncoderUtils.kt @@ -1,10 +1,10 @@ package io.legado.app.utils import android.util.Base64 +import cn.hutool.crypto.symmetric.SymmetricCrypto import java.security.spec.AlgorithmParameterSpec import javax.crypto.spec.IvParameterSpec import javax.crypto.spec.SecretKeySpec -import cn.hutool.crypto.symmetric.SymmetricCrypto /** * transformations https://developer.android.google.cn/reference/kotlin/javax/crypto/Cipher?hl=en diff --git a/app/src/main/java/io/legado/app/utils/StringExtensions.kt b/app/src/main/java/io/legado/app/utils/StringExtensions.kt index 1ea3f0b39..1228907b5 100644 --- a/app/src/main/java/io/legado/app/utils/StringExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/StringExtensions.kt @@ -2,11 +2,11 @@ package io.legado.app.utils -import io.legado.app.constant.AppPattern.dataUriRegex import android.icu.text.Collator import android.icu.util.ULocale import android.net.Uri import android.text.Editable +import io.legado.app.constant.AppPattern.dataUriRegex import java.io.File import java.util.* From 58f1f81f10ca073005b599f221bb72127a16280d Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 12:24:52 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/layout/activity_book_source_edit.xml | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/app/src/main/res/layout/activity_book_source_edit.xml b/app/src/main/res/layout/activity_book_source_edit.xml index bed6d5a36..27401fb7a 100644 --- a/app/src/main/res/layout/activity_book_source_edit.xml +++ b/app/src/main/res/layout/activity_book_source_edit.xml @@ -13,64 +13,64 @@ app:fitStatusBar="false" app:title="@string/edit_book_source" /> - - - - - - - - - - - - + android:scrollbars="none"> - - - - - + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:gravity="center_vertical" + android:orientation="horizontal"> + + + + + + + + + + + + + + + + Date: Fri, 16 Sep 2022 12:28:36 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_book_source_edit.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/activity_book_source_edit.xml b/app/src/main/res/layout/activity_book_source_edit.xml index 27401fb7a..4b5e041c4 100644 --- a/app/src/main/res/layout/activity_book_source_edit.xml +++ b/app/src/main/res/layout/activity_book_source_edit.xml @@ -119,6 +119,7 @@ + android:layout_height="match_parent" + tools:listitem="@layout/item_source_edit" /> \ No newline at end of file From 0fc45d0963a87625d34c8b07eb4f39332ffc7927 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 12:29:31 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 18e45f5a7..48044fc6e 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -11,6 +11,10 @@ * 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则或简繁转换出现问题。 * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! +**2022/09/16** + +* 一些优化 + **2022/09/15** * 更新cronet: 105.0.5195.136 From 5c0c8272c8efb60f3eb629b7c4e3a5d1d0e325af Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 12:36:42 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_book_source_edit.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/activity_book_source_edit.xml b/app/src/main/res/layout/activity_book_source_edit.xml index 4b5e041c4..49298cca8 100644 --- a/app/src/main/res/layout/activity_book_source_edit.xml +++ b/app/src/main/res/layout/activity_book_source_edit.xml @@ -22,13 +22,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" + android:paddingHorizontal="8dp" android:gravity="center_vertical" android:orientation="horizontal"> From dfbb2022d56192327bcf0fcee49b58fe8d3c9bf8 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Fri, 16 Sep 2022 13:27:11 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/association/BaseAssociationViewModel.kt | 2 +- .../ui/association/OnLineImportViewModel.kt | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/association/BaseAssociationViewModel.kt b/app/src/main/java/io/legado/app/ui/association/BaseAssociationViewModel.kt index d3665bfe7..9e36dd7f6 100644 --- a/app/src/main/java/io/legado/app/ui/association/BaseAssociationViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/association/BaseAssociationViewModel.kt @@ -21,7 +21,7 @@ abstract class BaseAssociationViewModel(application: Application) : BaseViewMode } } - fun importJson(json: String) { + private fun importJson(json: String) { //暂时根据文件内容判断属于什么 when { json.contains("sourceUrl") -> diff --git a/app/src/main/java/io/legado/app/ui/association/OnLineImportViewModel.kt b/app/src/main/java/io/legado/app/ui/association/OnLineImportViewModel.kt index a71af4620..5a8aa2818 100644 --- a/app/src/main/java/io/legado/app/ui/association/OnLineImportViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/association/OnLineImportViewModel.kt @@ -1,12 +1,16 @@ package io.legado.app.ui.association import android.app.Application +import androidx.core.net.toUri import io.legado.app.R import io.legado.app.help.config.ReadBookConfig import io.legado.app.help.http.newCallResponseBody import io.legado.app.help.http.okHttpClient import io.legado.app.help.http.text +import io.legado.app.utils.FileUtils +import io.legado.app.utils.externalFiles import okhttp3.MediaType.Companion.toMediaType +import splitties.init.appCtx class OnLineImportViewModel(app: Application) : BaseAssociationViewModel(app) { @@ -72,8 +76,18 @@ class OnLineImportViewModel(app: Application) : BaseAssociationViewModel(app) { importReadConfig(rs.bytes(), finally) } else -> { - val json = rs.text("utf-8") - importJson(json) + val inputStream = rs.byteStream() + val file = FileUtils.createFileIfNotExist( + appCtx.externalFiles, + "book_cache", + "scheme_import_cache.json" + ) + file.outputStream().use { out -> + inputStream.use { + it.copyTo(out) + } + } + importJson(file.toUri()) } } } From e7041d19df495d0aab845641c1b2596ffd3df411 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Sep 2022 13:49:38 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/association/OnLineImportViewModel.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/association/OnLineImportViewModel.kt b/app/src/main/java/io/legado/app/ui/association/OnLineImportViewModel.kt index 5a8aa2818..ee0591db5 100644 --- a/app/src/main/java/io/legado/app/ui/association/OnLineImportViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/association/OnLineImportViewModel.kt @@ -8,7 +8,7 @@ import io.legado.app.help.http.newCallResponseBody import io.legado.app.help.http.okHttpClient import io.legado.app.help.http.text import io.legado.app.utils.FileUtils -import io.legado.app.utils.externalFiles +import io.legado.app.utils.externalCache import okhttp3.MediaType.Companion.toMediaType import splitties.init.appCtx @@ -78,8 +78,8 @@ class OnLineImportViewModel(app: Application) : BaseAssociationViewModel(app) { else -> { val inputStream = rs.byteStream() val file = FileUtils.createFileIfNotExist( - appCtx.externalFiles, - "book_cache", + appCtx.externalCache, + "download", "scheme_import_cache.json" ) file.outputStream().use { out ->