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

Commit 754f737c authored by Fan Zhang's avatar Fan Zhang
Browse files

Move AppPreference to settingslib, and change imports.

Bug: 116364655
Test: robotests
Change-Id: I313272737dc7c068c47abf8ea021de7d2bea0a25
parent 2a1e5906
Loading
Loading
Loading
Loading

res/layout/preference_app.xml

deleted100644 → 0
+0 −100
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    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="@style/TextAppearance.TileTitle"
                  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="@style/TextAppearance.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="@style/TextAppearance.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>
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
    <dimen name="action_bar_switch_padding">16dip</dimen>

    <dimen name="app_icon_size">40dip</dimen>
    <dimen name="secondary_app_icon_size">32dp</dimen>
    <dimen name="min_tap_target_size">48dp</dimen>
    <dimen name="screen_margin_sides">64dip</dimen>
    <dimen name="screen_margin_top">72dip</dimen>
+14 −14
Original line number Diff line number Diff line
@@ -21,59 +21,59 @@
    android:key="app_default_settings_screen"
    android:title="@string/app_default_dashboard_title">

    <com.android.settings.widget.AppPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="assist_and_voice_input"
        android:title="@string/assist_and_voice_input_title"
        android:fragment="com.android.settings.applications.assist.ManageAssist"
        settings:searchable="false"/>

    <com.android.settings.widget.AppPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="default_browser"
        android:title="@string/default_browser_title"
        android:fragment="com.android.settings.applications.defaultapps.DefaultBrowserPicker"
        settings:keywords="@string/keywords_default_browser">
        <extra android:name="for_work" android:value="false" />
    </com.android.settings.widget.AppPreference>
    </com.android.settingslib.widget.apppreference.AppPreference>

    <com.android.settings.widget.GearPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="default_home"
        android:title="@string/home_app"
        android:fragment="com.android.settings.applications.defaultapps.DefaultHomePicker"
        settings:keywords="@string/keywords_home" />

    <com.android.settings.widget.AppPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="default_phone_app"
        android:title="@string/default_phone_title"
        android:fragment="com.android.settings.applications.defaultapps.DefaultPhonePicker"
        settings:keywords="@string/keywords_default_phone_app" />

    <com.android.settings.widget.AppPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="default_sms_app"
        android:title="@string/sms_application_title"
        android:fragment="com.android.settings.applications.defaultapps.DefaultSmsPicker"
        settings:keywords="@string/keywords_more_default_sms_app" />

    <com.android.settings.widget.AppPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="default_payment_app"
        android:title="@string/nfc_payment_settings_title"
        android:summary="@string/summary_placeholder"
        android:fragment="com.android.settings.nfc.PaymentSettings"
        settings:keywords="@string/keywords_default_payment_app"/>

    <com.android.settings.widget.AppPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="default_emergency_app"
        android:title="@string/default_emergency_app"
        settings:keywords="@string/keywords_emergency_app" />

    <!--
    <com.android.settings.widget.AppPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="default_notification_asst_app"
        android:title="@string/default_notification_assistant"
        android:fragment="com.android.settings.applications.defaultapps.DefaultNotificationAssistantPicker"
        />
     -->

    <com.android.settings.widget.AppPreference
    <com.android.settingslib.widget.apppreference.AppPreference
        android:key="domain_urls"
        android:title="@string/domain_urls_title"
        android:fragment="com.android.settings.applications.managedomainurls.ManageDomainUrls"
@@ -83,21 +83,21 @@
        android:key="work_app_defaults"
        android:title="@string/default_for_work">

        <com.android.settings.widget.AppPreference
        <com.android.settingslib.widget.apppreference.AppPreference
            android:key="work_default_browser"
            android:title="@string/default_browser_title"
            android:fragment="com.android.settings.applications.defaultapps.DefaultBrowserPicker"
            settings:searchable="false">
            <extra android:name="for_work" android:value="true" />
        </com.android.settings.widget.AppPreference>
        </com.android.settingslib.widget.apppreference.AppPreference>

        <com.android.settings.widget.AppPreference
        <com.android.settingslib.widget.apppreference.AppPreference
            android:key="work_default_phone_app"
            android:title="@string/default_phone_title"
            android:fragment="com.android.settings.applications.defaultapps.DefaultPhonePicker"
            settings:searchable="false">
            <extra android:name="for_work" android:value="true" />
        </com.android.settings.widget.AppPreference>
        </com.android.settingslib.widget.apppreference.AppPreference>

    </com.android.settings.widget.WorkOnlyCategory>

+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import androidx.preference.Preference.OnPreferenceClickListener;

import com.android.settings.Utils;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.widget.AppPreference;
import com.android.settingslib.widget.apppreference.AppPreference;

public class AccountTypePreference extends AppPreference implements OnPreferenceClickListener {
    /**
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import android.text.TextUtils;
import android.text.format.Formatter;
import android.util.Log;

import com.android.settings.widget.AppPreference;
import com.android.settingslib.widget.apppreference.AppPreference;

public class ProcessStatsPreference extends AppPreference {
    static final String TAG = "ProcessStatsPreference";
Loading