Haptic feedback

This commit is contained in:
M66B
2018-10-15 07:22:51 +00:00
parent b50877bfd1
commit 600284b69c
8 changed files with 42 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ public class FragmentOptions extends FragmentEx {
private CheckBox cbLight;
private CheckBox cbBrowse;
private CheckBox cbSwipe;
private CheckBox cbHaptic;
private CheckBox cbDebug;
@Override
@@ -52,6 +53,7 @@ public class FragmentOptions extends FragmentEx {
cbLight = view.findViewById(R.id.cbLight);
cbBrowse = view.findViewById(R.id.cbBrowse);
cbSwipe = view.findViewById(R.id.cbSwipe);
cbHaptic = view.findViewById(R.id.cbHaptic);
cbDebug = view.findViewById(R.id.cbDebug);
// Wire controls
@@ -102,6 +104,14 @@ public class FragmentOptions extends FragmentEx {
}
});
cbHaptic.setChecked(prefs.getBoolean("haptic", true));
cbHaptic.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("haptic", checked).apply();
}
});
cbDebug.setChecked(prefs.getBoolean("debug", false));
cbDebug.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override