1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2016 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<!-- Leanback-styled Layout used for a SeekBar preference -->
18<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
19              android:layout_width="match_parent"
20              android:layout_height="wrap_content"
21              android:minHeight="?android:attr/listPreferredItemHeight"
22              android:gravity="center_vertical"
23              android:paddingStart="@dimen/lb_preference_item_padding_start"
24              android:paddingEnd="@dimen/lb_preference_item_padding_end"
25              android:clickable="true"
26              android:focusable="true"
27              android:clipChildren="false"
28              android:clipToPadding="false">
29
30    <ImageView
31            android:id="@android:id/icon"
32            android:layout_width="wrap_content"
33            android:layout_height="wrap_content"
34            android:layout_gravity="center"
35            android:minWidth="@dimen/preference_icon_minWidth"/>
36
37    <RelativeLayout
38            android:layout_width="wrap_content"
39            android:layout_height="wrap_content"
40            android:layout_marginTop="6dip"
41            android:layout_marginBottom="6dip"
42            android:layout_weight="1"
43            android:clipChildren="false"
44            android:clipToPadding="false">
45
46        <TextView android:id="@android:id/title"
47                  android:layout_width="wrap_content"
48                  android:layout_height="wrap_content"
49                  android:singleLine="true"
50                  android:layout_marginBottom="@dimen/lb_preference_item_primary_text_margin_bottom"
51                  android:fontFamily="sans-serif-condensed"
52                  android:ellipsize="marquee"
53                  android:fadingEdge="horizontal"
54                  android:textColor="@color/lb_preference_item_primary_text_color"
55                  android:textSize="@dimen/lb_preference_item_primary_text_size"/>
56
57        <TextView android:id="@android:id/summary"
58                  android:layout_width="wrap_content"
59                  android:layout_height="wrap_content"
60                  android:layout_below="@android:id/title"
61                  android:layout_alignStart="@android:id/title"
62                  android:fontFamily="sans-serif-condensed"
63                  android:textColor="@color/lb_preference_item_secondary_text_color"
64                  android:textSize="@dimen/lb_preference_item_secondary_text_size"
65                  android:maxLines="4" />
66
67        <!-- Using UnPressableLinearLayout as a workaround to disable the pressed state propagation
68        to the children of this container layout. Otherwise, the animated pressed state will also
69        play for the thumb in the AbsSeekBar in addition to the preference's ripple background.
70        The background of the SeekBar is also set to null to disable the ripple background -->
71        <androidx.preference.UnPressableLinearLayout
72                android:layout_width="match_parent"
73                android:layout_height="wrap_content"
74                android:layout_below="@android:id/summary"
75                android:layout_alignStart="@android:id/title"
76                android:clipChildren="false"
77                android:clipToPadding="false">
78            <SeekBar
79                    android:id="@+id/seekbar"
80                    android:layout_width="0dp"
81                    android:layout_weight="1"
82                    android:layout_height="wrap_content"
83                    android:paddingStart="@dimen/lb_preference_seekbar_padding_start"
84                    android:paddingEnd="@dimen/lb_preference_seekbar_padding_end"
85                    android:focusable="false"
86                    android:clickable="false"
87                    android:background="@null" />
88
89            <TextView android:id="@+id/seekbar_value"
90                      android:layout_width="@dimen/lb_preference_seekbar_value_width"
91                      android:layout_height="match_parent"
92                      android:gravity="right|center_vertical"
93                      android:fontFamily="sans-serif-condensed"
94                      android:textColor="@color/lb_preference_item_primary_text_color"
95                      android:textSize="@dimen/lb_preference_item_primary_text_size"/>
96        </androidx.preference.UnPressableLinearLayout>
97
98    </RelativeLayout>
99
100</LinearLayout>
101