Why is my SimpleOnGestureListener not functioning?

后端 未结 2 817
[愿得一人]
[愿得一人] 2021-01-27 10:11

I\'m using my own GestureDetector class to detect a left|right onFling event. Everything I see looks good in my code but nothing happens...?

I need the added function

2条回答
  •  野性不改
    2021-01-27 10:36

    I give credit to @Devunwired as he suggested above:

    If layout contains children that are also touchable, they may be stealing the events from their parent (your layout).

    So I added:

    View swipeView = (View) findViewById(R.id.animation_layout_content);
    swipeView .setOnTouchListener(new View.OnTouchListener() {...});
    

    Which works wonderfully now.

提交回复
热议问题