Hide/show status and navigation bar on - android

I am searching for hours, but nothing found.
I just want to hide/show status and navigation bar when I hit the screen, like android gallery.
// Hide status bar
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Show status bar
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
The code above works fine for Status bar, but what about navigation bar (bottom bar) like android gallery? (I dont want to use 4.4 immersive mode)

Related

Removing status bar

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

Why Actionbar should be hidden if we are hiding the Statusbar?

Eventhough its possible to hide the Status bar while keeping the Action bar the docs here emphasises
"You should never show the action bar without the status bar."
What is the reason for this? Is it just a UX guideline or are there other reasons for it?

actionbarsherlock on android 4.3 wont hide the bottom action bar properly, it shows blank white space instead

Hi I am using actionbarsherlock and splitActionBarWhenNarrow to to get a bottom action bar with my menu information. I have set windowActionBarOverlay to be true.
In android 4.2 and below calling getSupportActionBar().hide(); will properly hide both the top and bottom action bars. In android 4.3 getSupportActionBar().hide() hides the top action bar properly but it leaves a blank white space where the bottom action bar use to be.
Can anyone help me with this?

Hide status and title bar on android titanium

I am working on titanium project and am facing a problem where when I use win.open({modal:true}); my application screen does not hide the status bar and title bar in Android devices. How can I fix this?
to hid ethe title bars in your screen just do this in your oncreate before adding the setcontentview.This will hide your title bar
requestWindowFeature(Window.FEATURE_NO_TITLE);

Hide Action Bar while showing Split Action Bar

How can I hide the top Action Bar but show the Split Action Bar using ActionBarSherlock. I would like to have Tabs at the top instead like this:
The Android developer site states the following to hide the action bar but keep the split action bar:
If you'd like to hide the main action bar at the top, because you're
using the built-in navigation tabs along with the split action bar,
call setDisplayShowHomeEnabled(false) to disable the application icon
in the action bar. In this case, there's now nothing left in the main
action bar, so it disappears and all that’s left are the navigation
tabs at the top and the action items at the bottom, as shown by the
second device in figure 3.
https://developer.android.com/guide/practices/tablets-and-handsets.html#SplitActionBar
In my SherlockFragmentActivity I call the following, however only the app icon and title disappear and the action bar stays like this:
//Hide action bar
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayShowHomeEnabled(false);
Calling getSupportActionBar().hide() hides the action bar but also hides the split action bar.
The tabs only roll up into the top action bar if you are using the Tabs provided by ABS. You're not using ViewPager/ViewPagerIndicator for the tabs by any chance are you? (I have this issue currently)

Categories

Resources