mirror of
https://github.com/FatttSnake/OxygenToolbox.git
synced 2026-04-05 04:41:26 +08:00
Fixed an issue where the tool could not display multiple languages correctly.
This commit is contained in:
@@ -21,15 +21,12 @@ public class App extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
ResourceUtil.init(App.this);
|
||||
SharedPreferencesUtils.init(App.this);
|
||||
ResourceUtil.setAppLocale(SharedPreferencesUtils.getPreferenceLocale());
|
||||
loadTools();
|
||||
init();
|
||||
|
||||
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle bundle) {
|
||||
init();
|
||||
ResourceUtil.loadAppTheme(activity);
|
||||
loadAppUiMode();
|
||||
}
|
||||
@@ -77,6 +74,13 @@ public class App extends Application {
|
||||
MultiLanguageUtils.attachBaseContext(this);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
ResourceUtil.init(App.this);
|
||||
SharedPreferencesUtils.init(App.this);
|
||||
ResourceUtil.setAppLocale(SharedPreferencesUtils.getPreferenceLocale());
|
||||
loadTools();
|
||||
}
|
||||
|
||||
private void loadAppUiMode() {
|
||||
switch (SharedPreferencesUtils.getPreferenceUiMode()) {
|
||||
case LIGHT -> ResourceUtil.setAppUiMode(ResourceUtil.UI_MODE_LIGHT);
|
||||
|
||||
Reference in New Issue
Block a user