Use a custom dialog to reset preferences.

This commit is contained in:
Dennis Guse
2019-08-06 19:05:46 +02:00
parent a53b3288f7
commit 4abd07694c
8 changed files with 101 additions and 194 deletions
+10 -4
View File
@@ -31,10 +31,16 @@ limitations under the License.
android:key="@string/settings_sensor_key"
android:persistent="false"
android:title="@string/settings_sensor" />
<Preference
android:key="@string/settings_advanced_key"
android:persistent="false"
android:title="@string/settings_advanced" />
<PreferenceCategory android:title="@string/settings_reset">
<de.dennisguse.opentracks.settings.ResetDialogPreference
android:dialogMessage="@string/settings_reset_confirm_message"
android:dialogTitle="@string/settings_reset_confirm_title"
android:key="@string/settings_reset_key"
android:negativeButtonText="@string/generic_cancel"
android:persistent="false"
android:positiveButtonText="@string/generic_yes"
android:title="@string/settings_reset" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/about_preference_title">
<Preference
android:title="@string/about_preference_title">
-22
View File
@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2012 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/settings_advanced">
<Preference
android:key="@string/settings_reset_key"
android:persistent="false"
android:title="@string/settings_reset" />
</PreferenceScreen>