Show language flags in AppLanguageScreen
This commit is contained in:
parent
8b50cba75a
commit
ce6bd7cbad
1 changed files with 19 additions and 0 deletions
|
|
@ -3,7 +3,9 @@ package eu.kanade.presentation.more.settings.screen.appearance
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
|
|
@ -19,10 +21,14 @@ import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.os.LocaleListCompat
|
import androidx.core.os.LocaleListCompat
|
||||||
import cafe.adriel.voyager.navigator.LocalNavigator
|
import cafe.adriel.voyager.navigator.LocalNavigator
|
||||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||||
|
import eu.kanade.domain.extension.interactor.GetExtensionLanguages.Companion.getLanguageIconID
|
||||||
import eu.kanade.presentation.components.AppBar
|
import eu.kanade.presentation.components.AppBar
|
||||||
import eu.kanade.presentation.util.Screen
|
import eu.kanade.presentation.util.Screen
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
|
|
@ -79,6 +85,19 @@ class AppLanguageScreen : Screen() {
|
||||||
Text(it)
|
Text(it)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// KMK -->
|
||||||
|
leadingContent = {
|
||||||
|
val iconResId = getLanguageIconID(it.langTag) ?: R.drawable.globe
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(id = iconResId),
|
||||||
|
tint = Color.Unspecified,
|
||||||
|
contentDescription = it.langTag,
|
||||||
|
modifier = Modifier
|
||||||
|
.width(48.dp)
|
||||||
|
.height(32.dp),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
// KMK <--
|
||||||
trailingContent = {
|
trailingContent = {
|
||||||
if (currentLanguage == it.langTag) {
|
if (currentLanguage == it.langTag) {
|
||||||
Icon(
|
Icon(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue