Skip to content

Commit b490255

Browse files
committed
chore: lint
1 parent 44f3c38 commit b490255

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/to/bitkit/ui/utils/AppLocaleManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class AppLocaleManager @Inject constructor(
4444
fun getCurrentLanguage(): Language {
4545
val locale = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
4646
val localeList = context.getSystemService(LocaleManager::class.java)?.applicationLocales
47-
if (localeList != null && !localeList.isEmpty) localeList.get(0) else null
47+
localeList?.get(0).takeIf { localeList != null && !localeList.isEmpty }
4848
} else {
4949
val localeListCompat = AppCompatDelegate.getApplicationLocales()
50-
if (!localeListCompat.isEmpty) localeListCompat.get(0) else null
50+
localeListCompat.get(0).takeIf { !localeListCompat.isEmpty }
5151
}
5252

5353
return locale?.toLanguage() ?: Language.SYSTEM_DEFAULT

0 commit comments

Comments
 (0)