首页 > 系统 > Android > 正文

android滑动解锁震动效果的开启和取消

2020-02-21 17:35:07
字体:
来源:转载
供稿:网友

在android滑环解锁中,当按下时会发生振动效应,因此控制设置的振动效应不会绑定在设置中,设置的触摸振动开关来取消振动效应,下面是武林技术频道小编为大家介绍的android滑动解锁震动效果的开启和取消,一起进入下文了解一下吧!

复制代码 代码如下:

else if (mUnlockWidget instanceof MultiWaveView) {
MultiWaveView multiWaveView = (MultiWaveView) mUnlockWidget;

multiWaveView.setVibrateEnabled(Settings.System.getInt(mContext.getContentResolver(),//通过判断是否设置了触摸震动效果来设置解锁的震动。
Settings.System.HAPTIC_FEEDBACK_ENABLED, 1) != 0);

MultiWaveViewMethods multiWaveViewMethods = new MultiWaveViewMethods(multiWaveView);
multiWaveView.setOnTriggerListener(multiWaveViewMethods);
mUnlockWidgetMethods = multiWaveViewMethods;


还要在这里加入

复制代码 代码如下:


class MultiWaveViewMethods implements MultiWaveView.OnTriggerListener,
UnlockWidgetCommonMethods {

private final MultiWaveView mMultiWaveView;
private boolean mCameraDisabled;

MultiWaveViewMethods(MultiWaveView multiWaveView) {
mMultiWaveView = multiWaveView;

multiWaveView.setVibrateEnabled(Settings.System.getInt(mContext.getContentResolver(),
Settings.System.HAPTIC_FEEDBACK_ENABLED, 1) != 0);

final boolean cameraDisabled = mLockPatternUtils.getDevicePolicyManager()
.getCameraDisabled(null);

以上代码都是武林技术频道小编为大家搜集的android滑动解锁震动效果的开启和取消,希望对大家的学习有一定的帮助!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表