~repos /only-bible-app
git clone https://pyrossh.dev/repos/only-bible-app.git
The only bible app you will ever need. No ads. No in-app purchases. No distractions.
1afeb014
—
Peter John 1 year ago
sort locales
app/src/main/java/dev/pyrossh/onlyBible/AppDrawer.kt
CHANGED
|
@@ -13,6 +13,7 @@ import androidx.compose.foundation.lazy.grid.GridItemSpan
|
|
|
13
13
|
import androidx.compose.foundation.lazy.grid.LazyGridItemScope
|
|
14
14
|
import androidx.compose.foundation.lazy.grid.LazyGridScope
|
|
15
15
|
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
|
16
|
+
import androidx.compose.foundation.lazy.grid.items
|
|
16
17
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
17
18
|
import androidx.compose.material.icons.Icons
|
|
18
19
|
import androidx.compose.material.icons.filled.Close
|
|
@@ -100,7 +101,10 @@ fun AppDrawer(
|
|
|
100
101
|
.padding(bottom = 16.dp),
|
|
101
102
|
) {
|
|
102
103
|
if (menuType == MenuType.Bible) {
|
|
103
|
-
val
|
|
104
|
+
val localeList = LocaleConfig(context).supportedLocales!!
|
|
105
|
+
val locales = arrayOfNulls<String>(localeList.size())
|
|
106
|
+
.mapIndexed { i, _ -> localeList[i] }
|
|
107
|
+
.sortedBy { it.getDisplayName(Locale.ENGLISH) }
|
|
104
108
|
LazyVerticalGrid(
|
|
105
109
|
modifier = Modifier.fillMaxSize(),
|
|
106
110
|
verticalArrangement = Arrangement.spacedBy(10.dp),
|
|
@@ -127,14 +131,13 @@ fun AppDrawer(
|
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
|
-
items(locales
|
|
134
|
+
items(locales) { loc ->
|
|
131
|
-
val loc = locales[it]
|
|
132
135
|
QuickButton(
|
|
133
|
-
title =
|
|
136
|
+
title = loc.getDisplayName(Locale.ENGLISH),
|
|
134
137
|
subtitle = if (loc.language == "en")
|
|
135
138
|
"KJV"
|
|
136
139
|
else
|
|
137
|
-
|
|
140
|
+
loc.getDisplayName(loc),
|
|
138
141
|
) {
|
|
139
142
|
scope.launch {
|
|
140
143
|
drawerState.close()
|