Add the max height restriction into the illustration view.

Bug: 191721423
Test: manual test
Change-Id: I3829ead500eaf586f6d543855690ee8f0d0913ff
This commit is contained in:
Peter_Liang
2021-09-11 15:16:35 +08:00
parent d24f289548
commit af5f355b35
2 changed files with 28 additions and 0 deletions

View File

@@ -406,10 +406,13 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
return;
}
final int displayHalfHeight =
AccessibilityUtil.getDisplayBounds(getPrefContext()).height() / 2;
final IllustrationPreference illustrationPreference =
new IllustrationPreference(getPrefContext());
illustrationPreference.setImageUri(mImageUri);
illustrationPreference.setSelectable(false);
illustrationPreference.setMaxHeight(displayHalfHeight);
illustrationPreference.setKey(KEY_ANIMATED_IMAGE);
getPreferenceScreen().addPreference(illustrationPreference);