Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 444ddc6c authored by Stanley Wang's avatar Stanley Wang
Browse files

Refine the IllustrationPreference.

- If we set a fixed height for the illustration and automatically
  scale the width of the illustration, the size of the background
  layer will be different from the size of the illustration. To
  fix this problem, we must make the background layer the same
  size as the illustration and automatically scale.
- Update the size of background to 412x300.
- Update the layout of frame's child views to wrap_content.
- Update the padding of frame to 16dp.

Bug: 190810977
Test: robotest and see the UI

Change-Id: I0422f91c24860154fea7c766d5670c314d62bebb
parent 023fa143
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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>
+12 −10
Original line number Diff line number Diff line
@@ -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"/>
+1 −1
Original line number Diff line number Diff line
@@ -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>