Merge "update account spinner properly"
This commit is contained in:
commit
32d45f6669
@ -210,7 +210,7 @@ public class AccountSelectorAdapter extends CursorAdapter {
|
||||
return c.moveToPosition(position) ? getAccountUnreadCount(c) : 0;
|
||||
}
|
||||
|
||||
private int getAccountPosition(int position) {
|
||||
int getAccountPosition(int position) {
|
||||
final Cursor c = getCursor();
|
||||
return c.moveToPosition(position) ? getAccountPosition(c) : UNKNOWN_POSITION;
|
||||
}
|
||||
@ -358,7 +358,7 @@ public class AccountSelectorAdapter extends CursorAdapter {
|
||||
String name = mContext.getString(
|
||||
R.string.mailbox_list_account_selector_show_all_folders);
|
||||
addRow(matrixCursor, ROW_TYPE_MAILBOX, Mailbox.NO_MAILBOX, name, null, 0,
|
||||
UNKNOWN_POSITION);
|
||||
accountPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,6 +238,12 @@ public class ActionBarController {
|
||||
mCallback.onAccountSelected(itemId);
|
||||
} else if (!mAccountsSelectorAdapter.isAccountItem(itemPosition)) {
|
||||
mCallback.onMailboxSelected(itemId);
|
||||
// We need to update the selection, otherwise the user is unable to select the
|
||||
// recent folder a second time w/o first selecting another item in the spinner
|
||||
int selectedPosition = mAccountsSelectorAdapter.getAccountPosition(itemPosition);
|
||||
if (selectedPosition != AccountSelectorAdapter.UNKNOWN_POSITION) {
|
||||
mActionBar.setSelectedNavigationItem(selectedPosition);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user