diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/SettingsFragment.kt b/app-common/src/main/java/im/angry/openeuicc/ui/SettingsFragment.kt index d2ae9d6..f10f134 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/SettingsFragment.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/SettingsFragment.kt @@ -2,7 +2,9 @@ package im.angry.openeuicc.ui import android.content.Intent import android.net.Uri +import android.os.Build import android.os.Bundle +import android.provider.Settings import android.widget.Toast import androidx.datastore.preferences.core.Preferences import androidx.lifecycle.lifecycleScope @@ -49,6 +51,14 @@ class SettingsFragment: PreferenceFragmentCompat() { intent = Intent(Intent.ACTION_VIEW, Uri.parse(summary.toString())) } + findPreference("pref_language")?.apply { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) return@apply + isVisible = true + intent = Intent(Settings.ACTION_APP_LOCALE_SETTINGS).apply { + data = Uri.fromParts("package", requireContext().packageName, null) + } + } + findPreference("pref_advanced_logs")?.apply { intent = Intent(requireContext(), LogsActivity::class.java) } diff --git a/app-common/src/main/res/values/strings.xml b/app-common/src/main/res/values/strings.xml index 73b1938..174b18c 100644 --- a/app-common/src/main/res/values/strings.xml +++ b/app-common/src/main/res/values/strings.xml @@ -146,6 +146,8 @@ By default, this app prevents you from disabling the active profile on a removable eSIM inserted in the device, because doing so may sometimes render it inaccessible.\nCheck this box to remove this safeguard. Verbose Logging Enable verbose logs, which may contain sensitive information. Only share your logs with someone you trust after turning this on. + Language + Select current language Logs View recent debug logs of the application Developer Options diff --git a/app-common/src/main/res/xml/locale_config.xml b/app-common/src/main/res/xml/locale_config.xml new file mode 100644 index 0000000..dd9d189 --- /dev/null +++ b/app-common/src/main/res/xml/locale_config.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app-common/src/main/res/xml/pref_settings.xml b/app-common/src/main/res/xml/pref_settings.xml index 60646bc..107e0b4 100644 --- a/app-common/src/main/res/xml/pref_settings.xml +++ b/app-common/src/main/res/xml/pref_settings.xml @@ -36,6 +36,13 @@ app:title="@string/pref_advanced_verbose_logging" app:summary="@string/pref_advanced_verbose_logging_desc" /> + + - + + android:localeConfig="@xml/locale_config" + android:theme="@style/Theme.OpenEUICC" + tools:targetApi="tiramisu"> + + + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cd30620..cae19d3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -5,7 +5,8 @@ package="im.angry.openeuicc"> + android:required="true" + tools:ignore="UnnecessaryRequiredFeature" /> @@ -19,7 +20,9 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.OpenEUICC"> + android:localeConfig="@xml/locale_config" + android:theme="@style/Theme.OpenEUICC" + tools:targetApi="tiramisu"> @@ -49,6 +52,15 @@ + + + +