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

Commit 28bf80bd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Call setAdapter from handleLayoutChanged." into rvc-dev am: bfdf19c4

Change-Id: I834b79b897ae4e54d751e3fc538461d5f783b877
parents e9e5f878 bfdf19c4
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -2418,13 +2418,20 @@ public class ChooserActivity extends ResolverActivity implements
        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());
            if (isLayoutUpdated) {
                // It is very important we call setAdapter from here. Otherwise in some cases
                // the resolver list doesn't get populated, such as b/150922090, b/150918223
                // and b/150936654
                recyclerView.setAdapter(gridAdapter);
                ((GridLayoutManager) recyclerView.getLayoutManager()).setSpanCount(
                        gridAdapter.getMaxTargetsPerRow());
            }

            if (mChooserMultiProfilePagerAdapter.getCurrentUserHandle() != getUser()) {
                return;
            } else if (mChooserMultiProfilePagerAdapter.getCurrentUserHandle() != getUser()) {
            }

            if (mLastNumberOfChildren == recyclerView.getChildCount()) {
                return;
            }