Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Commit

Permalink
Fix incorrect application delegation example in readme (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
akexorcist committed Apr 12, 2021
1 parent b7bf2f3 commit 37ee233
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,24 @@ Either not, using `LocalizationApplicationDelegate` with additional code as belo
```kotlin
class MainApplication: Application() {
private val localizationDelegate = LocalizationApplicationDelegate()

override fun attachBaseContext(base: Context) {
localizationDelegate.setDefaultLanguage(base, Locale.ENGLISH)
super.attachBaseContext(localizationDelegate.attachBaseContext(base))
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
localizationDelegate.onConfigurationChanged(this)
}

override fun getApplicationContext(): Context {
return localizationDelegate.getApplicationContext(super.getApplicationContext())
}

override fun getResources(): Resources {
return localizationDelegate.getResources(this)
}
}
```

Expand Down

0 comments on commit 37ee233

Please sign in to comment.