Align dropdown preference's dropdown with preference text
Change-Id: I9446758464fd9220a2670df4203406ba49e24901
Fix: 35807231
Test: RunSettingsRoboTests
diff --git a/res/layout/preference_dropdown_material_settings.xml b/res/layout/preference_dropdown_material_settings.xml
index ee4051d..22f98b6 100644
--- a/res/layout/preference_dropdown_material_settings.xml
+++ b/res/layout/preference_dropdown_material_settings.xml
@@ -18,72 +18,18 @@
<!-- Based off frameworks/base/core/res/res/layout/preference_dropdown_material.xml
except that icon space in this layout is always reserved -->
-<LinearLayout
+<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeightSmall"
- android:gravity="center_vertical"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
- android:background="?android:attr/selectableItemBackground"
- android:clipToPadding="false">
+ android:layout_height="wrap_content">
<Spinner
android:id="@+id/spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/preference_no_icon_padding_start"
android:visibility="invisible" />
- <LinearLayout
- android:id="@+id/icon_container"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:minWidth="60dp"
- android:gravity="start|center_vertical"
- android:orientation="horizontal"
- android:paddingEnd="12dp"
- android:paddingTop="4dp"
- android:paddingBottom="4dp">
- <android.support.v7.internal.widget.PreferenceImageView
- android:id="@android:id/icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:maxWidth="48dp"
- android:maxHeight="48dp" />
- </LinearLayout>
+ <include layout="@layout/preference_material_settings"/>
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- 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/Preference_TextAppearanceMaterialSubhead"
- android:ellipsize="marquee" />
-
- <TextView android:id="@android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@android:id/title"
- android:layout_alignLeft="@android:id/title"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:maxLines="10" />
-
- </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:orientation="vertical" />
-
-</LinearLayout>
\ No newline at end of file
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/restricted_preference_dropdown.xml b/res/layout/restricted_preference_dropdown.xml
index fd0d07d..c93a007 100644
--- a/res/layout/restricted_preference_dropdown.xml
+++ b/res/layout/restricted_preference_dropdown.xml
@@ -23,7 +23,8 @@
class="com.android.settings.notification.RestrictedDropDownPreference$ReselectionSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:visibility="invisible" />
+ android:visibility="invisible"
+ android:layout_marginStart="@dimen/preference_no_icon_padding_start"/>
<include layout="@layout/preference_material_settings" />