开发者

Standard Swipe Fling?

开发者 https://www.devze.com 2023-02-21 16:07 出处:网络
I hav开发者_JS百科e a GestureDetector to capture onFling events. Now I\'m just using if velocityX > 150... then right to left swipe, it\'s a bit subjective and doesn\'t work all that well. I was wonde

I hav开发者_JS百科e a GestureDetector to capture onFling events. Now I'm just using if velocityX > 150... then right to left swipe, it's a bit subjective and doesn't work all that well. I was wondering if there was a system standard for detecting right->left and left->right swipe flings?


You can try using the default ViewConfiguration setting.

final ViewConfiguration configuration = ViewConfiguration
        .get(getContext());

mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
0

精彩评论

暂无评论...
验证码 换一张
取 消