1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2018 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16
17<!-- Layout used by SeekBarPreference for the seekbar widget style. -->
18<LinearLayout
19    xmlns:android="http://schemas.android.com/apk/res/android"
20    xmlns:app="http://schemas.android.com/apk/res-auto"
21    android:layout_width="match_parent"
22    android:layout_height="wrap_content"
23    android:minHeight="?android:attr/listPreferredItemHeight"
24    android:gravity="center_vertical"
25    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
26    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
27    android:clipChildren="false"
28    android:clipToPadding="false">
29
30    <LinearLayout
31        android:id="@+id/icon_frame"
32        android:layout_width="wrap_content"
33        android:layout_height="wrap_content"
34        android:layout_marginStart="-4dp"
35        android:minWidth="60dp"
36        android:gravity="start|center_vertical"
37        android:orientation="horizontal"
38        android:paddingStart="4dp"
39        android:paddingEnd="8dp"
40        android:paddingTop="4dp"
41        android:paddingBottom="4dp">
42        <androidx.preference.internal.PreferenceImageView
43            android:id="@android:id/icon"
44            android:layout_width="wrap_content"
45            android:layout_height="wrap_content"
46            app:maxWidth="48dp"
47            app:maxHeight="48dp" />
48    </LinearLayout>
49
50    <RelativeLayout
51        android:layout_width="0dp"
52        android:layout_height="wrap_content"
53        android:layout_marginEnd="8dip"
54        android:layout_marginTop="6dip"
55        android:layout_marginBottom="6dip"
56        android:layout_weight="1"
57        android:clipChildren="false"
58        android:clipToPadding="false">
59
60        <TextView
61            android:id="@android:id/title"
62            android:layout_width="wrap_content"
63            android:layout_height="wrap_content"
64            android:singleLine="true"
65            android:textAppearance="@style/Preference_TextAppearanceMaterialSubhead"
66            android:ellipsize="marquee"
67            android:fadingEdge="horizontal"/>
68
69        <TextView
70            android:id="@android:id/summary"
71            android:layout_width="wrap_content"
72            android:layout_height="wrap_content"
73            android:layout_below="@android:id/title"
74            android:layout_alignStart="@android:id/title"
75            android:textAppearance="?android:attr/textAppearanceSmall"
76            android:textColor="?android:attr/textColorSecondary"
77            android:maxLines="4"/>
78
79        <!-- Using UnPressableLinearLayout as a workaround to disable the pressed state propagation
80        to the children of this container layout. Otherwise, the animated pressed state will also
81        play for the thumb in the AbsSeekBar in addition to the preference's ripple background.
82        The background of the SeekBar is also set to null to disable the ripple background -->
83        <androidx.preference.UnPressableLinearLayout
84            android:layout_width="match_parent"
85            android:layout_height="wrap_content"
86            android:layout_below="@android:id/summary"
87            android:layout_alignStart="@android:id/title"
88            android:clipChildren="false"
89            android:clipToPadding="false">
90            <SeekBar
91                android:id="@+id/seekbar"
92                android:layout_width="0dp"
93                android:layout_weight="1"
94                android:layout_height="wrap_content"
95                android:paddingStart="@dimen/preference_seekbar_padding_start"
96                android:paddingEnd="@dimen/preference_seekbar_padding_end"
97                android:focusable="false"
98                android:clickable="false"
99                android:background="@null" />
100
101            <TextView
102                android:id="@+id/seekbar_value"
103                android:layout_width="@dimen/preference_seekbar_value_width"
104                android:layout_height="match_parent"
105                android:gravity="right|center_vertical"
106                android:fontFamily="sans-serif-condensed"
107                android:singleLine="true"
108                android:textAppearance="@style/Preference_TextAppearanceMaterialSubhead"
109                android:ellipsize="marquee"
110                android:fadingEdge="horizontal"
111                android:scrollbars="none"/>
112        </androidx.preference.UnPressableLinearLayout>
113
114    </RelativeLayout>
115
116</LinearLayout>
117