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.54k forks source link

Action items from fragments in a pager are incorrectly displayed in split mode #471

Open blork opened 12 years ago

blork commented 12 years ago

When swiping between fragments (which have an options menu) in a pager, the action items exhibit strange behaviour when in the action bar is in split mode. Icons appear to overlay, text disappears, and the items become unclickable. If the fragments are switched by clicking a tab (i.e. not swiping), then they work fine.

This behaviour can be seen in the fragment demo app included with the library. Change the manifest like so:

<activity
        android:name=".FragmentTabsPager"
        android:label="@string/fragment_tabs_pager"
        android:uiOptions="splitActionBarWhenNarrow" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="com.actionbarsherlock.sample.fragments.EXAMPLE" />
        </intent-filter>
</activity>

adding 'android:uiOptions="splitActionBarWhenNarrow"'. Then start this activity (Tabs and Pager).

Screenshots:

Invisible text on items

More images.

JakeWharton commented 12 years ago

This is some kind of race condition which is introduced by using the ViewPager which is almost certainly a duplicate of #351. You'll notice that if you give the same treatment to the regular "Tabs" example (.FragmentTabs) this bug is not present.

Also see: http://b.android.com/29472