-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e89a44
commit 4cfe0eb
Showing
10 changed files
with
81 additions
and
39 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 27 additions & 1 deletion
28
app/src/main/java/uz/boywonder/playstoredemo/MyApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
package uz.boywonder.playstoredemo | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import android.content.res.Configuration | ||
import android.content.res.Resources | ||
import com.akexorcist.localizationactivity.core.LocalizationApplicationDelegate | ||
import dagger.hilt.android.HiltAndroidApp | ||
import java.util.* | ||
|
||
@HiltAndroidApp | ||
class MyApplication : Application() {} | ||
class MyApplication : 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(baseContext, super.getResources()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters