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

Commit 2f5e2df1 authored by Antoan Angelov's avatar Antoan Angelov Committed by Android (Google) Code Review
Browse files

Merge "Restore share sheet height when toggling dark mode" into rvc-dev

parents 85df93ed 9d894145
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ public class ResolverActivity extends Activity implements

    private static final String TAG = "ResolverActivity";
    private static final boolean DEBUG = false;
    private static final String LAST_SHOWN_TAB_KEY = "last_shown_tab_key";

    private boolean mRegistered;

@@ -843,10 +844,20 @@ public class ResolverActivity extends Activity implements
        }
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        ViewPager viewPager = findViewById(R.id.profile_pager);
        outState.putInt(LAST_SHOWN_TAB_KEY, viewPager.getCurrentItem());
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        resetButtonBar();
        ViewPager viewPager = findViewById(R.id.profile_pager);
        viewPager.setCurrentItem(savedInstanceState.getInt(LAST_SHOWN_TAB_KEY));
        mMultiProfilePagerAdapter.clearInactiveProfileCache();
    }

    private boolean isHttpSchemeAndViewAction(Intent intent) {
@@ -1585,6 +1596,7 @@ public class ResolverActivity extends Activity implements
        TabHost tabHost = findViewById(R.id.profile_tabhost);
        tabHost.setup();
        ViewPager viewPager = findViewById(R.id.profile_pager);
        viewPager.setSaveEnabled(false);
        TabHost.TabSpec tabSpec = tabHost.newTabSpec(TAB_TAG_PERSONAL)
                .setContent(R.id.profile_pager)
                .setIndicator(getString(R.string.resolver_personal_tab));
+5 −0
Original line number Diff line number Diff line
@@ -1084,6 +1084,7 @@ public class ResolverDrawerLayout extends ViewGroup {
    protected Parcelable onSaveInstanceState() {
        final SavedState ss = new SavedState(super.onSaveInstanceState());
        ss.open = mCollapsibleHeight > 0 && mCollapseOffset == 0;
        ss.mCollapsibleHeightReserved = mCollapsibleHeightReserved;
        return ss;
    }

@@ -1092,6 +1093,7 @@ public class ResolverDrawerLayout extends ViewGroup {
        final SavedState ss = (SavedState) state;
        super.onRestoreInstanceState(ss.getSuperState());
        mOpenOnLayout = ss.open;
        mCollapsibleHeightReserved = ss.mCollapsibleHeightReserved;
    }

    public static class LayoutParams extends MarginLayoutParams {
@@ -1142,6 +1144,7 @@ public class ResolverDrawerLayout extends ViewGroup {

    static class SavedState extends BaseSavedState {
        boolean open;
        private int mCollapsibleHeightReserved;

        SavedState(Parcelable superState) {
            super(superState);
@@ -1150,12 +1153,14 @@ public class ResolverDrawerLayout extends ViewGroup {
        private SavedState(Parcel in) {
            super(in);
            open = in.readInt() != 0;
            mCollapsibleHeightReserved = in.readInt();
        }

        @Override
        public void writeToParcel(Parcel out, int flags) {
            super.writeToParcel(out, flags);
            out.writeInt(open ? 1 : 0);
            out.writeInt(mCollapsibleHeightReserved);
        }

        public static final Parcelable.Creator<SavedState> CREATOR =