From d53e689d7391fa2bac95f7e5b192c365762058f9 Mon Sep 17 00:00:00 2001 From: Peter_Liang Date: Mon, 27 Sep 2021 16:30:52 +0800 Subject: [PATCH] Fix the bounds of the illustration view is larger than the background view in a foldable device. Actions: 1) Restrict the bounds of view. 2) Fix the background view of illustrationPreference was not centered in a foldable device. Bug: 201254287 Test: make RunSettingsLibRoboTests ROBOTEST_FILTER=com.android.settingslib.widget.IllustrationPreferenceTest Change-Id: Id714e0a578dc0440a24ede43a2a38e1258058248 --- .../res/layout/illustration_preference.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/SettingsLib/IllustrationPreference/res/layout/illustration_preference.xml b/packages/SettingsLib/IllustrationPreference/res/layout/illustration_preference.xml index 54145d60fb32b..c8cf56e2c0606 100644 --- a/packages/SettingsLib/IllustrationPreference/res/layout/illustration_preference.xml +++ b/packages/SettingsLib/IllustrationPreference/res/layout/illustration_preference.xml @@ -36,15 +36,18 @@ + android:layout_gravity="center" + android:maxWidth="@dimen/settingslib_illustration_width" + android:maxHeight="@dimen/settingslib_illustration_height" + android:adjustViewBounds="true"/>