Fling gesture detection on grid layout

前端 未结 18 1560
遥遥无期
遥遥无期 2020-11-21 04:38

I want to get fling gesture detection working in my Android application.

What I have is a GridLayout that contains 9 ImageView

18条回答
  •  醉话见心
    2020-11-21 05:28

    Also as a minor enhancement.

    The main reason for the try/catch block is that e1 could be null for the initial movement. in addition to the try/catch, include a test for null and return. similar to the following

    if (e1 == null || e2 == null) return false;
    try {
    ...
    } catch (Exception e) {}
    return false;
    

提交回复
热议问题