• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2010 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16
17<!-- This is a primitive example showing the different types of preferences available. -->
18<!-- BEGIN_INCLUDE(preferences) -->
19<PreferenceScreen
20        xmlns:android="http://schemas.android.com/apk/res/android">
21
22    <PreferenceCategory
23            android:title="@string/inline_preferences">
24
25        <CheckBoxPreference
26                android:key="checkbox_preference"
27                android:title="@string/title_checkbox_preference"
28                android:summary="@string/summary_checkbox_preference" />
29
30    </PreferenceCategory>
31
32    <PreferenceCategory
33            android:title="@string/dialog_based_preferences">
34
35        <EditTextPreference
36                android:key="edittext_preference"
37                android:title="@string/title_edittext_preference"
38                android:summary="@string/summary_edittext_preference"
39                android:dialogTitle="@string/dialog_title_edittext_preference" />
40
41        <ListPreference
42                android:key="list_preference"
43                android:title="@string/title_list_preference"
44                android:summary="@string/summary_list_preference"
45                android:entries="@array/entries_list_preference"
46                android:entryValues="@array/entryvalues_list_preference"
47                android:dialogTitle="@string/dialog_title_list_preference" />
48
49    </PreferenceCategory>
50
51    <PreferenceCategory
52            android:title="@string/launch_preferences">
53
54        <!-- This PreferenceScreen tag sends the user to a new fragment of
55             preferences.  If running in a large screen, they can be embedded
56             inside of the overall preferences UI. -->
57        <PreferenceScreen
58                android:fragment="com.example.android.apis.preference.PreferenceWithHeaders$Prefs1FragmentInner"
59                android:title="@string/title_fragment_preference"
60                android:summary="@string/summary_fragment_preference">
61            <!-- Arbitrary key/value pairs can be included for fragment arguments -->
62            <extra android:name="someKey" android:value="somePrefValue" />
63        </PreferenceScreen>
64
65        <!-- This PreferenceScreen tag sends the user to a completely different
66             activity, switching out of the current preferences UI. -->
67        <PreferenceScreen
68                android:title="@string/title_intent_preference"
69                android:summary="@string/summary_intent_preference">
70
71            <intent android:action="android.intent.action.VIEW"
72                    android:data="http://www.android.com" />
73
74        </PreferenceScreen>
75
76    </PreferenceCategory>
77
78    <PreferenceCategory
79            android:title="@string/preference_attributes">
80
81        <CheckBoxPreference
82                android:key="parent_checkbox_preference"
83                android:title="@string/title_parent_preference"
84                android:summary="@string/summary_parent_preference" />
85
86        <!-- The visual style of a child is defined by this styled theme attribute. -->
87        <CheckBoxPreference
88                android:key="child_checkbox_preference"
89                android:dependency="parent_checkbox_preference"
90                android:layout="?android:attr/preferenceLayoutChild"
91                android:title="@string/title_child_preference"
92                android:summary="@string/summary_child_preference" />
93
94    </PreferenceCategory>
95
96</PreferenceScreen>
97<!-- END_INCLUDE(preferences) -->
98