📳 [FREE] Hidebars - an extension to display app full screen

  1. Description

Didn't really mean to write this extension, I just fell down the rabbit hole, and its creation was the only way out!

The extension should make your app display in full screen, even into the cutout, and the system bars become available via a swipe. Cutouts and notches came into being in 2018 on Android Pie (9) devices. There are probably only a few devices with both a cutout/notch and Android 9 that miss out. For earlier devices, and possibly for Android 10 devices, there are other extensions that should provide the full screen appearance.

**The extension uses the latest API from Android, hence it will only work for < API 30 **

  • Latest version : 1.0
  • Tested : tested on App Inventor 2 (n198), in companion (2.72u) and compiled on Android 13 and 14.
  • Released : 2024-09-27T23:00:00Z
  • Last updated : 2024-09-27T23:00:00Z
  • Built : using the RUSH Extension Builder by @shreyash
  1. Blocks

blocksHideBars

  1. Usage

  1. Video

  1. Files

HideBars

Resources
http://docs.52im.net/extend/docs/api/android-50/training/system-ui/immersive.html
https://stackoverflow.com/questions/23276847/what-is-an-android-decorview
https://stackoverflow.com/questions/39257362/how-to-get-activity-of-a-decorview-getcontext-on-decorview-getting-a-decorco
https://stackoverflow.com/questions/38366982/what-is-phone-window-decor-view
https://developer.android.com/reference/android/view/Window.html
https://stackoverflow.com/questions/22103862/immersive-mode-in-android-only-transparency
https://stackoverflow.com/questions/48620569/how-to-make-my-activity-as-full-screen-mode-in-android
https://stackoverflow.com/questions/62577645/android-view-view-systemuivisibility-deprecated-what-is-the-replacement
https://www.youtube.com/watch?v=acC7SR1EXsI
https://developer.android.com/reference/android/view/WindowInsetsController#BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
https://developer.android.com/reference/android/view/WindowInsets.Type?_gl=1*1yj79p*_up*MQ..*_ga*MTM3NTQyNDgwNi4xNzI3NDU1MDMw*_ga_6HH9YJMN9M*MTcyNzQ1NTAzMC4xLjAuMTcyNzQ1NTAzMC4wLjAuMjAxNTc1ODQyNQ..
https://developer.android.com/reference/android/view/DisplayCutout?_gl=1*1a8tt4v*_up*MQ..*_ga*MTM3NTQyNDgwNi4xNzI3NDU1MDMw*_ga_6HH9YJMN9M*MTcyNzQ1NTAzMC4xLjAuMTcyNzQ1NTE5Ni4wLjAuMjAxNTc1ODQyNQ..#DisplayCutout(android.graphics.Insets,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect)
https://developer.android.com/develop/ui/views/layout/display-cutout
https://developer.android.com/reference/android/view/WindowManager.LayoutParams?_gl=1*1gqgwuv*_up*MQ..*_ga*MTA5MTkzODEzOS4xNzI3NDU1ODE4*_ga_6HH9YJMN9M*MTcyNzQ1NTgxNy4xLjAuMTcyNzQ1NTgxNy4wLjAuMjExOTgxMTUwNw..#LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
https://stackoverflow.com/questions/49190381/fullscreen-app-with-displaycutout
https://stackoverflow.com/questions/64481841/android-api-level-30-setsystembarsappearance-doesnt-overwrite-theme-data
https://stackoverflow.com/questions/64826506/programmatically-change-status-bar-text-color-in-android-11-api-30
https://stackoverflow.com/questions/38703225/android-windowmanger-remove-flags

Enjoy :smiley: , and all feedback and comments welcome.

Available for use in any MIT AppInventor projects or competitions

#####################################################################
This work by TIMAI2 is licensed under a
Creative Commons Attribution-ShareAlike 4.0 Unported License with attribution.
Please use name = TIMAI2 and link to this source page when giving credit.
#####################################################################

13 Likes

Very good extension

Great Extension

Great Extension

Can we still use this extension for android 5 or 7 or 9?

Just do it by install extension in the project and try it.

I already tried the extension

No

The extension uses the latest API from Android, hence it will only work for > API 30 (Android 10)

Taifun

You can use: WindowInsetsControllerCompat instead of: WindowInsetsController to make the extension compatible with API >=28.

WindowInsetsControllerCompat windowInsetsController = WindowCompat.getInsetsController(activity.getWindow(), activity.getWindow().getDecorView());
windowInsetsController.setSystemBarsBehavior(behavior);
windowInsetsController.show(type);
windowInsetsController.hide(type);
1 Like

It uses Android's new WindowInsetsController APIs, available starting with Android 11 (API 30).

As far as I finally understand, the problem only occurs when there is a notch. I think that has only been the case since 2018 (i.e. from Android 9 or 10).

Yes, but if you use an extension you need to ensure compatibility with earlier versions of Android so that the fullscreen look is similar on every Android. Compat methods will do it for you.

1 Like

Will it still work if i have android 15?

We will have to wait and see

Okay thanks

That's a really nice extension! :globe_with_meridians:

1 Like