support Android 13 per-app languages (#2829)
* support Android 13 per-app languages * fix tests * fix language ids in locales_config.xml * fix language setting default in ComposeActivity
This commit is contained in:
parent
9f7cd2fa32
commit
c96a81571c
11 changed files with 165 additions and 89 deletions
|
@ -16,9 +16,6 @@
|
|||
package com.keylesspalace.tusky
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import com.keylesspalace.tusky.util.LocaleManager
|
||||
import de.c1710.filemojicompat_defaults.DefaultEmojiPackList
|
||||
import de.c1710.filemojicompat_ui.helpers.EmojiPackHelper
|
||||
|
||||
|
@ -29,19 +26,4 @@ class TuskyApplication : Application() {
|
|||
super.onCreate()
|
||||
EmojiPackHelper.init(this, DefaultEmojiPackList.get(this))
|
||||
}
|
||||
|
||||
override fun attachBaseContext(base: Context) {
|
||||
localeManager = LocaleManager(base)
|
||||
super.attachBaseContext(localeManager.setLocale(base))
|
||||
}
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
localeManager.setLocale(this)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
lateinit var localeManager: LocaleManager
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue