Changeset View
Changeset View
Standalone View
Standalone View
res/layout/preference_with_button.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2006 The Android Open Source Project | ||
---|---|---|---|---|---|
2 | <!-- Copyright (C) 2006 The Android Open Source Project | | |||
3 | 2 | | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | 3 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | 4 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | 5 | You may obtain a copy of the License at | ||
7 | 6 | | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | 7 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | 8 | | |||
10 | Unless required by applicable law or agreed to in writing, software | 9 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | 10 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | 12 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | 13 | limitations under the License. | ||
15 | --> | 14 | --> | ||
16 | 15 | | |||
17 | <!-- Layout for a Preference in a PreferenceActivity. The | 16 | <!-- Layout for a Preference in a PreferenceActivity. The | ||
18 | Preference is able to place a specific widget for its particular | 17 | Preference is able to place a specific widget for its particular | ||
19 | type in the "widget_frame" layout. --> | 18 | type in the "widget_frame" layout. --> | ||
20 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 19 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
21 | android:layout_width="match_parent" | 20 | android:layout_width="match_parent" | ||
22 | android:layout_height="wrap_content" | 21 | android:layout_height="wrap_content" | ||
23 | android:minHeight="?android:attr/listPreferredItemHeight" | 22 | android:background="?attr/selectableItemBackground" | ||
24 | android:gravity="center_vertical" | 23 | android:gravity="center_vertical" | ||
24 | android:minHeight="?android:attr/listPreferredItemHeight" | ||||
25 | android:paddingEnd="?android:attr/scrollbarSize" | 25 | android:paddingEnd="?android:attr/scrollbarSize" | ||
26 | android:paddingRight="?android:attr/scrollbarSize" | | |||
27 | android:paddingStart="12dip" | | |||
28 | android:paddingLeft="12dip" | 26 | android:paddingLeft="12dip" | ||
29 | android:background="?attr/selectableItemBackground"> | 27 | android:paddingRight="?android:attr/scrollbarSize" | ||
28 | android:paddingStart="12dip"> | ||||
30 | 29 | | |||
31 | <!-- Preference will place its actual preference widget here. --> | 30 | <!-- Preference will place its actual preference widget here. --> | ||
32 | <LinearLayout android:id="@android:id/widget_frame" | 31 | <LinearLayout | ||
32 | android:id="@android:id/widget_frame" | ||||
33 | android:layout_width="wrap_content" | 33 | android:layout_width="wrap_content" | ||
34 | android:layout_height="match_parent" | 34 | android:layout_height="match_parent" | ||
35 | android:gravity="center_vertical" | 35 | android:gravity="center_vertical" | ||
36 | android:orientation="vertical" /> | 36 | android:orientation="vertical" /> | ||
37 | 37 | | |||
38 | <RelativeLayout | 38 | <RelativeLayout | ||
39 | android:layout_width="0dp" | 39 | android:layout_width="0dp" | ||
40 | android:layout_height="wrap_content" | 40 | android:layout_height="wrap_content" | ||
41 | android:layout_marginStart="12dip" | 41 | android:layout_marginBottom="6dip" | ||
42 | android:layout_marginLeft="12dip" | | |||
43 | android:layout_marginEnd="4dip" | 42 | android:layout_marginEnd="4dip" | ||
43 | android:layout_marginLeft="12dip" | ||||
44 | android:layout_marginRight="4dip" | 44 | android:layout_marginRight="4dip" | ||
45 | android:layout_marginStart="12dip" | ||||
45 | android:layout_marginTop="6dip" | 46 | android:layout_marginTop="6dip" | ||
46 | android:layout_marginBottom="6dip" | | |||
47 | android:layout_weight="1"> | 47 | android:layout_weight="1"> | ||
48 | 48 | | |||
49 | <TextView android:id="@+android:id/title" | 49 | <TextView | ||
50 | android:id="@+android:id/title" | ||||
50 | android:layout_width="wrap_content" | 51 | android:layout_width="wrap_content" | ||
51 | android:layout_height="wrap_content" | 52 | android:layout_height="wrap_content" | ||
52 | android:singleLine="true" | | |||
53 | android:textAppearance="?android:attr/textAppearanceMedium" | | |||
54 | android:ellipsize="marquee" | 53 | android:ellipsize="marquee" | ||
55 | android:fadingEdge="horizontal" /> | 54 | android:fadingEdge="horizontal" | ||
55 | android:singleLine="true" | ||||
56 | android:textAppearance="?android:attr/textAppearanceMedium" /> | ||||
56 | 57 | | |||
57 | <TextView android:id="@android:id/summary" | 58 | <TextView | ||
59 | android:id="@android:id/summary" | ||||
58 | android:layout_width="wrap_content" | 60 | android:layout_width="wrap_content" | ||
59 | android:layout_height="wrap_content" | 61 | android:layout_height="wrap_content" | ||
60 | android:layout_below="@android:id/title" | | |||
61 | android:layout_alignStart="@android:id/title" | | |||
62 | android:layout_alignLeft="@android:id/title" | 62 | android:layout_alignLeft="@android:id/title" | ||
63 | android:layout_alignStart="@android:id/title" | ||||
64 | android:layout_below="@android:id/title" | ||||
65 | android:maxLines="3" | ||||
63 | android:textAppearance="?android:attr/textAppearanceSmall" | 66 | android:textAppearance="?android:attr/textAppearanceSmall" | ||
64 | android:textColor="?android:attr/textColorSecondary" | 67 | android:textColor="?android:attr/textColorSecondary" /> | ||
65 | android:maxLines="3" /> | | |||
66 | 68 | | |||
67 | </RelativeLayout> | 69 | </RelativeLayout> | ||
68 | 70 | | |||
69 | <ImageButton | 71 | <ImageButton | ||
72 | android:id="@+id/settingsButton" | ||||
70 | android:layout_width="wrap_content" | 73 | android:layout_width="wrap_content" | ||
71 | android:layout_height="wrap_content" | 74 | android:layout_height="wrap_content" | ||
72 | android:id="@+id/settingsButton" | | |||
73 | android:padding="8dip" | | |||
74 | android:background="@drawable/abc_btn_borderless_material" | 75 | android:background="@drawable/abc_btn_borderless_material" | ||
76 | android:padding="8dip" | ||||
75 | android:src="@drawable/ic_action_settings_inverted"/> | 77 | android:src="@drawable/ic_action_settings_inverted" /> | ||
76 | 78 | | |||
77 | </LinearLayout> | 79 | </LinearLayout> |