diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt index 069cefe..3ea14a0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/activities/SettingsActivity.kt @@ -5,10 +5,12 @@ import android.os.Bundle import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS import com.simplemobiletools.commons.helpers.NavigationIcon +import com.simplemobiletools.commons.helpers.isTiramisuPlus import com.simplemobiletools.flashlight.R import com.simplemobiletools.flashlight.extensions.config import kotlinx.android.synthetic.main.activity_settings.* import java.util.* +import kotlin.system.exitProcess class SettingsActivity : SimpleActivity() { override fun onCreate(savedInstanceState: Bundle?) { @@ -24,6 +26,7 @@ class SettingsActivity : SimpleActivity() { setupCustomizeColors() setupCustomizeWidgetColors() setupUseEnglish() + setupLanguage() setupTurnFlashlightOn() setupBrightDisplay() setupStroboscope() @@ -70,17 +73,25 @@ class SettingsActivity : SimpleActivity() { } private fun setupUseEnglish() { - settings_use_english_holder.beVisibleIf(config.wasUseEnglishToggled || Locale.getDefault().language != "en") + settings_use_english_holder.beVisibleIf((config.wasUseEnglishToggled || Locale.getDefault().language != "en") && !isTiramisuPlus()) settings_use_english.isChecked = config.useEnglish - - if (settings_use_english_holder.isGone() && settings_purchase_thank_you_holder.isGone()) { - settings_turn_flashlight_on_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) - } - settings_use_english_holder.setOnClickListener { settings_use_english.toggle() config.useEnglish = settings_use_english.isChecked - System.exit(0) + exitProcess(0) + } + } + + private fun setupLanguage() { + settings_language.text = Locale.getDefault().displayLanguage + settings_language_holder.beVisibleIf(isTiramisuPlus()) + + if (settings_use_english_holder.isGone() && settings_language_holder.isGone() && settings_purchase_thank_you_holder.isGone()) { + settings_turn_flashlight_on_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme) + } + + settings_language_holder.setOnClickListener { + launchChangeAppLanguageIntent() } } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 388433f..9405bdf 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1,6 +1,7 @@ @@ -129,6 +130,30 @@ + + + + + + + +