App 2.8.2: full screen fills the space the bars leave

On the MG4 the immersive flags hid SAIC's bars but left a black band
where they had been. SYSTEM_UI_FLAG_LAYOUT_STABLE reports the bars'
insets even while they are hidden, and the fitsSystemWindows root
padded itself by them. In full screen the flag is dropped and the root
no longer fits system windows; switching full screen off restores both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
2026-10-18 00:00:58 +02:00
co-authored by Claude Opus 5.5
parent 8bad5fc024
commit 1b918e3c39
3 changed files with 17 additions and 4 deletions
@@ -321,13 +321,23 @@ public class MainActivity extends AppCompatActivity {
* in front, and a swipe from the edge shows them briefly. On the MG4 those bars are SAIC's
* own (climate strip, hazard and home shortcuts); if the platform keeps them, these flags
* simply have no effect.
*
* The content takes the space the bars leave: no LAYOUT_STABLE (it reports the bars' insets
* even while they are hidden), and the root stops padding itself for them. On the MG4 that
* padding stayed as a black band where the bars had been (2.8.1).
*/
@SuppressWarnings("deprecation") // the WindowInsetsController API starts at 30; this is 28
private void applyFullScreen() {
View decor = getWindow().getDecorView();
if (UploadSettings.fullScreen(prefs)) {
boolean full = UploadSettings.fullScreen(prefs);
View root = findViewById(R.id.app_root);
if (root != null) {
root.setFitsSystemWindows(!full);
if (full) root.setPadding(0, 0, 0, 0);
root.requestApplyInsets();
}
if (full) {
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION