JakeWharton/ActionBarSherlock — Issue #190: List navigation items drawn on top of each other
Author: carlospuk
Created: 2012-01-15 20:24:40+00:00
State: open

Using ABS v4.0, beta 5. It's difficult to describe this one, but I've taken some screenshots of before, during navigation selection, and afterwards, running on API level 7 (Android 2.1):

https://plus.google.com/photos/105249887675414420125/albums/5697954913915803905

Code sample is pasted below. Essentially, what happens is that you enable list navigation mode and add a SpinnerAdapter. Tap the navigation list in the action bar, and a dialog box appears containing the items. Tap a new item and at this point the bug occurs. The action bar updates the navigation list, but instead of re-drawing it, the new selection is drawn over the top of the old. See screenshot above.

Code to reproduce:

OnCreate(...)
===========
// Configure action bar
ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayUseLogoEnabled(true);

// abar Spinner
spinnerAdapter = ArrayAdapter.createFromResource(this, R.array.action_list, R.layout.navspinner_dropdown);

OnNavigationListener mOnNavigationListener = new OnNavigationListener() {
@Override
public boolean onNavigationItemSelected(int position, long itemId) {

if (position == 0)
switchToMap(); // This just changes the Z index of some child Views
else
switchToList(); // This just changes the Z index of some child Views

return true;
}
};
actionBar.setListNavigationCallbacks(spinnerAdapter, mOnNavigationListener);

navspinner_dropdown.xml :
=========================

arrays.xml
========

Map

List