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

Commit e7a11280 authored by Brian Attwell's avatar Brian Attwell Committed by Android (Google) Code Review
Browse files

Merge "Fix tabs when using ContactsUnavailableFragment" into lmp-dev

parents 4d9ff414 8d71f11c
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -311,10 +311,9 @@ public class ActionBarAdapter implements OnCloseListener {
    private void update(boolean skipAnimation) {
        final boolean isIconifiedChanging
                = (mSearchContainer.getParent() == null) == mSearchMode;
        mToolbar.removeView(mLandscapeTabs);
        if (isIconifiedChanging && !skipAnimation) {
            if (mSearchMode) {
            mToolbar.removeView(mLandscapeTabs);
            if (mSearchMode) {
                addSearchContainer();
                mSearchContainer.setAlpha(0);
                mSearchContainer.animate().alpha(1);
@@ -336,9 +335,9 @@ public class ActionBarAdapter implements OnCloseListener {
            return;
        }
        if (isIconifiedChanging && skipAnimation) {
            mToolbar.removeView(mLandscapeTabs);
            if (mSearchMode) {
                setPortraitTabHeight(0);
                mToolbar.removeView(mLandscapeTabs);
                addSearchContainer();
            } else {
                setPortraitTabHeight(mMaxPortraitTabHeight);
+4 −0
Original line number Diff line number Diff line
@@ -580,6 +580,10 @@ public class PeopleActivity extends ContactsActivity implements
                    mContactsUnavailableFragment.setMessageText(R.string.noContacts, -1);
                    break;
            }
            // When using the mContactsUnavailableFragment the ViewPager doesn't contain two views.
            // Therefore, we have to trick the ViewPagerTabs into thinking we have changed tabs
            // when the mContactsUnavailableFragment changes. Otherwise the tab strip won't move.
            mViewPagerTabs.onPageScrolled(tab, 0, 0);
        }
    }