android滑动解锁震动效果的开启和取消
在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滑动解锁震动效果的开启和取消,希望对大家的学习有一定的帮助!