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

Commit a3be13c5 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Call setAdapter from handleLayoutChange for the other profile" into rvc-dev am: 5527ace0

Change-Id: Ie14d3463748c8bf4da051f63f02daa8c328af17c
parents 2e4d4808 5527ace0
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -2398,17 +2398,20 @@ public class ChooserActivity extends ResolverActivity implements
        }

        final int availableWidth = right - left - v.getPaddingLeft() - v.getPaddingRight();
        if (mChooserMultiProfilePagerAdapter.getCurrentUserHandle() != getUser()) {
            gridAdapter.calculateChooserTargetWidth(availableWidth);
            return;
        }

        if (gridAdapter.consumeLayoutRequest()
        boolean isLayoutUpdated = gridAdapter.consumeLayoutRequest()
                || gridAdapter.calculateChooserTargetWidth(availableWidth)
                || recyclerView.getAdapter() == null
                || mLastNumberOfChildren != recyclerView.getChildCount()
                || availableWidth != mCurrAvailableWidth) {
                || availableWidth != mCurrAvailableWidth;
        if (isLayoutUpdated
                || mLastNumberOfChildren != recyclerView.getChildCount()) {
            mCurrAvailableWidth = availableWidth;
            if (isLayoutUpdated
                    && mChooserMultiProfilePagerAdapter.getCurrentUserHandle() != getUser()) {
                // This fixes b/150936654 - empty work tab in share sheet when swiping
                mChooserMultiProfilePagerAdapter.getActiveAdapterView()
                        .setAdapter(mChooserMultiProfilePagerAdapter.getCurrentRootAdapter());
                return;
            }

            getMainThreadHandler().post(() -> {
                if (mResolverDrawerLayout == null || gridAdapter == null) {