diff options
| author | 2021-07-02 14:23:38 +0000 | |
|---|---|---|
| committer | 2021-07-02 14:23:38 +0000 | |
| commit | 39ee79bd8a17575ee949923b1e8f8a7939358b4e (patch) | |
| tree | 858e510b12009afeb7d65ccf13d79c3df52db1e5 | |
| parent | 4d338c28dcaf2e96d331dd3bdcee94d8896a3689 (diff) | |
| parent | 444ddc6c906bee50fa931f4d83ea649571971793 (diff) | |
Merge "Refine the IllustrationPreference." into sc-dev
3 files changed, 15 insertions, 11 deletions
diff --git a/packages/SettingsLib/IllustrationPreference/res/drawable/protection_background.xml b/packages/SettingsLib/IllustrationPreference/res/drawable/protection_background.xml index 0734aca2ab90..a027f287a0aa 100644 --- a/packages/SettingsLib/IllustrationPreference/res/drawable/protection_background.xml +++ b/packages/SettingsLib/IllustrationPreference/res/drawable/protection_background.xml @@ -20,6 +20,8 @@ <shape android:shape="rectangle"> <solid android:color="@color/settingslib_protection_color"/> <corners android:radius="28dp"/> + <size android:width="@dimen/settingslib_illustration_width" + android:height="@dimen/settingslib_illustration_height"/> </shape> </item> </layer-list> diff --git a/packages/SettingsLib/IllustrationPreference/res/layout/illustration_preference.xml b/packages/SettingsLib/IllustrationPreference/res/layout/illustration_preference.xml index efcd41c2778b..54145d60fb32 100644 --- a/packages/SettingsLib/IllustrationPreference/res/layout/illustration_preference.xml +++ b/packages/SettingsLib/IllustrationPreference/res/layout/illustration_preference.xml @@ -27,27 +27,29 @@ <FrameLayout android:id="@+id/illustration_frame" android:layout_width="wrap_content" - android:layout_height="@dimen/settingslib_illustration_height" + android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center_vertical" - android:padding="@dimen/settingslib_illustration_padding" + android:paddingHorizontal="@dimen/settingslib_illustration_padding" android:orientation="vertical"> - <View - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@drawable/protection_background"/> + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:scaleType="centerInside" + android:src="@drawable/protection_background"/> <com.airbnb.lottie.LottieAnimationView android:id="@+id/lottie_view" - android:layout_width="match_parent" - android:layout_height="match_parent" + android:adjustViewBounds="true" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_gravity="center" /> <FrameLayout android:id="@+id/middleground_layout" - android:layout_width="match_parent" - android:layout_height="match_parent" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:background="@android:color/transparent" android:layout_gravity="center" android:visibility="gone"/> diff --git a/packages/SettingsLib/IllustrationPreference/res/values/dimens.xml b/packages/SettingsLib/IllustrationPreference/res/values/dimens.xml index 3f38769973db..fc273dc7403b 100644 --- a/packages/SettingsLib/IllustrationPreference/res/values/dimens.xml +++ b/packages/SettingsLib/IllustrationPreference/res/values/dimens.xml @@ -17,7 +17,7 @@ <resources> <!-- Padding of illustration --> - <dimen name="settingslib_illustration_padding">12dp</dimen> + <dimen name="settingslib_illustration_padding">16dp</dimen> <dimen name="settingslib_illustration_width">412dp</dimen> <dimen name="settingslib_illustration_height">300dp</dimen> |