i want make Fullscreen in android 4.0, i use android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
the action bar is disappear, but the status bar isn't appear
i use
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
before "setContentView()"
OK, FullScreen!! however, when the dialog or popupwindow show, the status bar appear again,
i read the source code and find the word :
There is a limitation: because navigation controls are so important,
the least user interaction will cause them to reappear immediately.
can i make fullscreen anytime? help me!
There is a limitation: because navigation controls are so important, the least user * interaction will cause them to reappear immediately.
In other words, Android is telling you that the limitation exists because it would be a bad idea to prevent the user from accessing the navigation controls. Doing so would surely disrupt the user experience and would probably piss off a lot of users. That said, unless you have a very good reason for doing so, you should leave it the way it is.
Related
In Flutter, we can SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive); to make the app fullscreen (i.e. hide Android system status bar and nav bar).
However, I observed that, if the user manually swipes from bottom of screen upwards, the system bars will re-appear again. The big problem is, Flutter code has no way to notice that. If we can get notified that this is changed, we can, for example, make the "go fullscreen" button appear again, such that users can go fullscreen again when they want.
Therefore, is there any approaches to get the current status of whether the status bar or nav bar is showing? Or even better, can we get a callback fired when it changes?
Thanks for any suggestions!
Oops I find the answer after digging into source code: setSystemUIChangeCallback.
It is a bit weird that I did not find it by googling... So anyway I just leave this question here, in case anyone has the same question as me he can find this StackOverflow answer.
I've been trying to lock the navigation bar on Android for 3 weeks so that the user can't send my activity to background. I need to do this to get my lock screen app more secure (I know that writing a custom lock screen is not the best idea but it's a requirement).
I've tried immersive mode, system dialogs, flags on decor view, onKeyDown, onBackPressed (this one works for the back button), reorder_tasks and moving my task to the front (this only works when I click on recent apps) and the usage API.
I've found this app: https://play.google.com/store/apps/details?id=com.wow.keypad.lock.screen which does EXACTLY what I need to do but I don't know how they did it.
Could anyone please help me?
I need a permanent solution like the one these guys from WOW have done.
Thanks!!!
How To Hide Navigation Bar Permanently In Android Activity
It looks like something like this has already been tackled. Your main task would not be to lock the nav bar, as much as just hide it so that the user cannot access it.
I'm currently working on an app for blind people. What I need is to prevent users from accidentally going outside of my app, so I'm trying to overlay/replace/hide soft buttons in Android 4. I know this must be possible because it is used for example in MXPlayer (you can "lock" screen when playing video).
I've tried to override all three buttons (back,home,recent apps). No problem with back and home, but I couldn't figure out how to override(disable) recent apps. I've tried solution described here without success.
Next idea was to overlay the entire screen. I've successfully created system overlay mentioned in this question, but I didn't find out how to overlay my soft buttons.
Do you have any idea how to solve this problem without rooting the phone and using custom ROM?
edit: I've also tried hiding the buttons with SYSTEM_UI_FLAG_LOW_PROFILE(turns buttons into dots) and SYSTEM_UI_FLAG_HIDE_NAVIGATION(hides buttons till next touch). Unfortunately this also doesn't solve my problem because after touch buttons work as usual. Maybe there's a way how to catch "unhiding" a override showing them again?
From Android docs :
The SYSTEM_UI_FLAG_LOW_PROFILE flag replaces the STATUS_BAR_HIDDEN flag. When set, this flag enables “low profile" mode for the system bar or navigation bar. Navigation buttons dim and other elements in the system bar also hide. Enabling this is useful for creating more immersive games without distraction for the system navigation buttons.
The SYSTEM_UI_FLAG_VISIBLE flag replaces the STATUS_BAR_VISIBLE flag to request the system bar or navigation bar be visible.
The SYSTEM_UI_FLAG_HIDE_NAVIGATION is a new flag that requests the navigation bar hide completely. Be aware that this works only for the navigation bar used by some handsets (it does not hide the system bar on tablets). The navigation bar returns to view as soon as the system receives user input. As such, this mode is useful primarily for video playback or other cases in which the whole screen is needed but user input is not required.
In Samsung Galaxy S3, even though my app is set to be full screen, and this makes the notification bar not to be visible, if I swipe from the very edge of the screen side, this action will make the notification bar to appear again, allowing the user to expand it over the full screen app.
Is there any way to disable this, or to cancel the expand of the notification bar?
The problem is that I have a listview covering the whole screen, and if I swipe to scroll the items, every time I do it from the very edge due to the instinctive action of scrolling faster, then the notification bar appears again.
I've tried tricks such as creating an overlay window on the edge, but not working at all for SG3.
Thanks
If you haven't tried already, you might attempt to use the View flag for hiding navigation, SYSTEM_UI_FLAG_HIDE_NAVIGATION, documented here.
However it may be important to note this found at the bottom of their description :
There is a limitation: because navigation controls are so important, the least user interaction will cause them to reappear immediately. When this happens, both this flag and SYSTEM_UI_FLAG_FULLSCREEN will be cleared automatically, so that both elements reappear at the same time.
which is probably related to what you're seeing. I find it hard to believe there's a way around this... I just tried and every fullscreen app I have on my S3 behaves this exact same way.
I suspect that if there was a way around it (assuming the above doesn't work, which I don't expect it to), it would be considered to be a bug by the Android team, and I would advise against it.
I want to let status bar visible but can not be pulled in my activity, is it possible?
If use getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
the status bar is invisible.
Don't do this.
I've been there before - you think you have an interaction that requires overriding some default system behavior (back button, home button, etc).
User expect those buttons (and the status bar) to behave in a certain way and will get annoyed if you override it.
Could you tell us why would you want to block StatusBar from being pulled?
As rightly pointed out by theelfismike, this isn't a best practice to follow.
I suspect you are trying to achieve something which can be gracefully done otherwise.