From 5f416b9452acfcbf28f5541d18c5667610e0eb9b Mon Sep 17 00:00:00 2001 From: arangelov Date: Wed, 17 Jun 2020 13:12:09 +0100 Subject: [PATCH] Re-setup viewpager on configuration change for RTL languages Otherwise rotating the device while showing a tab with RTL shows blank tab content. This could be due to ViewPager bugs when handling RTL. Fixes: 158862939 Test: manually rotating the device with RTL layout Test: manually rotating the device with LTR layout Change-Id: Iba4c71cf88747d6fbbc36d19b5102460e8aa7cec --- core/java/com/android/internal/app/ChooserActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java index 0a1e3a0caeff6..e0b67da3bcd47 100644 --- a/core/java/com/android/internal/app/ChooserActivity.java +++ b/core/java/com/android/internal/app/ChooserActivity.java @@ -1063,6 +1063,10 @@ public class ChooserActivity extends ResolverActivity implements @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); + ViewPager viewPager = findViewById(R.id.profile_pager); + if (shouldShowTabs() && viewPager.isLayoutRtl()) { + mMultiProfilePagerAdapter.setupViewPager(viewPager); + } mShouldDisplayLandscape = shouldDisplayLandscape(newConfig.orientation); adjustPreviewWidth(newConfig.orientation, null);