Closed sm2017 closed 2 years ago
I also saw this behavior. onPhoneShake
is already triggered on a fast movement. I think @sm2017 is correct, the variable mShakeCount
is never used to see how many movements have been performed. For correct function, some kind of value check against mShakeCount
is necessary.
This is a valid point, just pushed v2.1.0 with a minimum number of shakes required for triggering the callback.
Thanks so much for reporting this issue.
We have a
int mShakeCount = 0;
at shake.dart#L26 that reset in shake.dart#L70 andmShakeCount++
at shake.dart#L74 there is no other usage of this variable , the variable is redundant and if your remove it nothing changedonPhoneShake
calls onlygForce > shakeThresholdGravity
in each event so it is not technically a shake?! just a rapid movement!