Merge "Fix the preview should keep the same layer after font or display size change."

This commit is contained in:
PETER LIANG
2022-12-06 09:47:59 +00:00
committed by Android (Google) Code Review
4 changed files with 70 additions and 10 deletions

View File

@@ -129,6 +129,17 @@ public class TextReadingPreviewPreferenceTest {
verify(mPreviewPagerAdapter).setPreviewLayer(eq(index), anyInt(), anyInt(), anyBoolean());
}
@Test
public void afterPagerChange_updateCurrentItem() {
final int currentItem = 2;
mTextReadingPreviewPreference.setPreviewAdapter(mPreviewPagerAdapter);
mTextReadingPreviewPreference.onBindViewHolder(mHolder);
mViewPager.setCurrentItem(currentItem);
assertThat(mTextReadingPreviewPreference.getCurrentItem()).isEqualTo(currentItem);
}
private static Configuration[] createConfigurations(int count) {
final Configuration[] configurations = new Configuration[count];
for (int i = 0; i < count; i++) {