• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  Copyright (C) 2018 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_material_settings.xml except that the ripple effect is active only on
19     the left side. -->
20<LinearLayout
21    xmlns:android="http://schemas.android.com/apk/res/android"
22    android:layout_width="match_parent"
23    android:layout_height="wrap_content"
24    android:minHeight="?android:attr/listPreferredItemHeightSmall"
25    android:gravity="center_vertical"
26    android:background="?android:attr/selectableItemBackground"
27    android:clipToPadding="false"
28    android:layout_marginBottom="@dimen/tp_preference_item_margin_bottom"
29    android:paddingTop="@dimen/lb_preference_item_text_space_top"
30    android:paddingBottom="@dimen/lb_preference_item_text_space_bottom"
31    android:paddingStart="@dimen/lb_preference_item_padding_start"
32    android:paddingEnd="@dimen/tp_access_point_padding_end">
33
34    <LinearLayout
35        android:layout_width="0dp"
36        android:layout_height="match_parent"
37        android:layout_weight="1"
38        android:duplicateParentState="true"
39        android:background="?android:attr/selectableItemBackground"
40        android:gravity="start|center_vertical"
41        android:clipToPadding="false">
42
43        <FrameLayout
44                android:id="@+id/icon_frame"
45                android:layout_width="wrap_content"
46                android:layout_height="wrap_content"
47                android:layout_gravity="center_vertical"
48                android:duplicateParentState="true">
49            <ImageView
50                    android:id="@android:id/icon"
51                    android:layout_width="@dimen/lb_preference_item_icon_size"
52                    android:layout_height="@dimen/lb_preference_item_icon_size"
53                    android:layout_marginEnd="@dimen/lb_preference_item_icon_margin_end"
54                    style="?android:attr/imageButtonStyle"
55            />
56        </FrameLayout>
57
58        <RelativeLayout
59            android:layout_width="wrap_content"
60            android:layout_height="wrap_content"
61            android:layout_weight="1"
62            android:duplicateParentState="true">
63
64            <TextView
65                android:id="@android:id/title"
66                android:layout_width="wrap_content"
67                android:layout_height="wrap_content"
68                android:minHeight="@dimen/tp_preference_title_min_height"
69                android:includeFontPadding="true"
70                android:singleLine="true"
71                android:layout_marginBottom="@dimen/lb_preference_item_primary_text_margin_bottom"
72                android:duplicateParentState="true"
73                android:textAppearance="?android:attr/textAppearanceListItem"
74                android:ellipsize="marquee" />
75
76            <TextView
77                android:id="@android:id/summary"
78                android:layout_width="wrap_content"
79                android:layout_height="wrap_content"
80                android:layout_below="@android:id/title"
81                android:layout_alignStart="@android:id/title"
82                android:minHeight="@dimen/tp_preference_summary_min_height"
83                android:includeFontPadding="true"
84                android:duplicateParentState="true"
85                android:textAppearance="?android:attr/textAppearanceListItemSecondary"
86                android:maxLines="10" />
87
88        </RelativeLayout>
89
90    </LinearLayout>
91
92    <include layout="@layout/preference_two_target_divider" />
93
94    <!-- Preference should place its actual preference widget here. -->
95    <LinearLayout
96        android:id="@android:id/widget_frame"
97        android:layout_width="wrap_content"
98        android:layout_height="match_parent"
99        android:duplicateParentState="true"
100        android:minWidth="64dp"
101        android:gravity="center_vertical"
102        android:orientation="vertical" />
103
104</LinearLayout>
105