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

Update README.md #101

Merged
merged 1 commit into from
Apr 8, 2021
Merged
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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ class MainActivity: LocalizationActivity() {
Or using `LocalizationActivityDelegate` with additional code
```kotlin
open class CustomActivity : Activity(), OnLocaleChangedListener {
private val localizationDelegate = LocalizationActivityDelegate(this)

private val localizationDelegate by lazy {
LocalizationActivityDelegate(this)
}

public override fun onCreate(savedInstanceState: Bundle?) {
localizationDelegate.addOnLocaleChangedListener(this)
localizationDelegate.onCreate()
Expand Down Expand Up @@ -115,7 +117,9 @@ open class CustomActivity : Activity(), OnLocaleChangedListener {
localizationDelegate.setLanguage(this, locale!!)
}

val getCurrentLanguage: Locale = localizationDelegate.getLanguage(this)
val getCurrentLanguage: Locale by lazy {
localizationDelegate.getLanguage(this)
}

// Just override method locale change event
override fun onBeforeLocaleChanged() {}
Expand Down