fix: add missed disableVibration
This commit is contained in:
parent
e5b75028a2
commit
889f7b0aa6
@ -5,6 +5,8 @@ import android.os.VibrationEffect;
|
|||||||
|
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
|
import tw.nekomimi.nekogram.utils.VibrateUtil;
|
||||||
|
|
||||||
public enum BotWebViewVibrationEffect {
|
public enum BotWebViewVibrationEffect {
|
||||||
IMPACT_LIGHT(new long[] {7}, new int[] {65}, new long[] {60}),
|
IMPACT_LIGHT(new long[] {7}, new int[] {65}, new long[] {60}),
|
||||||
IMPACT_MEDIUM(new long[] {7}, new int[] {145}, new long[] {70}),
|
IMPACT_MEDIUM(new long[] {7}, new int[] {145}, new long[] {70}),
|
||||||
@ -43,9 +45,9 @@ public enum BotWebViewVibrationEffect {
|
|||||||
|
|
||||||
public void vibrate() {
|
public void vibrate() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
AndroidUtilities.getVibrator().vibrate(getVibrationEffectForOreo());
|
VibrateUtil.vibrate(200L, getVibrationEffectForOreo());
|
||||||
} else {
|
} else {
|
||||||
AndroidUtilities.getVibrator().vibrate(fallbackTimings, -1);
|
VibrateUtil.vibrate(fallbackTimings, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,8 @@ object VibrateUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun disableHapticFeedback(view: View) {
|
fun disableHapticFeedback(view: View?) {
|
||||||
view.isHapticFeedbackEnabled = false
|
view?.isHapticFeedbackEnabled = false
|
||||||
(view as? ViewGroup)?.children?.forEach(::disableHapticFeedback)
|
(view as? ViewGroup)?.children?.forEach(::disableHapticFeedback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user