From 69e0b4c2a2424b83ce0ec876938ec3e73dd5b612 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 3 Jun 2023 11:08:22 +0200 Subject: 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"). --- srcs/juloo.keyboard2/Config.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/Config.java') 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"), -- cgit v1.2.3