Fix theme selection for android
parent
d88c0f7897
commit
1b6b0156bc
|
|
@ -50,7 +50,13 @@ public class NymeaAppActivity extends QtActivity
|
|||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
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);
|
||||
if (Build.VERSION.SDK_INT >= 35) {
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
698
|
||||
699
|
||||
|
|
|
|||
Loading…
Reference in New Issue