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);

 

人已赞赏
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索