I want to dismiss bottom Navigation bar for one particular screen.
I tried using
setSystemUiVisibility(HorizontalScrollView.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
I have put this in Onscroll of my scrollView, ontouch of my views.
but the issue is its comes back and the screen gets resize.
Any suggestions by which I can completely remove the NAVIGATION BAR.
Check out SYSTEM_UI_FLAG_HIDE_NAVIGATION, this flag hides the navigation bar until the user interacts with the device. It's new in Android 4.0. You can enable this flag for example like this:
getWindow().getDecorView()
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
Note that the navigation won't disappear again automatically, you have to set it every time after the user interacted with the device.
Alternatively you can make the navigation less obtrusive by using SYSTEM_UI_FLAG_LOW_PROFILE, this changes the buttons into small dots (e.g. like the camera app).
Related
I try to make an app using one activity multiple fragments pattern. I handle navigation with Navigation architecture component using a bottom navigation view. In one of the fragment I have a Recyclerview which displays a list of custom cards. On item click it navigates to another fragment where I need to hide the bottom navigation view.
The problem appears when I navigate back and set the bottom navigation view visible again. The bar seems to appear in two steps giving the feeling of lag. (first time appears just 60% of the bottom navigation view).
The behavior seems to be related with the status bar. When I change the theme to full screen or I set windowTranslucentStatus=true, everything behaves okay. In addition, first time the nav bar seems to be with exactly 24dp smaller, that is the dimension of status bar.
Have you any idea what can I do?
PS. I'm new on stackoverflow and this is my first question. I'm glad to join this wonderful community.
Delay is one way to go, but I wouldn't suggest that.
I am assuming that the your navigation view is rendered before the entire activity is rendered, which is causing it to be rendered again after the UI is rendered. Why don't you try setting the visibility after the UI is rendered, like here
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.
Background
I have an app that has 2 activities :
splash activity, which is shown in full screen (no action bar, no notification bar)
main activity, which has both an action bar (uses actionBarSherlock) and a notification bar.
The problem
For some reason, when going from the first activity to the second, there is a "jumpy" layout process, which shows the content of the second activity without the action bar and notification bar, and a moment later it shows them both.
This causes the content below to move too, which is very noticeable.
Possible solution
As I've seen, a possible solution would be to hide the action bar and show it a bit later (500ms later), but this seems like a bad solution (making it slower and hiding for no reason), plus I need to get the actionBar items positions for another purpose (for showing a tutorial).
The question
Is it possible to avoid the "jumpiness"? One that doesn't involve such a weird workaround?
I've solved my problem doing the following:
1.- I have to optimize all the screens where the AB was shown. In some cases I used ListViews which weren't correctly implemented and that caused a noticeable load time in the activity.
2.- I have shown the status bar BEFORE starting the new activity. I mean: I've shown the status bar in the fullscreen activity just before starting the non-fullscreen one. With that I achieved that the layout of the second activity (non-fullscreen) was never resized.
With this two little changes now the AB transition is much more smoother.
You can find the complete post with my answer at: Smoother transition from fullscreen activity using ActionBarSherlock
Why don't you use some other animation slide transitions rather than default popping one?
something like this?
overridePendingTransition(android.R.anim.accelerate_interpolator, android.R.anim.slide_out_right);
Here is the Animation lists that you can use
http://developer.android.com/reference/android/R.anim.html
I am writing an App using MonoDroid and for some reason I cannot pull down the notification bar from the top of the screen. I am thinking this has to do with my layout, but I am not sure. I also notice that when my App is running I do not have the bar at the top showing the battery, time, signal strength, etc.
So, my question is, what do I need to do to allow the user to pull the notification bar down? And how to show the info at the top of the screen?
I suspect you have done something to make your app appear in "Full Screen" mode (this will turn the home, menu and back buttons on the bottom of the screen to dots, and hide the navigation bar.
I believe this is called "lights out mode". Here is one SO question asking how to turn it on (maybe it will help you turn it off as well): Hide ICS back home task switcher buttons
Maybe your theme is
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" ?
It hides the notification bar. Change to a non-fullscreen theme to make the the notification bar visible.
I am trying to implement a splashcreen and I dont want to use a new activity for the splashscreen,
So I set visibility=gone on my listview, hide actionbar, leave the logo visibility=visible, sleep for a certain period and then show the actionbar again and set the listview visibility back to visible
This works, however there is a brief moment at the start when the actionbar is still visible before it gets hidden
Is there a way to fix this and have the actionbar be gone from the beginning?
I am using ActionBarSherlock and Galaxy S3 with 4.1 Jelly Bean.
Thanks
No. There is no way to do this without using two separate activities.
The action bar is initialized as part of the decor view which happens much earlier than your onCreate method. This means there will be the noticeable lag that you describe before it can be hidden. If you wanted to permanently hide it you could do so using a theme or window flag but once you do that there is no way to get it to appear.