1<?xml version="1.0" encoding="utf-8"?>
2<!--
3    Copyright 2019 The Android Open Source Project
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9         http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16-->
17
18<LinearLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    android:layout_width="match_parent"
21    android:layout_height="wrap_content"
22    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
23    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
24    android:gravity="center_vertical"
25    android:minHeight="?android:attr/listPreferredItemHeightSmall"
26    android:orientation="horizontal">
27
28    <ImageView
29        android:id="@android:id/icon"
30        android:layout_width="@dimen/car_ui_preference_icon_size"
31        android:layout_height="@dimen/car_ui_preference_icon_size"
32        android:layout_marginTop="@dimen/car_ui_preference_content_margin_top"
33        android:layout_marginBottom="@dimen/car_ui_preference_content_margin_bottom"
34        android:layout_marginEnd="@dimen/car_ui_preference_icon_margin_end"
35        android:scaleType="fitCenter"
36        android:tint="@color/car_ui_preference_icon_color"/>
37
38    <RelativeLayout
39        android:layout_width="0dp"
40        android:layout_height="wrap_content"
41        android:layout_weight="1"
42        android:layout_marginTop="@dimen/car_ui_preference_content_margin_top"
43        android:layout_marginBottom="@dimen/car_ui_preference_content_margin_bottom">
44
45        <TextView
46            android:id="@android:id/title"
47            android:layout_width="wrap_content"
48            android:layout_height="wrap_content"
49            android:singleLine="true"
50            android:textAppearance="@style/TextAppearance.CarUi.PreferenceTitle"/>
51
52        <TextView
53            android:id="@android:id/summary"
54            android:layout_width="wrap_content"
55            android:layout_height="wrap_content"
56            android:layout_alignStart="@android:id/title"
57            android:layout_below="@android:id/title"
58            android:textAppearance="@style/TextAppearance.CarUi.PreferenceSummary"/>
59
60        <!-- Using UnPressableLinearLayout as a workaround to disable the pressed state propagation
61        to the children of this container layout. Otherwise, the animated pressed state will also
62        play for the thumb in the AbsSeekBar in addition to the preference's ripple background.
63        The background of the SeekBar is also set to null to disable the ripple background -->
64        <androidx.preference.UnPressableLinearLayout
65            android:layout_width="match_parent"
66            android:layout_height="wrap_content"
67            android:layout_alignStart="@android:id/title"
68            android:layout_below="@android:id/summary"
69            android:clipChildren="false"
70            android:clipToPadding="false">
71            <SeekBar
72                android:id="@+id/seekbar"
73                android:layout_width="0dp"
74                android:layout_height="wrap_content"
75                android:layout_weight="1"
76                style="@style/Widget.CarUi.SeekbarPreference.Seekbar"/>
77
78            <TextView
79                android:id="@+id/seekbar_value"
80                android:layout_width="0dp"
81                android:layout_height="0dp"
82                android:visibility="gone"/>
83        </androidx.preference.UnPressableLinearLayout>
84
85    </RelativeLayout>
86
87</LinearLayout>
88