|
@@ -196,32 +196,18 @@ class LanguageActivity : BaseBindingActivity<ActivityLanguageBinding>() {
|
|
}
|
|
}
|
|
|
|
|
|
private fun getSelectedPos(): Int {
|
|
private fun getSelectedPos(): Int {
|
|
- return when (MMkvUtils.getString(CURRENT_LANGUAGE)) {
|
|
|
|
- EN -> {
|
|
|
|
- updateSelectionPos(0)
|
|
|
|
- 0
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- ZH -> {
|
|
|
|
- updateSelectionPos(1)
|
|
|
|
- 1
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- FR -> {
|
|
|
|
- updateSelectionPos(2)
|
|
|
|
- 2
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- JA -> {
|
|
|
|
- updateSelectionPos(3)
|
|
|
|
- 3
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- else -> {
|
|
|
|
- updateSelectionPos(0)
|
|
|
|
- 0
|
|
|
|
|
|
+ val language = MMkvUtils.getString(CURRENT_LANGUAGE)
|
|
|
|
+ for (i in binding.languageRecycle.models?.indices!!) {
|
|
|
|
+ var l = binding.languageRecycle.models!![i] as ConfigUtils.Lang;
|
|
|
|
+ if (language == l.value) {
|
|
|
|
+ selectedPosition = i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(selectedPosition == -1){
|
|
|
|
+ selectedPosition = 0
|
|
|
|
+ }
|
|
|
|
+ return selectedPosition
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Subscribe
|
|
@Subscribe
|