Moved reset questions to button

pull/162/head
M66B 6 years ago
parent 97b6b60a17
commit c24da9d9a5

@ -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> <a name="faq137"></a>
**(137) How can I reset 'Don't ask again'?** **(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 /> <br />

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

@ -152,6 +152,18 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDebug" /> 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 <Button
android:id="@+id/btnCleanup" android:id="@+id/btnCleanup"
style="?android:attr/buttonStyleSmall" style="?android:attr/buttonStyleSmall"
@ -162,7 +174,7 @@
android:minHeight="0dp" android:minHeight="0dp"
android:text="@string/title_advanced_cleanup" android:text="@string/title_advanced_cleanup"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDebugHint" /> app:layout_constraintTop_toBottomOf="@id/btnReset" />
<TextView <TextView
android:id="@+id/tvCleanupHint" android:id="@+id/tvCleanupHint"

@ -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>
Loading…
Cancel
Save