JakeWharton / ActionBarSherlock

[DEPRECATED] Action bar implementation which uses the native action bar on Android 4.0+ and a custom implementation on pre-4.0 through a single API and theme.
http://actionbarsherlock.com
Apache License 2.0
7.1k stars 3.53k forks source link

ActionBar Tab does not utilize full width on older versions #427

Open jo-elimu opened 12 years ago

jo-elimu commented 12 years ago

Hello,

I have noticed that there is a difference in the way the ActionBar Tab items are displayed (when transformed to Drop-down list on narrow screens):

Version 2.3.5: 2.3.5!

Version 4.0.1: 4.0.1!

In my example, I have added several com.actionbarsherlock.app.ActionBar.Tab items to the ActionBar which uses navigation mode ActionBar.NAVIGATION_MODE_TABS. The items are displayed as tabs when the screen is wide, but on a narrow screen they automatically adapt themselves to be displayed in a drop-down list, and it is in this list that the width of the items is not fully utilized.

It should be noted that I have not tested if the same bug occurs when using ActionBar.NAVIGATION_MODE_LIST or ActionBar.NAVIGATION_MODE_STANDARD.

I have not checked exactly which versions that are affected other than 2.3.5.

JakeWharton commented 12 years ago

Was able to reproduce. Only happens with collapsed tab navigation and not with list navigation. Couldn't find anything blatantly obvious that was causing it so I'll have to dig deeper sometime in the next week or two.

SimonVT commented 12 years ago

I made a project using ABS, and one using the native implementation. Created two AVDs with the same size and dpi. Result can be seen in the image.

image ABS vs Native

Seems to be caused by a framework bug, tho the container is measured a bit larger with the ABS implementation.

JakeWharton commented 12 years ago

Well that's somewhat encouraging. At least to the degree that it wasn't something that I introduced. Would be nice to fix it on our at end least.

SimonVT commented 12 years ago

For some reason this depends on the space taken by action items. If there are no, or very little space is taken, the bug is not there. The size of the popup menu also depends on this, which I find strange.

JakeWharton commented 11 years ago

I observe this on Android 4.2 still.