From a3cc5726ee53c5e184208155a2e11006ecba3c72 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Thu, 8 May 2025 19:35:45 +0300 Subject: [PATCH 1/8] Update parsers --- app/build.gradle | 4 ++-- gradle/libs.versions.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9e6361cda..99d871364 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,8 +19,8 @@ android { applicationId 'org.koitharu.kotatsu' minSdk = 21 targetSdk = 35 - versionCode = 1010 - versionName = '8.1.4' + versionCode = 1011 + versionName = '8.1.5' generatedDensities = [] testInstrumentationRunner 'org.koitharu.kotatsu.HiltTestRunner' ksp { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ec0ea14cf..e6c48e4ba 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,7 +31,7 @@ material = "1.13.0-alpha12" moshi = "1.15.2" okhttp = "4.12.0" okio = "3.11.0" -parsers = "b165a0d611" +parsers = "cf0177364c" preference = "1.2.1" recyclerview = "1.4.0" room = "2.6.1" From c1e84715fb03aecfc47fb74b59787cec022422fd Mon Sep 17 00:00:00 2001 From: kadirkid Date: Wed, 7 May 2025 22:51:10 +0400 Subject: [PATCH 2/8] Switch per language support to manual The current automatic support setup has a bug where the app language will change for users with Android 15 when there is a configuration change like rotating a screen. It seems that that using generateLocaleConfig on AGP 8.8+ triggers a bug in Android 15 (android:defaultLocale) which causes this issue (cherry picked from commit 104d8da655f8abfd88433716bfea2d16db4a8337) --- app/build.gradle | 66 ++++++++++++++++++++++++- app/src/main/res/resources.properties | 1 - app/src/main/res/xml/locales_config.xml | 59 ++++++++++++++++++++++ 3 files changed, 124 insertions(+), 2 deletions(-) delete mode 100644 app/src/main/res/resources.properties create mode 100644 app/src/main/res/xml/locales_config.xml diff --git a/app/build.gradle b/app/build.gradle index 99d871364..aca700192 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,8 +27,72 @@ android { arg('room.generateKotlin', 'true') } androidResources { - generateLocaleConfig true + generateLocaleConfig false } + resourceConfigurations += [ + "en", + "ab", + "ar", + "arq", + "as", + "be", + "bn", + "ca", + "cs", + "de", + "el", + "en-rGB", + "enm", + "es", + "et", + "eu", + "fa", + "fi", + "fil", + "fr", + "frp", + "gu", + "hi", + "hr", + "hu", + "in", + "it", + "iw", + "ja", + "kk", + "km", + "ko", + "lt", + "lv", + "lzh", + "ml", + "ms", + "my", + "nb-rNO", + "ne", + "nn", + "or", + "pa", + "pa-rPK", + "pl", + "pt", + "pt-rBR", + "ro", + "ru", + "si", + "sr", + "sv", + "ta", + "th", + "tr", + "uk", + "vi", + "zh-rCN", + "zh-rTW", + // Specific BCP 47 locales + "b+zh+Hans+MO", + "b+zh+Hant+MO" + ] } buildTypes { debug { diff --git a/app/src/main/res/resources.properties b/app/src/main/res/resources.properties deleted file mode 100644 index 467b3efec..000000000 --- a/app/src/main/res/resources.properties +++ /dev/null @@ -1 +0,0 @@ -unqualifiedResLocale=en-US diff --git a/app/src/main/res/xml/locales_config.xml b/app/src/main/res/xml/locales_config.xml new file mode 100644 index 000000000..b26cc38d0 --- /dev/null +++ b/app/src/main/res/xml/locales_config.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7cf7a6288121fa7619c8d71355976af780ec5d97 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Sat, 3 May 2025 09:16:23 +0300 Subject: [PATCH 3/8] Update details info card color (cherry picked from commit 8d325aea0ae4775a619686f08b3e20649775551f) --- app/src/main/res/layout/layout_details_table.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/layout_details_table.xml b/app/src/main/res/layout/layout_details_table.xml index c3e25ba0b..a74baa115 100644 --- a/app/src/main/res/layout/layout_details_table.xml +++ b/app/src/main/res/layout/layout_details_table.xml @@ -12,7 +12,6 @@ android:layout_height="0dp" android:layout_marginHorizontal="@dimen/screen_padding" android:layout_marginBottom="-12dp" - app:cardBackgroundColor="?colorBackgroundFloating" app:layout_constraintBottom_toBottomOf="@id/textView_progress_label" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -230,7 +229,7 @@ Date: Thu, 8 May 2025 20:46:58 +0300 Subject: [PATCH 4/8] Fix per-app locale selection --- app/build.gradle | 4 +- app/src/main/AndroidManifest.xml | 1 + .../koitharu/kotatsu/core/util/ext/Android.kt | 6 +- app/src/main/res/xml/locales_config.xml | 117 +++++++++--------- 4 files changed, 65 insertions(+), 63 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index aca700192..24ffc5a65 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,8 +19,8 @@ android { applicationId 'org.koitharu.kotatsu' minSdk = 21 targetSdk = 35 - versionCode = 1011 - versionName = '8.1.5' + versionCode = 1012 + versionName = '8.1.6' generatedDensities = [] testInstrumentationRunner 'org.koitharu.kotatsu.HiltTestRunner' ksp { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 840fb88d3..e2a343fd5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -52,6 +52,7 @@ android:hasFragileUserData="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" + android:localeConfig="@xml/locales_config" android:largeHeap="true" android:networkSecurityConfig="@xml/network_security_config" android:requestLegacyExternalStorage="true" diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Android.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Android.kt index 9f301b28f..cfd5c5967 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Android.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Android.kt @@ -1,7 +1,6 @@ package org.koitharu.kotatsu.core.util.ext import android.Manifest -import android.annotation.SuppressLint import android.app.Activity import android.app.ActivityManager import android.app.ActivityManager.MemoryInfo @@ -53,6 +52,7 @@ import okio.use import org.json.JSONException import org.jsoup.internal.StringUtil.StringJoiner import org.koitharu.kotatsu.BuildConfig +import org.koitharu.kotatsu.R import org.koitharu.kotatsu.main.ui.MainActivity import org.koitharu.kotatsu.parsers.util.runCatchingCancellable import org.xmlpull.v1.XmlPullParser @@ -140,7 +140,6 @@ val Context.ramAvailable: Long return result.availMem } -@SuppressLint("DiscouragedApi") fun Context.getLocalesConfig(): LocaleListCompat { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { LocaleConfig(this).supportedLocales?.let { @@ -149,8 +148,7 @@ fun Context.getLocalesConfig(): LocaleListCompat { } val tagsList = StringJoiner(",") try { - val resId = resources.getIdentifier("_generated_res_locale_config", "xml", packageName) - val xpp: XmlPullParser = resources.getXml(resId) + val xpp: XmlPullParser = resources.getXml(R.xml.locales_config) while (xpp.eventType != XmlPullParser.END_DOCUMENT) { if (xpp.eventType == XmlPullParser.START_TAG) { if (xpp.name == "locale") { diff --git a/app/src/main/res/xml/locales_config.xml b/app/src/main/res/xml/locales_config.xml index b26cc38d0..90a9c202b 100644 --- a/app/src/main/res/xml/locales_config.xml +++ b/app/src/main/res/xml/locales_config.xml @@ -1,59 +1,62 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1576c9cdde00512f309b8cd9c44fe59fe33bf12d Mon Sep 17 00:00:00 2001 From: Koitharu Date: Thu, 15 May 2025 19:37:46 +0300 Subject: [PATCH 5/8] Fix search menu item duplication (cherry picked from commit a4b9acd622c46da9826a734e262fbe734b119cf1) --- .../kotlin/org/koitharu/kotatsu/main/ui/MainActivity.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/main/ui/MainActivity.kt b/app/src/main/kotlin/org/koitharu/kotatsu/main/ui/MainActivity.kt index 17ba0f9f6..3f94c1009 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/main/ui/MainActivity.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/main/ui/MainActivity.kt @@ -15,6 +15,7 @@ import androidx.appcompat.view.ActionMode import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import androidx.core.net.toUri +import androidx.core.view.MenuProvider import androidx.core.view.SoftwareKeyboardControllerCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.children @@ -27,6 +28,7 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentTransaction import androidx.fragment.app.commit import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.lifecycleScope import androidx.lifecycle.withResumed import androidx.transition.TransitionManager @@ -66,6 +68,7 @@ import org.koitharu.kotatsu.main.ui.owners.BottomNavOwner import org.koitharu.kotatsu.parsers.model.Manga import org.koitharu.kotatsu.parsers.model.MangaSource import org.koitharu.kotatsu.parsers.model.MangaTag +import org.koitharu.kotatsu.remotelist.ui.MangaSearchMenuProvider import org.koitharu.kotatsu.search.domain.SearchKind import org.koitharu.kotatsu.search.ui.suggestion.SearchSuggestionFragment import org.koitharu.kotatsu.search.ui.suggestion.SearchSuggestionListener @@ -159,6 +162,12 @@ class MainActivity : BaseActivity(), AppBarOwner, BottomNav } } + override fun addMenuProvider(provider: MenuProvider, owner: LifecycleOwner, state: Lifecycle.State) { + if (provider !is MangaSearchMenuProvider) { // do not duplicate search menu item + super.addMenuProvider(provider, owner, state) + } + } + override fun onCreateOptionsMenu(menu: Menu?): Boolean { super.onCreateOptionsMenu(menu) menuInflater.inflate(R.menu.opt_main, menu) From 8971c7a6a2ca5f8d460c88f3789b0e6ca2a40869 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Thu, 15 May 2025 17:45:21 +0300 Subject: [PATCH 6/8] Fix color filte activity strings (cherry picked from commit 8f8abcc3f6029fffe25136291d20e20ba8812cc6) --- app/src/main/res/layout-w600dp-land/activity_color_filter.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout-w600dp-land/activity_color_filter.xml b/app/src/main/res/layout-w600dp-land/activity_color_filter.xml index 88bbbdb14..e19fa1579 100644 --- a/app/src/main/res/layout-w600dp-land/activity_color_filter.xml +++ b/app/src/main/res/layout-w600dp-land/activity_color_filter.xml @@ -133,7 +133,7 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/margin_normal" android:layout_marginTop="4dp" - android:text="@string/invert_colors" + android:text="@string/grayscale" android:textAppearance="?textAppearanceTitleMedium" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/guideline_vertical" From cbf707b403a9a6e60bdde51cf6a1197a70a60d08 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Mon, 12 May 2025 18:53:36 +0300 Subject: [PATCH 7/8] Fix locales config (cherry picked from commit 61c068d4ee7178b43fd4b2d355da3d67a196933d) --- app/build.gradle | 65 +------------------------ app/src/main/res/xml/locales_config.xml | 11 +---- 2 files changed, 2 insertions(+), 74 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 24ffc5a65..d2147afb7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,72 +27,9 @@ android { arg('room.generateKotlin', 'true') } androidResources { + // https://issuetracker.google.com/issues/408030127 generateLocaleConfig false } - resourceConfigurations += [ - "en", - "ab", - "ar", - "arq", - "as", - "be", - "bn", - "ca", - "cs", - "de", - "el", - "en-rGB", - "enm", - "es", - "et", - "eu", - "fa", - "fi", - "fil", - "fr", - "frp", - "gu", - "hi", - "hr", - "hu", - "in", - "it", - "iw", - "ja", - "kk", - "km", - "ko", - "lt", - "lv", - "lzh", - "ml", - "ms", - "my", - "nb-rNO", - "ne", - "nn", - "or", - "pa", - "pa-rPK", - "pl", - "pt", - "pt-rBR", - "ro", - "ru", - "si", - "sr", - "sv", - "ta", - "th", - "tr", - "uk", - "vi", - "zh-rCN", - "zh-rTW", - // Specific BCP 47 locales - "b+zh+Hans+MO", - "b+zh+Hant+MO" - ] } buildTypes { debug { diff --git a/app/src/main/res/xml/locales_config.xml b/app/src/main/res/xml/locales_config.xml index 90a9c202b..5136e3c01 100644 --- a/app/src/main/res/xml/locales_config.xml +++ b/app/src/main/res/xml/locales_config.xml @@ -1,10 +1,7 @@ - - - @@ -12,21 +9,17 @@ - - - - - + @@ -34,10 +27,8 @@ - - From ab2235d0ca52045d817f022b38167a0f57bedf4f Mon Sep 17 00:00:00 2001 From: Koitharu Date: Sun, 18 May 2025 14:40:45 +0300 Subject: [PATCH 8/8] Update parsers --- app/build.gradle | 4 ++-- gradle/libs.versions.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d2147afb7..fcec9b620 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,8 +19,8 @@ android { applicationId 'org.koitharu.kotatsu' minSdk = 21 targetSdk = 35 - versionCode = 1012 - versionName = '8.1.6' + versionCode = 1013 + versionName = '8.1.7' generatedDensities = [] testInstrumentationRunner 'org.koitharu.kotatsu.HiltTestRunner' ksp { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e6c48e4ba..880803c9a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,7 +31,7 @@ material = "1.13.0-alpha12" moshi = "1.15.2" okhttp = "4.12.0" okio = "3.11.0" -parsers = "cf0177364c" +parsers = "276349e23c" preference = "1.2.1" recyclerview = "1.4.0" room = "2.6.1"