Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.com.android.application)
alias(libs.plugins.org.jetbrains.kotlin.android)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to remove the Kotlin plugin? Is this best practice? Where is this documented?

alias(libs.plugins.org.jetbrains.kotlin.plugin.compose)
}

Expand All @@ -14,6 +13,9 @@ kotlin {
android {
namespace = "protect.card_locker"
compileSdk = 36
androidResources {
localeFilters.addAll(listOf("ar", "be", "bg", "bn", "bn-rIN", "bs", "cs", "da", "de", "el-rGR", "en", "eo", "es", "es-rAR", "et", "fa", "fi", "fr", "gl", "he-rIL", "hi", "hr", "hu", "in-rID", "is", "it", "ja", "ko", "lt", "lv", "nb-rNO", "nl", "oc", "peo", "pl", "pt", "pt-rBR", "pt-rPT", "ro-rRO", "ru", "sk", "sl", "sr", "sv", "ta", "tr", "uk", "vi", "zh-rCN", "zh-rTW"))
}
Comment on lines +16 to +18
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't merge this as-is, as it also needs changes in the

sed = [
"sed",
"-i",
f"s/resourceConfigurations .*/resourceConfigurations += listOf({res})/",
"app/build.gradle.kts"
]
subprocess.run(sed, check=True)
script managing locale.

Please try to only fix one issue per MR, so that I can merge the things not blocked by other changes :)

I think it may be best to make a MR for just the locale fix, that's a small easy fix I can easily test and merge :)


defaultConfig {
applicationId = "me.hackerchick.catima"
Expand All @@ -25,8 +27,6 @@ android {
vectorDrawables.useSupportLibrary = true
multiDexEnabled = true

resourceConfigurations += listOf("ar", "be", "bg", "bn", "bn-rIN", "bs", "cs", "da", "de", "el-rGR", "en", "eo", "es", "es-rAR", "et", "fa", "fi", "fr", "gl", "he-rIL", "hi", "hr", "hu", "in-rID", "is", "it", "ja", "ko", "lt", "lv", "nb-rNO", "nl", "oc", "peo", "pl", "pt", "pt-rBR", "pt-rPT", "ro-rRO", "ru", "sk", "sl", "sr", "sv", "ta", "tr", "uk", "vi", "zh-rCN", "zh-rTW")

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

buildConfigField("boolean", "showDonate", "true")
Expand All @@ -38,7 +38,7 @@ android {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
getDefaultProguardFile("proguard-android-optimize.txt"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change for?

"proguard-rules.pro"
)
}
Expand Down Expand Up @@ -98,6 +98,7 @@ android {

kotlin {
compilerOptions {
languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change for?

jvmTarget = JvmTarget.JVM_17
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/protect/card_locker/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class MainActivity : CatimaAppCompatActivity(), CardAdapterListener {
intent.data
}
Intent.ACTION_SEND -> {
intent.getParcelableExtra(Intent.EXTRA_STREAM)
@Suppress("DEPRECATION") intent.getParcelableExtra(Intent.EXTRA_STREAM)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't suppress deprecations, I want it to be loud in the logs because it's wrong and needs fixing :)

}
else -> {
Log.e(TAG, "Wrong action type to parse intent")
Expand Down Expand Up @@ -815,7 +815,7 @@ class MainActivity : CatimaAppCompatActivity(), CardAdapterListener {

private fun scaleScreen() {
val displayMetrics = DisplayMetrics()
windowManager.defaultDisplay.getMetrics(displayMetrics)
@Suppress("DEPRECATION") windowManager.defaultDisplay.getMetrics(displayMetrics)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't suppress deprecations, I want it to be loud in the logs because it's wrong and needs fixing :)

val screenHeight = displayMetrics.heightPixels
val mediumSizePx = TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP,
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/protect/card_locker/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -798,13 +798,13 @@ static public <T, U> U mapGetOrDefault(Map<T, U> map, T key, U defaultValue) {
static public Locale stringToLocale(String localeString) {
String[] localeParts = localeString.split("-");
if (localeParts.length == 1) {
return new Locale(localeParts[0]);
return new Locale.Builder().setLanguage(localeParts[0]).build();
}

if (localeParts[1].startsWith("r")) {
localeParts[1] = localeParts[1].substring(1);
}
return new Locale(localeParts[0], localeParts[1]);
return new Locale.Builder().setLanguage(localeParts[0]).setRegion(localeParts[1]).build();
}

static public Context updateBaseContextLocale(Context context) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<string name="importOptionFilesystemExplanation">Выберете файл в файловой системе</string>
<string name="importOptionFilesystemButton">Выбрать файл</string>
<string name="about">О приложении</string>
<string name="app_license">Авторское лево свободного программного обеспечения, лицензия GPLv3+</string>
<string name="app_license">Программное обеспечение, распространяемое по лицензии Copyleft (GPLv3+).</string>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this commit. Language changes through Weblate only please.

<string name="about_title_fmt">О приложении <xliff:g id="app_name">%s</xliff:g></string>
<string name="debug_version_fmt">Версия: <xliff:g id="version">%s</xliff:g></string>
<string name="selectBarcodeTitle">Выбор штрих-кода</string>
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

plugins {
alias(libs.plugins.com.android.application) apply false
alias(libs.plugins.org.jetbrains.kotlin.android) apply false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to remove the Kotlin plugin? Is this best practice? Where is this documented?

}

allprojects {
Expand Down
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
android.defaults.buildfeatures.resvalues=true
android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
android.enableAppCompileTimeRClass=false
android.usesSdkInManifest.disallowed=false
android.uniquePackageNames=false
android.dependency.useConstraints=true
android.r8.strictFullModeForKeepRules=false
android.r8.optimizedResourceShrinking=false
Comment on lines +18 to +25
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all these changes?


3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ junit-junit = { group = "junit", name = "junit", version = "4.13.2" }
org-robolectric-robolectric = { group = "org.robolectric", name = "robolectric", version = "4.16.1" }

[plugins]
com-android-application = { id = "com.android.application", version = "8.13.2" }
org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version = "2.3.10" }
Comment on lines -55 to -56
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to remove the Kotlin plugin? Is this best practice? Where is this documented?

com-android-application = { id = "com.android.application", version = "9.0.1" }
org-jetbrains-kotlin-plugin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version = "2.3.10" }

[bundles]
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ pluginManagement {
mavenCentral()
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
Comment on lines +8 to +10
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this and why is it necessary?

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
Expand Down