Commit 6cecd44a70c82115f75711123f70f0f0fdae2171
1 parent
41d92f29
Remove unused settings
Showing
5 changed files
with
1 additions
and
157 deletions
Show diff stats
app/src/main/java/fr/utbm/lo53/p2017/positionningapp/SettingsActivity.java
@@ -156,9 +156,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { | @@ -156,9 +156,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { | ||
156 | */ | 156 | */ |
157 | protected boolean isValidFragment(String fragmentName) { | 157 | protected boolean isValidFragment(String fragmentName) { |
158 | return PreferenceFragment.class.getName().equals(fragmentName) | 158 | return PreferenceFragment.class.getName().equals(fragmentName) |
159 | - || GeneralPreferenceFragment.class.getName().equals(fragmentName) | ||
160 | - || DataSyncPreferenceFragment.class.getName().equals(fragmentName) | ||
161 | - || NotificationPreferenceFragment.class.getName().equals(fragmentName); | 159 | + || GeneralPreferenceFragment.class.getName().equals(fragmentName); |
162 | } | 160 | } |
163 | 161 | ||
164 | /** | 162 | /** |
@@ -172,73 +170,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity { | @@ -172,73 +170,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity { | ||
172 | super.onCreate(savedInstanceState); | 170 | super.onCreate(savedInstanceState); |
173 | addPreferencesFromResource(R.xml.pref_general); | 171 | addPreferencesFromResource(R.xml.pref_general); |
174 | setHasOptionsMenu(true); | 172 | setHasOptionsMenu(true); |
175 | - | ||
176 | - // Bind the summaries of EditText/List/Dialog/Ringtone preferences | ||
177 | - // to their values. When their values change, their summaries are | ||
178 | - // updated to reflect the new value, per the Android Design | ||
179 | - // guidelines. | ||
180 | - bindPreferenceSummaryToValue(findPreference("example_text")); | ||
181 | - bindPreferenceSummaryToValue(findPreference("example_list")); | ||
182 | - } | ||
183 | - | ||
184 | - @Override | ||
185 | - public boolean onOptionsItemSelected(MenuItem item) { | ||
186 | - int id = item.getItemId(); | ||
187 | - if (id == android.R.id.home) { | ||
188 | - startActivity(new Intent(getActivity(), SettingsActivity.class)); | ||
189 | - return true; | ||
190 | - } | ||
191 | - return super.onOptionsItemSelected(item); | ||
192 | - } | ||
193 | - } | ||
194 | - | ||
195 | - /** | ||
196 | - * This fragment shows notification preferences only. It is used when the | ||
197 | - * activity is showing a two-pane settings UI. | ||
198 | - */ | ||
199 | - @TargetApi(Build.VERSION_CODES.HONEYCOMB) | ||
200 | - public static class NotificationPreferenceFragment extends PreferenceFragment { | ||
201 | - @Override | ||
202 | - public void onCreate(Bundle savedInstanceState) { | ||
203 | - super.onCreate(savedInstanceState); | ||
204 | - addPreferencesFromResource(R.xml.pref_notification); | ||
205 | - setHasOptionsMenu(true); | ||
206 | - | ||
207 | - // Bind the summaries of EditText/List/Dialog/Ringtone preferences | ||
208 | - // to their values. When their values change, their summaries are | ||
209 | - // updated to reflect the new value, per the Android Design | ||
210 | - // guidelines. | ||
211 | - bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone")); | ||
212 | - } | ||
213 | - | ||
214 | - @Override | ||
215 | - public boolean onOptionsItemSelected(MenuItem item) { | ||
216 | - int id = item.getItemId(); | ||
217 | - if (id == android.R.id.home) { | ||
218 | - startActivity(new Intent(getActivity(), SettingsActivity.class)); | ||
219 | - return true; | ||
220 | - } | ||
221 | - return super.onOptionsItemSelected(item); | ||
222 | - } | ||
223 | - } | ||
224 | - | ||
225 | - /** | ||
226 | - * This fragment shows data and sync preferences only. It is used when the | ||
227 | - * activity is showing a two-pane settings UI. | ||
228 | - */ | ||
229 | - @TargetApi(Build.VERSION_CODES.HONEYCOMB) | ||
230 | - public static class DataSyncPreferenceFragment extends PreferenceFragment { | ||
231 | - @Override | ||
232 | - public void onCreate(Bundle savedInstanceState) { | ||
233 | - super.onCreate(savedInstanceState); | ||
234 | - addPreferencesFromResource(R.xml.pref_data_sync); | ||
235 | - setHasOptionsMenu(true); | ||
236 | - | ||
237 | - // Bind the summaries of EditText/List/Dialog/Ringtone preferences | ||
238 | - // to their values. When their values change, their summaries are | ||
239 | - // updated to reflect the new value, per the Android Design | ||
240 | - // guidelines. | ||
241 | - bindPreferenceSummaryToValue(findPreference("sync_frequency")); | ||
242 | } | 173 | } |
243 | 174 | ||
244 | @Override | 175 | @Override |
app/src/main/res/xml/pref_data_sync.xml deleted
1 | -<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
2 | - | ||
3 | - <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to | ||
4 | - dismiss it. --> | ||
5 | - <!-- NOTE: ListPreference's summary should be set to its value by the activity code. --> | ||
6 | - <ListPreference | ||
7 | - android:defaultValue="180" | ||
8 | - android:entries="@array/pref_sync_frequency_titles" | ||
9 | - android:entryValues="@array/pref_sync_frequency_values" | ||
10 | - android:key="sync_frequency" | ||
11 | - android:negativeButtonText="@null" | ||
12 | - android:positiveButtonText="@null" | ||
13 | - android:title="@string/pref_title_sync_frequency" /> | ||
14 | - | ||
15 | - <!-- This preference simply launches an intent when selected. Use this UI sparingly, per | ||
16 | - design guidelines. --> | ||
17 | - <Preference android:title="@string/pref_title_system_sync_settings"> | ||
18 | - <intent android:action="android.settings.SYNC_SETTINGS" /> | ||
19 | - </Preference> | ||
20 | - | ||
21 | -</PreferenceScreen> |
app/src/main/res/xml/pref_general.xml
1 | <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | 1 | <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> |
2 | 2 | ||
3 | - <SwitchPreference | ||
4 | - android:defaultValue="true" | ||
5 | - android:key="example_switch" | ||
6 | - android:summary="@string/pref_description_social_recommendations" | ||
7 | - android:title="@string/pref_title_social_recommendations" /> | ||
8 | - | ||
9 | - <!-- NOTE: EditTextPreference accepts EditText attributes. --> | ||
10 | - <!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. --> | ||
11 | - <EditTextPreference | ||
12 | - android:capitalize="words" | ||
13 | - android:defaultValue="@string/pref_default_display_name" | ||
14 | - android:inputType="textCapWords" | ||
15 | - android:key="example_text" | ||
16 | - android:maxLines="1" | ||
17 | - android:selectAllOnFocus="true" | ||
18 | - android:singleLine="true" | ||
19 | - android:title="@string/pref_title_display_name" /> | ||
20 | - | ||
21 | - <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to | ||
22 | - dismiss it. --> | ||
23 | - <!-- NOTE: ListPreference's summary should be set to its value by the activity code. --> | ||
24 | - <ListPreference | ||
25 | - android:defaultValue="-1" | ||
26 | - android:entries="@array/pref_example_list_titles" | ||
27 | - android:entryValues="@array/pref_example_list_values" | ||
28 | - android:key="example_list" | ||
29 | - android:negativeButtonText="@null" | ||
30 | - android:positiveButtonText="@null" | ||
31 | - android:title="@string/pref_title_add_friends_to_messages" /> | ||
32 | <EditTextPreference | 3 | <EditTextPreference |
33 | android:defaultValue="@string/pref_default_hostname" | 4 | android:defaultValue="@string/pref_default_hostname" |
34 | android:key="hostname" | 5 | android:key="hostname" |
app/src/main/res/xml/pref_headers.xml
@@ -7,15 +7,5 @@ | @@ -7,15 +7,5 @@ | ||
7 | android:icon="@drawable/ic_info_black_24dp" | 7 | android:icon="@drawable/ic_info_black_24dp" |
8 | android:title="@string/pref_header_general" /> | 8 | android:title="@string/pref_header_general" /> |
9 | 9 | ||
10 | - <header | ||
11 | - android:fragment="fr.utbm.lo53.p2017.positionningapp.SettingsActivity$NotificationPreferenceFragment" | ||
12 | - android:icon="@drawable/ic_notifications_black_24dp" | ||
13 | - android:title="@string/pref_header_notifications" /> | ||
14 | - | ||
15 | - <header | ||
16 | - android:fragment="fr.utbm.lo53.p2017.positionningapp.SettingsActivity$DataSyncPreferenceFragment" | ||
17 | - android:icon="@drawable/ic_sync_black_24dp" | ||
18 | - android:title="@string/pref_header_data_sync" /> | ||
19 | - | ||
20 | </preference-headers> | 10 | </preference-headers> |
21 | 11 |
app/src/main/res/xml/pref_notification.xml deleted
1 | -<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
2 | - | ||
3 | - <!-- A 'parent' preference, which enables/disables child preferences (below) | ||
4 | - when checked/unchecked. --> | ||
5 | - <SwitchPreference | ||
6 | - android:defaultValue="true" | ||
7 | - android:key="notifications_new_message" | ||
8 | - android:title="@string/pref_title_new_message_notifications" /> | ||
9 | - | ||
10 | - <!-- Allows the user to choose a ringtone in the 'notification' category. --> | ||
11 | - <!-- NOTE: This preference will be enabled only when the checkbox above is checked. --> | ||
12 | - <!-- NOTE: RingtonePreference's summary should be set to its value by the activity code. --> | ||
13 | - <RingtonePreference | ||
14 | - android:defaultValue="content://settings/system/notification_sound" | ||
15 | - android:dependency="notifications_new_message" | ||
16 | - android:key="notifications_new_message_ringtone" | ||
17 | - android:ringtoneType="notification" | ||
18 | - android:title="@string/pref_title_ringtone" /> | ||
19 | - | ||
20 | - <!-- NOTE: This preference will be enabled only when the checkbox above is checked. --> | ||
21 | - <SwitchPreference | ||
22 | - android:defaultValue="true" | ||
23 | - android:dependency="notifications_new_message" | ||
24 | - android:key="notifications_new_message_vibrate" | ||
25 | - android:title="@string/pref_title_vibrate" /> | ||
26 | - | ||
27 | -</PreferenceScreen> |