How to avoid stacked actionbar when including small tabs - android

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!

Related

Navigation bar visibility on Samsung S8

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?

Using Option menu for non-physical buttons devices

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.

Android: Tabbed actionbar in portrait mode

I am unsure what to search for this so all links are appreciated.
When I change the orientation of my device to portrait mode all the tabs are going below the action bar, not on it, even though there is plenty of room (I am using 2 tabs while testing on a Nexus 10). Will the tabs always appear below the action bar in portrait mode or is there a way around this?
What I want to happen:
(source: android.com)
What is happening: NOTE: this is the behavior I am getting even when there is PLENTY of room to display the tabs in the action bar:
(source: android.com)
Thanks in advance!
Will the tabs always appear below the action bar in portrait mode
On small/normal screens, yes. Action bar tabs will go where the action bar implementation wants to put them... which includes them not being tabs at all in some cases, but a drop-down list instead.

Last tab in action bar is cropped, goes off screen

I'm making an Android app using tabs for navigation.
I have a problem with the rendering of the last tab in the action bar; it goes off screen and is cropped (this happens as soon as the number of tabs is too big too fit in the screeen width as far as I can tell).
I'm using the ActionBar.NAVIGATION_MODE_TABS navigation mode.
I haven't been able to find any questions with the same problem, any ideas on how to prevent this behavior?
I have already answer a question like that one : Tab item width in Action Bar (Android)

How to change layout on xlarge screens in ActionBarSherlock

I am building an app that uses ActionBarSherlock. I need to change it's layout so there is no padding arround tab icons. Now it looks like that:
| tab1 | tab2 | tab3 | t
But i want it like that:
|tab1|tab2|tab3|tab4|
I've manage to do so on normal size screens by changing that file:
library/res/values/abs__styles.xml
However on my Galaxy S3 still has padding, I tried changing paddings from:
library/res/values-xlarge/abs__dimens.xml
but no effect. I also tried to remove it but still no changes.
edit:
Just for information, I am using only icons but no text for top. All my icons are in drawable-hdpi, could that be a problem? I don't think so because they are not reseized or anything only paddings apper :S
that one is in values.
so I also tried comment out all lines with
<dimen name="abs__action_bar_icon_vertical_padding">0dip</dimen>
but no effect…
If your Galaxy S3 is running ICS or later, ABS will use the native action bar. Any changes you make to the library will have no effect.
Action Bar Sherlock library has some limitations in it.
Limitation 1 : Adjusting of Action menu items in action bar is not possible
Description :
You can have different action menu items in the action bar and also you can set the icons for that items in the action bar. But, adjusting padding between action items, Removing Toast for the action items in the action bar it is impossible. Because Action bar Sherlock uses native action bar. Only look and feel is similar to ICS, but behavior is restricted.
Limitation 2 : Activity Recreation
Description :
When Screen orientation changes, It will recreate activity which is in active. So User Interface will get updated and also it doesn't save the state of the application or activity..
Be Aware of Action Bar Sherlock
I wouldn't use ABS directly for Tab navigation. Consider using a Viewpager and ViewPagerIndicator, which is comatible with ABS (same author), and there you have a lot more control of the appearance . This way the user can also swip left-right to switch tabs.
Does this happen no matter what? I honestly haven't played too much with a native actionbar. What if you do something like an inset drawable? This would kind-of change how it's drawn and may shrink the icon, but might be a solution until you find something better.

Categories

Resources