1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  Copyright (C) 2024 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<!-- Based off preference_single_target.xml with buttons added below text. -->
19<LinearLayout
20    xmlns:android="http://schemas.android.com/apk/res/android"
21    xmlns:app="http://schemas.android.com/apk/res-auto"
22    xmlns:settings="http://schemas.android.com/apk/res-auto"
23    android:layout_width="match_parent"
24    android:layout_height="wrap_content"
25    android:minHeight="?android:attr/listPreferredItemHeightSmall"
26    android:gravity="center_vertical"
27    android:orientation="vertical"
28    android:background="?android:attr/selectableItemBackground"
29    android:clipToPadding="false">
30
31    <LinearLayout
32        android:layout_width="match_parent"
33        android:layout_height="wrap_content"
34        android:layout_weight="1"
35        android:orientation="horizontal"
36        android:gravity="start|center_vertical"
37        android:clipToPadding="false"
38        android:paddingStart="?android:attr/listPreferredItemPaddingStart"
39        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
40
41        <LinearLayout
42            android:id="@+id/icon_frame"
43            android:layout_width="wrap_content"
44            android:layout_height="wrap_content"
45            android:gravity="start|center_vertical"
46            android:minWidth="56dp"
47            android:orientation="horizontal"
48            android:clipToPadding="false"
49            android:paddingTop="4dp"
50            android:paddingBottom="4dp">
51            <androidx.preference.internal.PreferenceImageView
52                android:id="@android:id/icon"
53                android:layout_width="wrap_content"
54                android:layout_height="wrap_content"
55                settings:maxWidth="48dp"
56                settings:maxHeight="48dp" />
57        </LinearLayout>
58
59        <RelativeLayout
60            android:layout_width="wrap_content"
61            android:layout_height="wrap_content"
62            android:layout_weight="1"
63            android:paddingTop="16dp"
64            android:paddingBottom="16dp">
65
66            <TextView
67                android:id="@android:id/title"
68                android:layout_width="wrap_content"
69                android:layout_height="wrap_content"
70                android:singleLine="true"
71                android:textAppearance="?android:attr/textAppearanceListItem"
72                android:ellipsize="marquee" />
73
74            <TextView
75                android:id="@android:id/summary"
76                android:layout_width="wrap_content"
77                android:layout_height="wrap_content"
78                android:layout_below="@android:id/title"
79                android:layout_alignStart="@android:id/title"
80                android:textAppearance="?android:attr/textAppearanceListItemSecondary"
81                android:textColor="?android:attr/textColorSecondary"
82                android:hyphenationFrequency="normalFast"
83                android:lineBreakWordStyle="phrase"
84                android:maxLines="10" />
85
86        </RelativeLayout>
87
88    </LinearLayout>
89
90    <!-- Preference should place its actual preference widget here. -->
91    <LinearLayout
92        android:id="@android:id/widget_frame"
93        android:layout_width="wrap_content"
94        android:layout_height="match_parent"
95        android:minWidth="@dimen/two_target_min_width"
96        android:gravity="center"
97        android:orientation="vertical" />
98
99    <androidx.constraintlayout.widget.ConstraintLayout
100        android:id="@+id/credman_button_frame"
101        android:layout_width="wrap_content"
102        android:layout_height="wrap_content"
103        android:gravity="start|center_vertical"
104        android:minWidth="56dp"
105        android:clipToPadding="false"
106        android:paddingTop="4dp"
107        android:paddingLeft="76dp"
108        android:paddingBottom="4dp">
109
110        <androidx.constraintlayout.helper.widget.Flow
111            android:id="@+id/button_flow"
112            android:layout_width="match_parent"
113            android:layout_height="wrap_content"
114            app:constraint_referenced_ids="change_button, open_button"
115            app:flow_horizontalStyle="spread_inside"
116            app:flow_wrapMode="chain"
117            app:flow_verticalGap = "16dp"
118            app:layout_constraintEnd_toEndOf="parent"
119            app:layout_constraintStart_toStartOf="parent"
120            app:layout_constraintTop_toTopOf="parent" />
121
122            <Button
123                android:id="@+id/change_button"
124                android:layout_width="match_parent"
125                style="@style/CredentialManagerChangeButton"
126                android:layout_height="wrap_content"
127                android:text="@string/credman_button_change"/>
128
129            <Button
130                android:id="@+id/open_button"
131                style="@style/CredentialManagerOpenButton"
132                android:layout_width="match_parent"
133                android:layout_height="wrap_content"
134                android:visibility="gone"
135                android:text="@string/credman_button_open"/>
136
137    </androidx.constraintlayout.widget.ConstraintLayout>
138
139</LinearLayout>