You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
automatically enable UI_MODE_NIGHT when gtk-theme-name contains "dark"
gtk-theme-name is only checked once at start up
This commit is contained in:
@@ -63,7 +63,6 @@ public class Context extends Object {
|
||||
|
||||
static AssetManager assets;
|
||||
static DisplayMetrics dm;
|
||||
static Configuration config;
|
||||
static Resources r;
|
||||
static ApplicationInfo application_info;
|
||||
static Resources.Theme theme;
|
||||
@@ -82,7 +81,8 @@ public class Context extends Object {
|
||||
static {
|
||||
assets = new AssetManager();
|
||||
dm = new DisplayMetrics();
|
||||
config = new Configuration();
|
||||
Configuration config = new Configuration();
|
||||
native_updateConfig(config);
|
||||
r = new Resources(assets, dm, config);
|
||||
theme = r.newTheme();
|
||||
application_info = new ApplicationInfo();
|
||||
@@ -97,6 +97,8 @@ public class Context extends Object {
|
||||
}
|
||||
}
|
||||
|
||||
protected static native void native_updateConfig(Configuration config);
|
||||
|
||||
static Application createApplication(long native_window) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException {
|
||||
Application application;
|
||||
ResXmlAttribute application_name = manifest.getApplicationElement().searchAttributeByResourceId(AndroidManifestBlock.ID_name);
|
||||
|
||||
@@ -701,11 +701,11 @@ public final class AssetManager {
|
||||
* applications.
|
||||
* {@hide}
|
||||
*/
|
||||
public /*native*/ final void setConfiguration(int mcc, int mnc, String locale,
|
||||
public native final void setConfiguration(int mcc, int mnc, String locale,
|
||||
int orientation, int touchscreen, int density, int keyboard,
|
||||
int keyboardHidden, int navigation, int screenWidth, int screenHeight,
|
||||
int smallestScreenWidthDp, int screenWidthDp, int screenHeightDp,
|
||||
int screenLayout, int uiMode, int majorVersion) {}
|
||||
int screenLayout, int uiMode, int majorVersion);
|
||||
|
||||
/**
|
||||
* Retrieve the resource identifier for the given resource name.
|
||||
|
||||
@@ -208,7 +208,7 @@ public class Resources {
|
||||
mCompatibilityInfo = compatInfo;
|
||||
}
|
||||
mToken = new WeakReference<IBinder>(token);
|
||||
// updateConfiguration(config, metrics);
|
||||
updateConfiguration(config, metrics);
|
||||
// assets.ensureStringBlocks();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user