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

Commit 8d71f11c authored by Brian Attwell's avatar Brian Attwell
Browse files

Fix tabs when using ContactsUnavailableFragment

Also fix landscape tabs when opening the app from landscape
launcher.

Bug: 16516327
Change-Id: Id930dd1aa8d1a9001d7c7901a5822ebbf4cfa2db
parent a5e17ac3
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);
        }
    }