Format fixes. Move lang setting to the first entry (looks better IMO)

This commit is contained in:
len 2016-12-13 21:07:48 +01:00
parent cc9fd53abb
commit 32511149d1
3 changed files with 16 additions and 16 deletions

View file

@ -5,9 +5,10 @@ import eu.kanade.tachiyomi.util.LocaleHelper
abstract class BaseActivity : AppCompatActivity(), ActivityMixin {
override fun getActivity() = this
init {
LocaleHelper.updateCfg(this)
}
override fun getActivity() = this
}

View file

@ -8,11 +8,11 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import uy.kohesive.injekt.injectLazy
import java.util.Locale
object LocaleHelper {
private val preferences: PreferencesHelper by injectLazy()
private var pLocale = Locale(LocaleHelper.intToLangCode(preferences.lang()))
private var pLocale = Locale(intToLangCode(preferences.lang()))
fun setLocale(locale: Locale) {
pLocale = locale
@ -40,8 +40,7 @@ object LocaleHelper {
2 -> "es"
3 -> "it"
4 -> "pt"
// System Language
else -> ""
else -> "" // System Language
}
}

View file

@ -10,6 +10,14 @@
android:title="@string/pref_category_general"
app:asp_tintEnabled="true">
<eu.kanade.tachiyomi.widget.preference.IntListPreference
android:defaultValue="0"
android:entries="@array/languages"
android:entryValues="@array/languages_values"
android:key="@string/pref_language_key"
android:summary="%s"
android:title="@string/pref_language" />
<eu.kanade.tachiyomi.widget.preference.IntListPreference
android:defaultValue="1"
android:entries="@array/themes"
@ -56,14 +64,6 @@
android:key="@string/pref_update_only_non_completed_key"
android:title="@string/pref_update_only_non_completed" />
<eu.kanade.tachiyomi.widget.preference.IntListPreference
android:defaultValue="0"
android:entries="@array/languages"
android:entryValues="@array/languages_values"
android:key="@string/pref_language_key"
android:summary="%s"
android:title="@string/pref_language" />
</PreferenceScreen>
</PreferenceScreen>