Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d58b04f6 authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "New tab order: GROUPS / ALL / FAVORITES"

parents 5bbb95ca 9d2a74ef
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -77,17 +77,20 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener {
    private boolean mShowHomeIcon;

    public enum TabState {
        FAVORITES, ALL, GROUPS;
        GROUPS,
        ALL,
        FAVORITES;

        public static TabState fromInt(int value) {
            switch (value) {
                case 0:
                    return FAVORITES;
                case 1:
                    return ALL;
                case 2:
            if (GROUPS.ordinal() == value) {
                return GROUPS;
            }
            if (ALL.ordinal() == value) {
                return ALL;
            }
            if (FAVORITES.ordinal() == value) {
                return FAVORITES;
            }
            throw new IllegalArgumentException("Invalid value: " + value);
        }
    }
@@ -126,9 +129,9 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener {
        mActionBar.setCustomView(customSearchView, layoutParams);

        // Set up tabs
        addTab(TabState.FAVORITES, mContext.getString(R.string.contactsFavoritesLabel));
        addTab(TabState.ALL, mContext.getString(R.string.contactsAllLabel));
        addTab(TabState.GROUPS, mContext.getString(R.string.contactsGroupsLabel));
        addTab(TabState.ALL, mContext.getString(R.string.contactsAllLabel));
        addTab(TabState.FAVORITES, mContext.getString(R.string.contactsFavoritesLabel));
    }

    public void initialize(Bundle savedState, ContactsRequest request) {