1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2016 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<!-- This is a primitive example showing the different types of preferences available. -->
19<!-- BEGIN_INCLUDE(preferences) -->
20<PreferenceScreen
21        xmlns:android="http://schemas.android.com/apk/res/android"
22        xmlns:app="http://schemas.android.com/apk/res-auto">
23
24    <PreferenceCategory
25            android:title="@string/basic_preferences">
26
27        <Preference
28                android:key="preference"
29                android:title="@string/title_basic_preference"
30                android:summary="@string/summary_basic_preference"/>
31
32        <Preference
33                android:key="stylized"
34                android:title="@string/title_stylish_preference"
35                android:summary="@string/summary_stylish_preference"/>
36
37        <Preference
38                android:key="icon"
39                android:title="@string/title_icon_preference"
40                android:summary="@string/summary_icon_preference"
41                android:icon="@android:drawable/ic_menu_camera"/>
42
43        <Preference
44                android:key="single_line_title"
45                android:title="@string/title_single_line_title_preference"
46                android:summary="@string/summary_single_line_title_preference"
47                app:singleLineTitle="true"/>
48    </PreferenceCategory>
49
50    <PreferenceCategory
51            android:title="@string/widgets">
52
53        <CheckBoxPreference
54                android:key="checkbox"
55                android:title="@string/title_checkbox_preference"
56                android:summary="@string/summary_checkbox_preference"/>
57
58        <SwitchPreferenceCompat
59                android:key="switch"
60                android:title="@string/title_switch_preference"
61                android:summary="@string/summary_switch_preference"/>
62
63        <DropDownPreference
64                android:key="dropdown"
65                android:title="@string/title_dropdown_preference"
66                android:entries="@array/entries"
67                app:useSimpleSummaryProvider="true"
68                android:entryValues="@array/entry_values"/>
69
70        <SeekBarPreference
71                android:key="seekbar"
72                android:title="@string/title_seekbar_preference"
73                android:max="10"
74                android:defaultValue="5"/>
75    </PreferenceCategory>
76
77    <PreferenceCategory
78            android:title="@string/dialogs">
79
80        <EditTextPreference
81                android:key="edittext"
82                android:title="@string/title_edittext_preference"
83                app:useSimpleSummaryProvider="true"
84                android:dialogTitle="@string/dialog_title_edittext_preference"/>
85
86        <ListPreference
87                android:key="list"
88                android:title="@string/title_list_preference"
89                app:useSimpleSummaryProvider="true"
90                android:entries="@array/entries"
91                android:entryValues="@array/entry_values"
92                android:dialogTitle="@string/dialog_title_list_preference"/>
93
94        <MultiSelectListPreference
95                android:key="multi_select_list"
96                android:title="@string/title_multi_list_preference"
97                android:summary="@string/summary_multi_list_preference"
98                android:entries="@array/entries"
99                android:entryValues="@array/entry_values"
100                android:dialogTitle="@string/dialog_title_multi_list_preference"/>
101    </PreferenceCategory>
102
103    <PreferenceCategory
104            android:key="advanced"
105            android:title="@string/advanced_attributes"
106            app:initialExpandedChildrenCount="1">
107
108        <Preference
109                android:key="expandable"
110                android:title="@string/title_expandable_preference"
111                android:summary="@string/summary_expandable_preference"/>
112
113        <Preference
114                android:title="@string/title_intent_preference"
115                android:summary="@string/summary_intent_preference">
116
117            <intent android:action="android.intent.action.VIEW"
118                    android:data="http://www.android.com"/>
119
120        </Preference>
121
122        <SwitchPreferenceCompat
123                android:key="parent"
124                android:title="@string/title_parent_preference"
125                android:summary="@string/summary_parent_preference"/>
126
127        <SwitchPreferenceCompat
128                android:key="child"
129                android:dependency="parent"
130                android:title="@string/title_child_preference"
131                android:summary="@string/summary_child_preference"/>
132
133        <SwitchPreferenceCompat
134                android:key="toggle_summary"
135                android:title="@string/title_toggle_summary_preference"
136                android:summaryOn="@string/summary_on_toggle_summary_preference"
137                android:summaryOff="@string/summary_off_toggle_summary_preference"/>
138
139        <Preference
140                android:key="copyable"
141                android:title="@string/title_copyable_preference"
142                android:summary="@string/summary_copyable_preference"
143                android:selectable="false"
144                app:enableCopying="true"/>
145    </PreferenceCategory>
146
147</PreferenceScreen>
148<!-- END_INCLUDE(preferences) -->
149