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

Commit 929b1490 authored by Stanley Wang's avatar Stanley Wang
Browse files

Create preference widget to support Lottie illustrations.

Fixes: 186409607
Test: run robo test and see the UI
Change-Id: Ie78e6585dfe0aefeb6ffa50db3935e59010648f5
parent 5d9fa906
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ java_defaults {
        "SettingsLibAppPreference",
        "SettingsLibSearchWidget",
        "SettingsLibSettingsSpinner",
        "SettingsLibIllustrationPreference",
        "SettingsLibLayoutPreference",
        "SettingsLibMainSwitchPreference",
        "SettingsLibActionButtonsPreference",
+23 −0
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_base_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_base_license"],
}

android_library {
    name: "SettingsLibIllustrationPreference",

    srcs: ["src/**/*.java"],
    resource_dirs: ["res"],

    static_libs: [
        "androidx.preference_preference",
        "lottie",
    ],

    sdk_version: "system_current",
    min_sdk_version: "21",
}
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2021 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.android.settingslib.widget">

    <uses-sdk android:minSdkVersion="21" />

</manifest>
+24 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2021 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="48.0"
        android:viewportHeight="48.0">
    <path android:fillColor="#FFFFFF" android:pathData="M24,24m-19,0a19,19 0,1 1,38 0a19,19 0,1 1,-38 0"/>
    <path android:fillColor="#1A73E8" android:pathData="M20,33l12,-9l-12,-9z"/>
    <path android:fillColor="#1A73E8" android:pathData="M24,4C12.96,4 4,12.96 4,24s8.96,20 20,20s20,-8.96 20,-20S35.04,4 24,4zM24,40c-8.82,0 -16,-7.18 -16,-16S15.18,8 24,8s16,7.18 16,16S32.82,40 24,40z"/>
</vector>
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2021 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:top="@dimen/settingslib_illustration_padding"
        android:left="@dimen/settingslib_illustration_padding"
        android:right="@dimen/settingslib_illustration_padding"
        android:bottom="@dimen/settingslib_illustration_padding">
        <shape android:shape="rectangle">
            <solid android:color="@color/settingslib_protection_color"/>
            <corners android:radius="28dp"/>
        </shape>
    </item>
</layer-list>
Loading