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

Commit 5b8116d6 authored by Fan Zhang's avatar Fan Zhang
Browse files

Move AppPreference to SettingsLib so other apps can use it.

Change-Id: I5240dcacdcd8b87a0965a0a9359cd7832b42e590
Fixes: 116364655
Test: robotests
parent 7ba1d9bb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ android_library {
    static_libs: [
        "SettingsLibHelpUtils",
        "SettingsLibRestrictedLockUtils",
        "SettingsLibAppPreference",
    ],

    // ANDROIDMK TRANSLATION ERROR: unsupported assignment to LOCAL_SHARED_JAVA_LIBRARIES
+13 −0
Original line number Diff line number Diff line
android_library {
    name: "SettingsLibAppPreference",

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

    libs: [
        "androidx.annotation_annotation",
        "androidx.preference_preference",
    ],
    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) 2018 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.apppreference">

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

</manifest>
+100 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 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.
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:attr/selectableItemBackground"
    android:gravity="center_vertical"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">

    <LinearLayout
        android:id="@+id/icon_frame"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="start|center_vertical"
        android:minWidth="56dp"
        android:orientation="horizontal"
        android:paddingEnd="8dp"
        android:paddingTop="4dp"
        android:paddingBottom="4dp">
        <ImageView
            android:id="@android:id/icon"
            android:layout_width="@dimen/secondary_app_icon_size"
            android:layout_height="@dimen/secondary_app_icon_size"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical"
        android:paddingTop="16dp"
        android:paddingBottom="16dp">

        <TextView android:id="@android:id/title"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:singleLine="true"
                  android:textAppearance="@android:style/TextAppearance.Material.Subhead"
                  android:ellipsize="marquee"
                  android:fadingEdge="horizontal"/>

        <LinearLayout
            android:id="@+id/summary_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="gone">
            <TextView android:id="@android:id/summary"
                      android:layout_width="0dp"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:textAppearance="@android:style/TextAppearance.Material.Small"
                      android:textAlignment="viewStart"
                      android:textColor="?android:attr/textColorSecondary"/>

            <TextView android:id="@+id/appendix"
                      android:layout_width="0dp"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:textAppearance="@android:style/TextAppearance.Material.Small"
                      android:textAlignment="viewEnd"
                      android:textColor="?android:attr/textColorSecondary"
                      android:maxLines="1"
                      android:ellipsize="end"/>
        </LinearLayout>
        <ProgressBar
            android:id="@android:id/progress"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:max="100"
            android:visibility="gone"/>
    </LinearLayout>

    <LinearLayout
        android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center"
        android:minWidth="64dp"
        android:orientation="vertical"/>

</LinearLayout>
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2018 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.
  -->

<resources>
    <dimen name="secondary_app_icon_size">32dp</dimen>
</resources>
 No newline at end of file
Loading