-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
preferences.xml
170 lines (144 loc) · 6.28 KB
/
preferences.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory android:title="Maintenance">
<SwitchPreference
android:key="auto_update"
android:title="Automatic update"
android:defaultValue="true"/>
<CheckBoxPreference
android:key="wifi_only"
android:title="Wi-Fi only"
android:dependency="auto_update"
android:defaultValue="true"/>
<!-- You can also use:
android:visible="boolean"
app:titleTextColor
Use app:reverseDependencyState="true" to disable Preference when dependency's value is 'true'
-->
<ListPreference
android:key="update_interval"
android:title="Update interval"
android:dependency="auto_update"
android:entries="@array/entries_update_interval"
android:entryValues="@array/entries_update_interval"
android:defaultValue="Weekly"
app:bindValueToSummary="true"/>
<IntegerListPreference
android:key="max_threads"
android:title="Max threads"
android:dependency="auto_update"
android:entries="@array/entries_max_threads"
android:entryValues="@array/entries_max_threads"
android:defaultValue="4"
app:bindValueToSummary="true"/>
<TimePreference
android:key="syncTime"
android:title="Sync active hours"
android:defaultValue="14:08"/>
<PreferenceScreen
android:key="screen_notification"
android:title="Notification"
android:persistent="false">
<PreferenceCategory>
<RingtonePreference
android:key="ringtone"
android:title="Update ringtone"
android:showSilent="true" />
<SeekBarDialogPreference
android:key="vibrate_duration"
android:title="Vibrate duration"
android:dialogMessage="Adjust your device\'s vibrate duration here."
android:dialogTitle="Vibrate duration"
android:defaultValue="200"
android:max="800"
app:min="200"
app:legacySummary="false" />
<SeekBarPreference
android:key="notification_volume"
android:title="Notification volume"
app:seekBarIncrement="20"
app:adjustable="true" />
</PreferenceCategory>
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory android:title="Account">
<EditTextPreference
android:key="account_name"
android:title="Account name"
android:hint="Your name"
android:dialogMessage="Please fill it with your name"
android:inputType="textCapWords"
android:maxLength="15"
android:defaultValue="@null"
app:minLength="2"
app:counterEnabled="true"
app:legacySummary="false" />
<DatePreference
android:key="birthDate"
android:title="Birth date"
android:defaultValue="1583621381235L"/>
<!-- For String Set data type, separate each default value items by comma.
For example android:defaultValue="Andy,Anggrayudi,Ilham" -->
<MultiSelectListPreference
android:key="friend_list"
android:title="Friend list"
android:entries="@array/entries_friend"
android:entryValues="@array/entry_values_friend"
android:defaultValue="andy,anggrayudi,ilham"
app:summaryNothing="@string/nothing"
app:bindValueToSummary="true"
app:helperMethodName="friends"/> <!-- Customize method name in SharedPreferencesHelper -->
<IndicatorPreference
android:key="account_status"
android:title="Verified"
android:src="@drawable/baseline_check_circle_black_24"
app:tint="?colorAccent" />
<!--<ListPreference-->
<!--android:key="country"-->
<!--android:title="Country"-->
<!--android:entries="@array/entries_country"-->
<!--android:entryValues="@array/entry_values_country"-->
<!--android:defaultValue="ID"-->
<!--app:legacySummary="false" />-->
</PreferenceCategory>
<PreferenceCategory android:title="Advanced">
<ColorPreference
android:key="themeColor"
android:title="Theme color"
app:defaultColor="@color/colorPrimary"/>
<SwitchPreference
android:key="enableDarkTheme"
android:title="Enable dark theme"/>
<Preference
android:key="restore_default"
android:title="Restore default settings"
android:persistent="false"/>
<Preference
android:key="open_internal_settings"
android:title="Open internal settings"
android:persistent="false"
app:includeToHelper="true"> <!-- By default, all Preference is excluded,
except its derived classes, e.g. IndicatorPreference and CheckBoxPreference. -->
<intent android:action="android.settings.APPLICATION_DETAILS_SETTINGS"
android:data="package:com.anggrayudi.materialpreference.sample"/>
</Preference>
<FolderPreference
android:key="backupLocation"
android:title="Backup location"
app:defaultFolder="download"/>
</PreferenceCategory>
<!-- To make Preferences floating, you must wrap them inside PreferenceCategory -->
<PreferenceCategory>
<Preference
android:key="about"
android:title="About"
android:persistent="false"
android:icon="@drawable/baseline_info_black_24"
app:tintIcon="?colorAccent"
app:legacySummary="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/anggrayudi/MaterialPreference"/>
</Preference>
</PreferenceCategory>
</PreferenceScreen>