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

Commit aa8e4e32 authored by Edgar Wang's avatar Edgar Wang Committed by Android (Google) Code Review
Browse files

Merge "Update Preference style" into sc-dev

parents a1398df0 3b2a339f
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@
    android:background="?android:attr/selectableItemBackground"
    android:background="?android:attr/selectableItemBackground"
    android:gravity="center_vertical"
    android:gravity="center_vertical"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingStart="@dimen/app_preference_padding_start"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">


    <LinearLayout
    <LinearLayout
@@ -29,7 +29,7 @@
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="start|center_vertical"
        android:gravity="start|center_vertical"
        android:minWidth="56dp"
        android:minWidth="@dimen/app_icon_min_width"
        android:orientation="horizontal"
        android:orientation="horizontal"
        android:paddingEnd="8dp"
        android:paddingEnd="8dp"
        android:paddingTop="4dp"
        android:paddingTop="4dp"
+1 −0
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:background="?android:attr/selectableItemBackground"
    android:background="?android:attr/selectableItemBackground"
    android:orientation="vertical"
    android:clipToPadding="false">
    android:clipToPadding="false">


    <LinearLayout
    <LinearLayout
+40 −0
Original line number Original line 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.
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/icon_frame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:minWidth="@dimen/icon_min_width"
    android:gravity="start|center_vertical"
    android:orientation="horizontal"
    android:paddingLeft="0dp"
    android:paddingStart="0dp"
    android:paddingRight="8dp"
    android:paddingEnd="8dp"
    android:paddingTop="4dp"
    android:paddingBottom="4dp">

    <androidx.preference.internal.PreferenceImageView
        android:id="@android:id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:maxWidth="48dp"
        app:maxHeight="48dp"/>

</LinearLayout>
+35 −0
Original line number Original line 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.
  -->

<!-- We use a FrameLayout as we want to place the invisible spinner on top of the other views -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <!-- This spinner should be invisible in the layout and take up no space, when the Preference
         is clicked the dropdown will appear from this location on screen. -->
    <Spinner
        android:id="@+id/spinner"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/preference_dropdown_padding_start"
        android:layout_marginLeft="@dimen/preference_dropdown_padding_start"
        android:visibility="invisible" />

    <include layout="@layout/settings_preference" />

</FrameLayout>
 No newline at end of file
+76 −0
Original line number Original line Diff line number Diff line
@@ -19,33 +19,35 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_height="wrap_content"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:gravity="center_vertical"
    android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingRight="?android:attr/listPreferredItemPaddingRight"
    android:paddingRight="?android:attr/listPreferredItemPaddingRight"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:background="?android:attr/selectableItemBackground"
    android:background="?android:attr/selectableItemBackground"
    android:baselineAligned="false"
    android:clipToPadding="false"
    android:layout_marginTop="16dp"
    android:baselineAligned="false">
    android:gravity="center_vertical"

    style="@style/PreferenceCategoryStartMargin">
    <include layout="@layout/image_frame"/>


    <RelativeLayout
    <RelativeLayout
        android:layout_width="0dp"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_weight="1"
        android:paddingTop="8dp"
        android:paddingTop="16dp"
        android:paddingBottom="8dp">
        android:paddingBottom="16dp">


        <TextView
        <TextView
            android:id="@android:id/title"
            android:id="@android:id/title"
            android:layout_width="match_parent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:singleLine="true"
            android:textAlignment="viewStart"
            android:textAppearance="?android:attr/textAppearanceListItem"
            style="@style/PreferenceCategoryTitleTextStyle"/>
            android:ellipsize="marquee"/>


        <TextView
        <TextView
            android:id="@android:id/summary"
            android:id="@android:id/summary"
            android:ellipsize="end"
            android:singleLine="true"
            android:layout_width="wrap_content"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@android:id/title"
            android:layout_below="@android:id/title"
@@ -56,5 +58,19 @@
            android:textColor="?android:attr/textColorSecondary"
            android:textColor="?android:attr/textColorSecondary"
            android:maxLines="10"
            android:maxLines="10"
            style="@style/PreferenceSummaryTextStyle"/>
            style="@style/PreferenceSummaryTextStyle"/>

    </RelativeLayout>
    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout
        android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="end|center_vertical"
        android:paddingLeft="16dp"
        android:paddingStart="16dp"
        android:paddingRight="0dp"
        android:paddingEnd="0dp"
        android:orientation="vertical"/>

</LinearLayout>
</LinearLayout>
 No newline at end of file
Loading