My problem is simple and I have been unable to find a solution. The menu bar is very annoying in my app and I am hoping that there is a way to remove it.
Looking at Hiding the Navigation Bar I found this:
You can hide the navigation bar on Android 4.0 and higher using the SYSTEM_UI_FLAG_HIDE_NAVIGATION flag. This snippet hides both the navigation bar and the status bar:
View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
I do not know if that's exactly what you was looking for, but you can test it.
I suggest you read more about native modules, it enables you to write native code and access it from JS.
http://facebook.github.io/react-native/docs/native-modules-android.html#content
Also the StatusBar module is very similar to what you want to do here, you can have a look at the source.
https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java#L110
Related
Android
Hello.
I want to adjust the size of devices resolution and splash image in the splash screen.
I did try to apply png file to 9patch.
But I made gap between device to navigation bar.
And I'd try, try, try, I have reached this point.
I don't know how control navigation bar and button.
Please please please, teach me how hide navigation bar in the splash screen or how change the color in navigation bar's buttons.
Kindly review and give feedback.
It would be better to have some code so we can suggest what could be improved.
But here is some suggestions from android developer documentation.
View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
read more here on how to hide navigation bar.
Link
I have an Android 5.1 tablet with root. I'm implementing an app in kiosk mode. For that I'm using the immersive mode, which nicely hides the navigation and status bar. But with a swipe these bars reappears, which is not what I want.
With adding qemu.hw.mainkeys=0 to the end of the build.prop file I was able to get rid of the navigation (bottom) bar. Unfortunately, the status bar still re-appears when i pull down from the upper side of the screen.
Is there a possibility to get rid of the status bar by editing the builds.prop file or in another way?
Not so familiar with root device, so i think about different way, have you try to hide it in main activity?
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
ActionBar actionBar = getActionBar();
actionBar.hide();
This applied for 4.1 and Higher, see more in Android Developer
I have one View which I want to put in the whole screen, ie.. by making the status bar (top bar) and navigation bar (bottom bar) translusent and putting some portion of the view behind it. I tried the using the flags :
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN
But they just hide them, and on touching these flags get cleared. It is understandable that android OS wants user to always have the navigation bar and that is why it is showing them again, but isn't there a way to just show our view behind the navigation bar.
I manage to put my layout behind the status bar using
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
But still, how can I put my view behind Navigation bar too.
Also I am developing the app for API level 14 and above, so I cant use, IMMERSIVE_STICKY or IMMERSIVE mode. Any Suggestions will be appreciated.
The HTC sidebar with the software buttons is not good for the aspect ratio.
How do I hide it?
I am already using:
<preference name="Fullscreen" value="true" />
And this hides the top menu bars on Samsung devices, but not the sidebar on HTC devices.
It's with a Home icon, Back icon and some other icon. When the device is in landscape mode, this side bar is on the right so you can get into the main menu again or exit the app.
That is called the navigation bar. It exists on about half of the world's Android devices, specifically those that do not have off-screen keys for HOME and BACK.
Quoting the documentation:
You can hide the navigation bar on Android 4.0 and higher using the SYSTEM_UI_FLAG_HIDE_NAVIGATION flag.
The documentation also shows a code snippet of how to use it:
View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
I want to hide Bottom Option Bar in Android. I don't know whether we call it Option Bar it or not.
Please check it out Image below : Tell me if we call it something else. It is in bottom.
Now, I want to hide it. How to do it ?
It's called navigation bar, the reason for it only having the options button is probably because your device has hardware buttons for home and back, that's why it looks like an options button only bar.
Refer to the docs for hiding it, although it will only work for versions supporting it.
For 4.0+
View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);