In Android when in Immersive Mode, swiping in from the bottom or other edges (based on current orientation) reveals the status bar and navigation bar (which auto-hides later). I want to trigger this programmatically by touching the fingerprint scanner. How can I achieve this? There are some commands in the Android shell to emulate a swipe action programmatically, but is this that the only way to do this?
Related
I want to permanently disable status bar, not hide it. I was able to disable navigation bar by giving qemu.hw.mainkeys=1 in system.prop and building the image.
But, i didn't find any method to disable status bar. I even tried with the below flags -
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
View.SYSTEM_UI_FLAG_FULLSCREEN;
But, these temporarily hide the status and navigation bar. If the user taps the screen, they pop back up. With these flags, they do not get fully disabled. There are many solutions online on how to hide the status and navigation bar, but not fully disable them.
1) The only method i found to disable status and navigation bar is by disabling systemui.
pm disable com.android.systemui
But i noticed that, disabling systemui, disables a lot of things , like SD card, volume, wallpapers,etc.
2) The other method that i tried is changing status_bar_height in frameworks/base/core/res/res/values/dimens.xml to 0dp as shown below -
<!-- Height of the status bar -->
<dimen name="status_bar_height">#dimen/status_bar_height_portrait</dimen>
<!-- Height of the status bar in portrait -->
<dimen name="status_bar_height_portrait">0dp</dimen>
<!-- Height of the status bar in landscape -->
<dimen name="status_bar_height_landscape">#dimen/status_bar_height_portrait</dimen>
But, this caused the boot animation to not load and in-turn not to display the screen contents (My lvds went just dark).
How do i disable status bar?
The only way I was able to hide the status bar is by using this command
settings set secure user_setup_complete 0
You can enable it again by setting it to 1 or get the current status by using
settings get secure user_setup_complete
Another idea might be to use what you're using now to hide it but edit the swipe event function in source code for the status bar java class to do nothing so the swipe down gets ignored.
I'm using SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.top]);
to only display the top system overlay (Where you normally see time and notifications) and disable bottom navigation of the device (3 buttons in android or slider in IOS).
Problem is that when I try to press the Bottom Navigation Bar of my Flutter application, it automatically activates the bottom bar of the system, blocking out the bottom navigation bar of the app.
Resizing the app is not suitable for me. I don't want this to happen, and system navigation should only appear when user slides from the bottom.
Help is appreciated.
Can you share your code so that I can have a better Idea,
// to hide only bottom bar:
SystemChrome.setEnabledSystemUIOverlays ([SystemUiOverlay.top]);
// to hide only status bar:
SystemChrome.setEnabledSystemUIOverlays ([SystemUiOverlay.bottom]);
// to hide both:
SystemChrome.setEnabledSystemUIOverlays ([]);
//to bring them back:
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values)
Implement the in your code and it should work.
I wrote an app that is composed by a full screen webkit object. So, as soon as the activity starts, i set these flags:
SYSTEM_UI_FLAG_LAYOUT_STABLE
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
SYSTEM_UI_FLAG_HIDE_NAVIGATION
SYSTEM_UI_FLAG_FULLSCREEN
SYSTEM_UI_FLAG_IMMERSIVE
Problem is that when i swap down from the top border of the screen, status bar and navigation bar becomes visible (and this is ok, so you can close the app if you need it). Problem is that, after a few seconds, status bar goes away while navigation bar doesn't. It stucks there. Is there a flag I am missing? Or is there any hook I can use to detect when the status bar hides and then set back the flags?
I want to permanently disable navigation and status bar for my android application i have used immersive mode for that but when i touch anywhere on screen the navigation and status bar reappears and on touching again on screen it goes back.I just want that all the navigation bar and status bar should not come when my application is running at any of the scenario please help.
That is not possible without root. With root permission you can achieve this but still its not a preferred.
Is it possible to hide navigation bar on e.g. tablets in activity, so it does not appear when user is clicking on the screen?
I want it to appear only when user is swiping from bottom to middle of the screen, just like in e.g. Real Racing 3.
When I use:
myView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
Unfortunetly navigation bar is hidden, but when user is clicking, it appears again. I want it to work only with this swipe gesture. How it can be achieved?
This is a platform behavior. Apps do not have the sort of control of the navigation bar that you are looking for, and for good reason. All it takes is one app not implementing a way to show the nav bar and the user is stuck. You will have to design your app with the platform's behavior in mind.