diff --git a/apps/android/app/build.gradle b/apps/android/app/build.gradle index 1b81bf7d5b..8c8e7fac90 100644 --- a/apps/android/app/build.gradle +++ b/apps/android/app/build.gradle @@ -5,12 +5,12 @@ plugins { } android { - compileSdk 33 + compileSdk 32 defaultConfig { applicationId "chat.simplex.app" minSdk 29 - targetSdk 33 + targetSdk 32 versionCode 104 versionName "4.6-beta.0" diff --git a/apps/android/app/src/main/AndroidManifest.xml b/apps/android/app/src/main/AndroidManifest.xml index 3476fe6051..6d090e381e 100644 --- a/apps/android/app/src/main/AndroidManifest.xml +++ b/apps/android/app/src/main/AndroidManifest.xml @@ -30,8 +30,8 @@ android:label="${app_name}" android:extractNativeLibs="${extract_native_libs}" android:supportsRtl="true" - android:localeConfig="@xml/locales_config" android:theme="@style/Theme.SimpleX"> + serializableSaver(): Saver = Saver( ) fun saveAppLocale(pref: SharedPreference, activity: Activity, languageCode: String? = null) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - val localeManager = SimplexApp.context.getSystemService(LocaleManager::class.java) - localeManager.applicationLocales = LocaleList(Locale.forLanguageTag(languageCode ?: return)) - } else { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { +// val localeManager = SimplexApp.context.getSystemService(LocaleManager::class.java) +// localeManager.applicationLocales = LocaleList(Locale.forLanguageTag(languageCode ?: return)) +// } else { pref.set(languageCode) if (languageCode == null) { activity.applyLocale(SimplexApp.context.defaultLocale) } activity.recreate() - } +// } } fun Activity.applyAppLocale(pref: SharedPreference) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { +// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { val lang = pref.get() if (lang == null || lang == Locale.getDefault().language) return applyLocale(Locale.forLanguageTag(lang)) - } +// } } private fun Activity.applyLocale(locale: Locale) { diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/Appearance.kt b/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/Appearance.kt index 2ff6c498b6..827d5e8836 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/Appearance.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/Appearance.kt @@ -97,14 +97,14 @@ fun AppearanceView(m: ChatModel) { AppBarTitle(stringResource(R.string.appearance_settings)) SectionView(stringResource(R.string.settings_section_title_language), padding = PaddingValues()) { val context = LocalContext.current - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - SectionItemWithValue( - generalGetString(R.string.settings_section_title_language).lowercase().replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.US) else it.toString() }, - remember { mutableStateOf("system") }, - listOf(ValueTitleDesc("system", generalGetString(R.string.change_verb), "")), - onSelected = { openSystemLangPicker(context as? Activity ?: return@SectionItemWithValue) } - ) - } else { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { +// SectionItemWithValue( +// generalGetString(R.string.settings_section_title_language).lowercase().replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.US) else it.toString() }, +// remember { mutableStateOf("system") }, +// listOf(ValueTitleDesc("system", generalGetString(R.string.change_verb), "")), +// onSelected = { openSystemLangPicker(context as? Activity ?: return@SectionItemWithValue) } +// ) +// } else { val state = rememberSaveable { mutableStateOf(languagePref.get() ?: "system") } SectionItemView { LangSelector(state) { @@ -122,7 +122,7 @@ fun AppearanceView(m: ChatModel) { } } } - } +// } } SectionSpacer() @@ -264,9 +264,9 @@ private fun ThemeSelector(state: State, onSelected: (DefaultTheme) ) } -private fun openSystemLangPicker(activity: Activity) { - activity.startActivity(Intent(Settings.ACTION_APP_LOCALE_SETTINGS, Uri.parse("package:" + SimplexApp.context.packageName))) -} +//private fun openSystemLangPicker(activity: Activity) { +// activity.startActivity(Intent(Settings.ACTION_APP_LOCALE_SETTINGS, Uri.parse("package:" + SimplexApp.context.packageName))) +//} private fun findEnabledIcon(): AppIcon = AppIcon.values().first { icon -> SimplexApp.context.packageManager.getComponentEnabledSetting(