As many of you already know, Samsung has introduced option to hide navigation bar by double-clicking on small dot in bottom-left corner.
I need to figure out if it is hidden or not, so I tried to do that by getting its height.
It looks like it always 144, no matter if it's visible or not.
Samsung does in its way, so probably this is not a good way to go.
Is there a way to figure out if navigation bar is hidden or not on Android devices?
Related
How can I know programmatically if a device has a navigation bar and if it has it how can i get the size (width and height).
I tried this solution stackoverflow.com/a/29938139/1683141 and when I test a Sony Xperia Z on Genimotion, returns that not has a navigation bar but it has!
Please I need to fix this cases with navigation bar, because the app not looks good.
Thanks
Try this answer to the question you linked. The difference between appUsableSize and realScreenSize is the space occupied by the navigation bar. (This works because, somewhat unexpectedly, the status bar counts toward appUsableSize.) If both sizes are the same, you have no navigation bar.
There is a task to display the navigation bar on the left side for android 4.4.2. Nothing of the sort found. Is it possible to do this?
Or, for example, to hide the navigation bar, and on the left side add own custom menu on the same level of layouts hierarchy order content is shifted to the size of the menu?
This solution should work everywhere, not just in one application.
Thanks for the help.
As far as I know you see that navigation bar there because you are using emulator genymotion. On real devices you should not be able to see it. Besides, those back button are physical buttons on some devices like samsung s2.
If you want a menu on the left you should implement navigation drawer. Good luck
I am developing an application that must hide title bar to increase screen spaces and for design issues. on non-physical buttons devices like nexus-4 and for Android > 3.0, I can't switch to use Action bar because the title bar is hidden, and in the same times these devices hasn't physical buttons to use standard menu.
My Question: How can I solve this problem
Thanks
How can I solve this problem
Modify your UI to either:
Add back the action bar, or
Add something else on your screen, such as a button, to display something else on the screen that will serve as your "menu". You can see this approach used by many games.
My problem is quite simple, however not sure if there is a clean/easy fix for this. I have an action bar with one tab. In some devices (motorola xoom) the tab is in the action bar, however in some other devices (Nexus 7, Samsung Galaxy 10 tablet), the stacked action bar shows up with the tab on it.
You can see from the picture below that the tab's text is small enough to for the tab to fit in the main action bar instead of spawning the stacked one... I am using a regular action bar, but I've read through the internet that this also happens in Sherlock.
Is there any way to fix this without having to recur to a customView? I wouldn't really want to change all my implementation (tab listeners, etc), just to do this. Thanks in advance!
This is a picture of my phone (Android 2.1 with HKC Sense):
The bit that's got a red border around it is in the Clock app and the Media player on my phone. What is it called? Is it a standard Android interface control?
I've been trying to figure out how to get something like this for the past while and I'm not seeing anything immediately obvious.
I've seen a lot of people referring to the ActionBar or Split ActionBar, but that seems to be something that is anchored to the top. I need this to be at the bottom without any component on the top.
*please excuse
It's an actual pic of the phone, rather than a screenshot - the screenshot app I downloaded wouldn't work.
The fact that the pic was taken with an iPhone, and that the apple logo is clearly reflected in the pic.
You can use Split ActionBar
android:uiOptions="splitActionBarWhenNarrow"
And that will force the action bar items to be hosted on the bottom of the screen for narrow devices, mostly phones. When this flag is set, no components are hosted on the top of the ActionBar, unless you use tab navigation.
See example Image
Keep in mind though, that should you be displaying the layout on a non-narrow device, like a tablet, then the items will be attached to the top ActionBar.
Some other things to consider
Creating a custom view, which you can set to the bottom of the layout. The View would be a scrollable ListView per say, and you can add as many icons as you'd like to it. Here's an example. That would not be a standard nav pattern though.