abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Config.java
diff options
context:
space:
mode:
authorJules Aguillon2023-06-03 11:08:22 +0200
committerJules Aguillon2023-06-03 11:15:19 +0200
commit69e0b4c2a2424b83ce0ec876938ec3e73dd5b612 (patch)
tree75c002dcf243d440497a6ce11b30c50a50b4bd8f /srcs/juloo.keyboard2/Config.java
parent6f418727cfcdd9377a345c8a40e200f701aa7ac7 (diff)
downloadunexpected-keyboard-69e0b4c2a2424b83ce0ec876938ec3e73dd5b612.tar.gz
unexpected-keyboard-69e0b4c2a2424b83ce0ec876938ec3e73dd5b612.zip
More control over vibration
The newer haptic feedback API that is used instead of the vibrator service since ef03dfe doesn't work for everyone. The new vibration option allow to choose both the newer API ("system") and the older API ("strong", "medium", "light").
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
-rw-r--r--srcs/juloo.keyboard2/Config.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index 1abef6b..9fa6593 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -31,7 +31,7 @@ final class Config
public boolean number_row;
public float swipe_dist_px;
public float slide_step_px;
- public boolean vibrateEnabled;
+ public VibratorCompat.VibrationBehavior vibration_behavior;
public long longPressTimeout;
public long longPressInterval;
public float margin_bottom;
@@ -123,7 +123,8 @@ final class Config
float swipe_dist_value = Float.valueOf(_prefs.getString("swipe_dist", "15"));
swipe_dist_px = swipe_dist_value / 25.f * swipe_scaling;
slide_step_px = swipe_dist_px / 4.f;
- vibrateEnabled = _prefs.getBoolean("vibrate_enabled", true);
+ vibration_behavior =
+ VibratorCompat.VibrationBehavior.of_string(_prefs.getString("vibration_behavior", "system"));
longPressTimeout = _prefs.getInt("longpress_timeout", 600);
longPressInterval = _prefs.getInt("longpress_interval", 65);
margin_bottom = get_dip_pref(dm, oriented_pref("margin_bottom"),