1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Android: Fix bug where system bars could incorrectly become opaque after adding/removing desktop components

This bug could be observed in the DemoRunner:
- Enable "button" navigation mode (as opposed to "gesture" mode) on the
  Android device.
- Remove the line enabling kiosk mode, build and install the DemoRunner.
- Run the app and navigate to the Settings pane. Open a menu, or the
  bluetooth MIDI dialog window, then close the popup window.
- Rotate the device.

Previously, the steps above could result in the system painting its own
backgrounds behind the system bars. With this patch in place, we reset
the requested system UI colours and transparency, which seems to
maintain the desired appearance.
This commit is contained in:
reuk 2025-07-22 15:18:07 +01:00
parent 896dd10845
commit 1e1e5036fb
No known key found for this signature in database
2 changed files with 37 additions and 9 deletions

View file

@ -674,11 +674,19 @@ DECLARE_JNI_CLASS (AndroidViewGroup, "android/view/ViewGroup")
METHOD (getDecorView, "getDecorView", "()Landroid/view/View;") \
METHOD (getAttributes, "getAttributes", "()Landroid/view/WindowManager$LayoutParams;") \
METHOD (setFlags, "setFlags", "(II)V") \
METHOD (clearFlags, "clearFlags", "(I)V")
METHOD (clearFlags, "clearFlags", "(I)V") \
METHOD (setStatusBarColor, "setStatusBarColor", "(I)V") \
METHOD (setNavigationBarColor, "setNavigationBarColor", "(I)V") \
DECLARE_JNI_CLASS (AndroidWindow, "android/view/Window")
#undef JNI_CLASS_MEMBERS
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
METHOD (setNavigationBarContrastEnforced, "setNavigationBarContrastEnforced", "(Z)V") \
DECLARE_JNI_CLASS_WITH_MIN_SDK (AndroidWindow29, "android/view/Window", 29)
#undef JNI_CLASS_MEMBERS
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
METHOD (getDefaultDisplay, "getDefaultDisplay", "()Landroid/view/Display;") \
METHOD (removeViewImmediate, "removeViewImmediate", "(Landroid/view/View;)V") \