diff --git a/entry/src/main/java/com/github/tbouron/shakedetector/example/LogUtils.java b/entry/src/main/java/com/github/tbouron/shakedetector/example/LogUtils.java index f30d8de4058694eaacd89002ad2aa1961fe2eb37..3875e54d072b5c29340a1959799ecbe9f2da6c8d 100644 --- a/entry/src/main/java/com/github/tbouron/shakedetector/example/LogUtils.java +++ b/entry/src/main/java/com/github/tbouron/shakedetector/example/LogUtils.java @@ -105,10 +105,6 @@ public class LogUtils { * 持续时间 */ public static final String TAG = "wjtt"; - /** - * ACTIVITY_MOTION - */ - public static final String ACTIVITY_MOTION = "ohos.permission.ACTIVITY_MOTION"; /** * GYROSCOPE */ diff --git a/library/src/main/java/com/github/tbouron/shakedetector/library/ShakeDetector.java b/library/src/main/java/com/github/tbouron/shakedetector/library/ShakeDetector.java index cd2482db1b70854be41cd2680920de5a236c8079..288fddefa7eb6189a83265a997bb405c64d5fbe0 100644 --- a/library/src/main/java/com/github/tbouron/shakedetector/library/ShakeDetector.java +++ b/library/src/main/java/com/github/tbouron/shakedetector/library/ShakeDetector.java @@ -28,7 +28,7 @@ public class ShakeDetector implements ICategoryOrientationDataCallback { /** * 实际震动强度 */ - public static float mThresholdAcceleration; + public static float mThresholdAcceleration = 1200f ; /** * 2 */ @@ -40,7 +40,7 @@ public class ShakeDetector implements ICategoryOrientationDataCallback { /** * 默认震动触发次数 */ - public static int mThresholdShakeNumber; + public static int mThresholdShakeNumber = 3; private static CategoryOrientation orientationSensor; private static CategoryOrientationAgent categoryOrientationAgent = new CategoryOrientationAgent(); private static final long INTERVAL = 500L; @@ -101,8 +101,6 @@ public class ShakeDetector implements ICategoryOrientationDataCallback { mShakeListener = listener; mSensorBundles = new ArrayList(); mLock = new Object(); - mThresholdAcceleration = DEFAULT_THRESHOLD_ACCELERATION; - mThresholdShakeNumber = DEFAULT_THRESHOLD_SHAKE_NUMBER; } /**