File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
app/src/main/java/to/bitkit/ui/utils Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments