summaryrefslogtreecommitdiff
path: root/car-qc-lib/res/layout/qc_row_view.xml
blob: 6656b29a7e155d891ad61d426cd5e70699c88a62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?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.
  -->

<com.android.car.ui.uxr.DrawableStateConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_marginVertical="@dimen/qc_row_margin_vertical"
    android:clipToPadding="false"
    android:minHeight="@dimen/qc_row_min_height"
    android:paddingEnd="@dimen/qc_row_padding_end"
    android:paddingStart="@dimen/qc_row_padding_start">

    <LinearLayout
        android:id="@+id/qc_row_start_items"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/qc_action_items_horizontal_margin"
        android:orientation="horizontal"
        android:divider="@drawable/qc_row_action_divider"
        android:showDividers="middle"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/qc_row_content"
        app:layout_constraintHorizontal_chainStyle="spread_inside"/>

    <com.android.car.ui.uxr.DrawableStateConstraintLayout
        android:id="@+id/qc_row_content"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="?android:attr/selectableItemBackground"
        app:layout_constraintStart_toEndOf="@+id/qc_row_start_items"
        app:layout_constraintEnd_toStartOf="@+id/qc_row_end_items"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHeight_default="wrap"
        app:layout_constraintHeight_min="@dimen/qc_row_min_height">

        <com.android.car.ui.uxr.DrawableStateImageView
            android:id="@+id/qc_icon"
            android:layout_width="@dimen/qc_row_icon_size"
            android:layout_height="@dimen/qc_row_icon_size"
            android:layout_marginEnd="@dimen/qc_row_icon_margin_end"
            android:scaleType="fitCenter"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/barrier1"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toTopOf="@+id/barrier2"/>

        <androidx.constraintlayout.widget.Barrier
            android:id="@+id/barrier1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:barrierDirection="end"
            app:constraint_referenced_ids="qc_icon"
            app:barrierAllowsGoneWidgets="false"/>

        <com.android.car.ui.uxr.DrawableStateTextView
            android:id="@+id/qc_title"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.QC.Title"
            app:layout_constraintStart_toEndOf="@+id/barrier1"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toTopOf="@+id/qc_summary"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintVertical_chainStyle="packed"/>

        <com.android.car.ui.uxr.DrawableStateTextView
            android:id="@+id/qc_summary"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:textAppearance="@style/TextAppearance.QC.Subtitle"
            app:layout_constraintStart_toEndOf="@+id/barrier1"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/qc_title"
            app:layout_constraintBottom_toTopOf="@+id/barrier2"/>

        <androidx.constraintlayout.widget.Barrier
            android:id="@+id/barrier2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:barrierDirection="top"
            app:constraint_referenced_ids="qc_seekbar_wrapper"
            app:barrierAllowsGoneWidgets="false"/>

        <androidx.preference.UnPressableLinearLayout
            android:id="@+id/qc_seekbar_wrapper"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:paddingTop="@dimen/qc_seekbar_padding_top"
            android:focusable="true"
            android:background="@drawable/qc_seekbar_wrapper_background"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:layout_centerVertical="true"
            android:orientation="vertical"
            android:visibility="gone"
            app:layout_constraintStart_toEndOf="@+id/barrier1"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/barrier2"
            app:layout_constraintBottom_toBottomOf="parent">
            <com.android.car.qc.view.QCSeekBarView
                android:id="@+id/seekbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/Widget.QC.SeekBar"/>
        </androidx.preference.UnPressableLinearLayout>

    </com.android.car.ui.uxr.DrawableStateConstraintLayout>

    <LinearLayout
        android:id="@+id/qc_row_end_items"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/qc_action_items_horizontal_margin"
        android:orientation="horizontal"
        android:divider="@drawable/qc_row_action_divider"
        android:showDividers="middle"
        app:layout_constraintStart_toEndOf="@+id/qc_row_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"/>

</com.android.car.ui.uxr.DrawableStateConstraintLayout>