Call setAdapter from handleLayoutChange for the other profile

Fixes: 150936654
Test: manual
Change-Id: Ida516b215ca4e42cbf89d82c115ce8f369829e3a
This commit is contained in:
arangelov
2020-03-10 18:09:39 +00:00
parent 592397e97a
commit 19e1fea590

View File

@@ -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) {