From 030cc80c71a737a8938dd98f65e8529203b395e0 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Sat, 14 Jan 2023 15:26:38 +0530 Subject: [PATCH] Simplify some expressions. --- app/src/main/java/com/github/libretube/util/LocaleHelper.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/libretube/util/LocaleHelper.kt b/app/src/main/java/com/github/libretube/util/LocaleHelper.kt index 9c1f5c769..6ad980f08 100644 --- a/app/src/main/java/com/github/libretube/util/LocaleHelper.kt +++ b/app/src/main/java/com/github/libretube/util/LocaleHelper.kt @@ -17,7 +17,7 @@ object LocaleHelper { val languageName = PreferenceHelper.getString(PreferenceKeys.LANGUAGE, "sys") val locale = when { languageName == "sys" -> Locale.getDefault() - languageName.contains("-") == true -> { + languageName.contains("-") -> { val languageParts = languageName.split("-") Locale( languageParts[0], @@ -41,9 +41,9 @@ object LocaleHelper { private fun updateResourcesLegacy(context: Context, locale: Locale) { Locale.setDefault(locale) val resources: Resources = context.resources - val configuration: Configuration = resources.getConfiguration() + val configuration = resources.configuration configuration.locale = locale - resources.updateConfiguration(configuration, resources.getDisplayMetrics()) + resources.updateConfiguration(configuration, resources.displayMetrics) } private fun getDetectedCountry(context: Context): String {