Animating on the Fling event

淺唱寂寞╮ 提交于 2019-12-02 02:22:34

suggestion is use onTouch instead of gesture listner

write cases for MotionEvent.ACTION_DOWN: MotionEvent.ACTION_UP: and MotionEvent.ACTION_MOVE

Once you detect the direction to move in MotionEvent.ACTION_MOVE use view.setTranslationX or view.setTranslationY depending on direction you want .... Rest what you want after certain drag/move you can write in MotionEvent.ACTION_UP with view

This is just instruction google it for sample code loads of code available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!