
回复
1.在moudle级别下的build.gradle文件中添加依赖
2.在entry模块的build.gradle文件中,
如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
Ohos library which makes playing with sensor events & detecting gestures a breeze.
The library is built for simplicity and ease of use. It eliminates most boilerplate code for dealing with setting up sensor based event and gesture detection on Ohos.
Supported gestures/events
Gesture | Methods | Usage |
---|---|---|
Flip | onFaceUp onFaceDown |
Link |
Light | onDark onLight |
Link |
Orientation | onTopSideUp onBottomSideUp onLeftSideUp onRightSideUp |
Link |
PinchScale | onScale onScaleStart onScaleEnd |
Link |
Proximity | onNear onFar |
Link |
Shake | onShakeDetected onShakeStopped |
Link |
Wave | onWave | Link |
Chop | onChop | Link |
WristTwist | onWristTwist | Link |
Movement | onMovement onStationary |
Link |
SoundLevel | onSoundDetected | Link |
RotationAngle | onRotation | Link |
TiltDirection | onTiltInAxisX onTiltInAxisY onTiltInAxisZ |
Link |
Scoop | onScooped | Link |
PickupDevice | onDevicePickedUp onDevicePutDown |
Link |
Steps | stepInformation | Link |
TouchType | onDoubleTap onScroll(direction) onSingleTap onSwipeLeft onSwipeRight onLongPress onTwoFingerSingleTap onThreeFingerSingleTap |
Link |
onActive()
in the ability/abilitySlice, call
If you want to modify the threshold and time before declaring that shake gesture is stopped, use
CodeCheck代码测试无异常
CloudTest代码测试无异常
安全病毒安全检测通过
当前版本demo功能与原组件基本无差异
Licensed under the Apache License, Version 2.0, click here for the full license.