Fix theme selection for android
This commit is contained in:
parent
d88c0f7897
commit
1b6b0156bc
@ -50,7 +50,13 @@ public class NymeaAppActivity extends QtActivity
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
Log.w(TAG, "Create activity");
|
Log.w(TAG, "Create activity");
|
||||||
setTheme(R.style.NormalTheme);
|
int themeId = resolveStyleResource("NormalTheme");
|
||||||
|
if (themeId != 0) {
|
||||||
|
setTheme(themeId);
|
||||||
|
} else {
|
||||||
|
Log.w(TAG, "NormalTheme style missing, falling back to system theme");
|
||||||
|
setTheme(android.R.style.Theme_DeviceDefault_DayNight);
|
||||||
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
if (Build.VERSION.SDK_INT >= 35) {
|
if (Build.VERSION.SDK_INT >= 35) {
|
||||||
// Let the system handle insets to avoid double padding in Qt content.
|
// Let the system handle insets to avoid double padding in Qt content.
|
||||||
@ -259,4 +265,9 @@ public class NymeaAppActivity extends QtActivity
|
|||||||
Log.e(TAG, "Failed to inspect android.app.static_init_classes meta-data", exception);
|
Log.e(TAG, "Failed to inspect android.app.static_init_classes meta-data", exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int resolveStyleResource(String resourceName) {
|
||||||
|
// Resolve app resources dynamically to support branded package names.
|
||||||
|
return getResources().getIdentifier(resourceName, "style", getPackageName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
1.11.2
|
1.11.2
|
||||||
698
|
699
|
||||||
|
|||||||
Reference in New Issue
Block a user