From a5ee00e4ccede8611e516e4523f9e9c38f5b437d Mon Sep 17 00:00:00 2001 From: wingio Date: Fri, 7 Apr 2023 13:08:54 -0400 Subject: [PATCH] i18n: Support per app language settings --- app/build.gradle.kts | 4 +-- app/src/main/AndroidManifest.xml | 1 + .../manager/ui/components/SegmentedButton.kt | 7 +++- app/src/main/res/xml/locales_config.xml | 33 +++++++++++++++++++ build.gradle.kts | 4 +-- 5 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 app/src/main/res/xml/locales_config.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8febc61..22b7887 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -14,8 +14,8 @@ android { applicationId = "dev.beefers.vendetta.manager" minSdk = 24 targetSdk = 33 - versionCode = 1070 - versionName = "1.0.7" + versionCode = 1071 + versionName = "1.0.71" buildConfigField("String", "GIT_BRANCH", "\"${getCurrentBranch()}\"") buildConfigField("String", "GIT_COMMIT", "\"${getLatestCommit()}\"") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bee16a0..7f8db63 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,6 +28,7 @@ android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" + android:localeConfig="@xml/locales_config" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:roundIcon="@drawable/ic_launcher" diff --git a/app/src/main/java/dev/beefers/vendetta/manager/ui/components/SegmentedButton.kt b/app/src/main/java/dev/beefers/vendetta/manager/ui/components/SegmentedButton.kt index 388479d..2f22fd6 100644 --- a/app/src/main/java/dev/beefers/vendetta/manager/ui/components/SegmentedButton.kt +++ b/app/src/main/java/dev/beefers/vendetta/manager/ui/components/SegmentedButton.kt @@ -1,6 +1,8 @@ package dev.beefers.vendetta.manager.ui.components +import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background +import androidx.compose.foundation.basicMarquee import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -17,6 +19,7 @@ import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.unit.dp +@OptIn(ExperimentalFoundationApi::class) @Composable fun RowScope.SegmentedButton( icon: Any, @@ -54,7 +57,9 @@ fun RowScope.SegmentedButton( Text( text = text, style = MaterialTheme.typography.labelLarge, - color = MaterialTheme.colorScheme.primary + color = MaterialTheme.colorScheme.primary, + maxLines = 1, + modifier = Modifier.basicMarquee() ) } } \ No newline at end of file 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 0000000..26d15b5 --- /dev/null +++ b/app/src/main/res/xml/locales_config.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 0efeeda..97a76cc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.1.0-alpha02" apply false - id("com.android.library") version "8.1.0-alpha02" apply false + id("com.android.application") version "8.1.0-alpha11" apply false + id("com.android.library") version "8.1.0-alpha11" apply false kotlin("android") version "1.7.20" apply false }