Fix the display/Font preview window appears blank while transitioning between sizes.

Action:
Using post messages to update the UI to avoid the timing issue.

Bug: 223665259
Test: make RunSettingsRoboTests ROBOTEST_FILTER=PreviewSizeSeekBarControllerTest
Change-Id: I31ef0d50a417fb76d14c1caf21926f1618ac3c4f
This commit is contained in:
Peter Liang
2022-12-20 17:51:16 +08:00
parent a3cb36777b
commit 06b1ebbbea
2 changed files with 15 additions and 1 deletions

View File

@@ -48,7 +48,9 @@ class PreviewSizeSeekBarController extends BasePreferenceController implements
final ProgressInteractionListener interactionListener =
mInteractionListener.get();
interactionListener.notifyPreferenceChanged();
// Avoid timing issues to update the corresponding preview fail when clicking
// the increase/decrease button.
seekBar.post(interactionListener::notifyPreferenceChanged);
if (!mSeekByTouch) {
interactionListener.onProgressChanged();