Moved reset questions to button

This commit is contained in:
M66B 2019-10-05 09:37:57 +02:00
parent 97b6b60a17
commit c24da9d9a5
4 changed files with 25 additions and 20 deletions

2
FAQ.md
View File

@ -2356,7 +2356,7 @@ In the three-dots overflow menu at the top right there is an item to delete the
<a name="faq137"></a>
**(137) How can I reset 'Don't ask again'?**
You can reset all questions set to not to be asked again in the three-dots overflow menu of the miscellaneous settings.
You can reset all questions set to be not asked again in the miscellaneous settings.
<br />

View File

@ -56,6 +56,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private TextView tvExperimentsHint;
private SwitchCompat swCrashReports;
private SwitchCompat swDebug;
private Button btnReset;
private Button btnCleanup;
private TextView tvProcessors;
@ -94,6 +95,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvExperimentsHint = view.findViewById(R.id.tvExperimentsHint);
swCrashReports = view.findViewById(R.id.swCrashReports);
swDebug = view.findViewById(R.id.swDebug);
btnReset = view.findViewById(R.id.btnReset);
btnCleanup = view.findViewById(R.id.btnCleanup);
tvProcessors = view.findViewById(R.id.tvProcessors);
@ -191,6 +193,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
btnReset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onResetQuestions();
}
});
btnCleanup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -222,7 +231,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_options_misc, menu);
inflater.inflate(R.menu.menu_options, menu);
super.onCreateOptionsMenu(menu, inflater);
}
@ -232,9 +241,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
case R.id.menu_default:
onMenuDefault();
return true;
case R.id.menu_reset_questions:
onMenuResetQuestions();
return true;
default:
return super.onOptionsItemSelected(item);
}
@ -249,7 +255,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
ToastEx.makeText(getContext(), R.string.title_setup_done, Toast.LENGTH_LONG).show();
}
private void onMenuResetQuestions() {
private void onResetQuestions() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = prefs.edit();
for (String option : RESET_QUESTIONS)

View File

@ -152,6 +152,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDebug" />
<Button
android:id="@+id/btnReset"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_setup_reset_questions"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDebugHint" />
<Button
android:id="@+id/btnCleanup"
style="?android:attr/buttonStyleSmall"
@ -162,7 +174,7 @@
android:minHeight="0dp"
android:text="@string/title_advanced_cleanup"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDebugHint" />
app:layout_constraintTop_toBottomOf="@id/btnReset" />
<TextView
android:id="@+id/tvCleanupHint"

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_default"
android:title="@string/title_setup_defaults"
app:showAsAction="never" />
<item
android:id="@+id/menu_reset_questions"
android:title="@string/title_setup_reset_questions"
app:showAsAction="never" />
</menu>