1 year ago

#225011

test-img

Torima

How to create custom status bar in Android KIOSK app

We are creating a KIOSK app on API 22. We want to have custom status bar. And with two finger swipe from the top, options menu is opened where we can edit sound, wifi etc. just like regular swipe from top on android phones. One option would be to edit Android source code, but we are wondering if there is something we can do on application level since we need to have some strings and buttons from app in that status bar, besides WiFi signal and battery. What we have done is we added a fragment on top of the screen which acts as a status bar, and below it is a fragment container for other fragments. enter image description here

Problem here is we need to have a transparent background of the fragments in fragment container, so when user opens multiple fragments, whole fragment stack is visible in the background. Only way we could achieve this is by using fullscreen dialog fragments, but then we had to make multiple instances of our "status bar" which overlap and only looks like one view to the user:

enter image description here

This leads to maintaining multiple views instead of just one. Also the problem is since we are using Navigation library, when Fragment 1 changes in the background it also pops all dialog fragments, which throws the user to screen he was not on.

One thing we tried is to set dialog fragments window to be (size of screen - status bar) but then we could not click on status bar, since it is behind our dialog fragment. We are considering of using activities instead of fragments, since then we can have transparent background and we don't need to use dialog fragments, but to have activates everywhere instead of fragments doesn't sound like a good idea.

Are there some other options?

android

statusbar

kiosk-mode

0 Answers

Your Answer

Accepted video resources