Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of Night theme handling #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ class LocaleHelperAppCompatDelegate(private val superDelegate: AppCompatDelegate
override fun addContentView(v: View?, lp: ViewGroup.LayoutParams?) =
superDelegate.addContentView(v, lp)

override fun attachBaseContext2(context: Context) =
wrap(superDelegate.attachBaseContext2(super.attachBaseContext2(context)))
override fun attachBaseContext2(originalContext: Context): Context {
val superDelegateContext = super.attachBaseContext2(originalContext)
return wrap(superDelegateContext)
}

override fun setTitle(title: CharSequence?) = superDelegate.setTitle(title)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ open class LocaleAwareCompatActivity : AppCompatActivity() {

override fun getDelegate() = localeDelegate.getAppCompatDelegate(super.getDelegate())

override fun attachBaseContext(newBase: Context) {
super.attachBaseContext(localeDelegate.attachBaseContext(newBase))
}

override fun onCreate(savedInstanceState: Bundle?) {
override fun onCreate(savedInstanceState: Bundle?) {
localeDelegate.onCreate(this)
super.onCreate(savedInstanceState)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import java.util.Locale

interface LocaleHelperActivityDelegate {
fun setLocale(activity: Activity, newLocale: Locale)
fun attachBaseContext(newBase: Context): Context
fun onPaused()
fun onResumed(activity: Activity)
fun onCreate(activity: Activity)
Expand Down Expand Up @@ -41,8 +40,6 @@ class LocaleHelperActivityDelegateImpl : LocaleHelperActivityDelegate {
activity.recreate()
}

override fun attachBaseContext(newBase: Context): Context = LocaleHelper.onAttach(newBase)

override fun getApplicationContext(applicationContext: Context): Context = applicationContext

override fun onPaused() {
Expand Down