You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by sospartan <gi...@git.apache.org> on 2017/04/06 07:22:55 UTC

[GitHub] incubator-weex pull request #217: [android] disable click event when gesture...

GitHub user sospartan opened a pull request:

    https://github.com/apache/incubator-weex/pull/217

    [android] disable click event when gesture already consume touch event

    Disable click event when gesture is consumed same serial touch-event.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sospartan/incubator-weex 0.12-fix-one-event

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-weex/pull/217.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #217
    
----
commit 36a8b8805a49bdb4252e10795326d67d73d3daca
Author: sospartan <so...@apache.org>
Date:   2017-04-06T07:03:11Z

    * [android] disable click event when gesture already consume touch event

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #217: [android] disable click event when gesture...

Posted by YorkShen <gi...@git.apache.org>.
Github user YorkShen commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/217#discussion_r110112231
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java ---
    @@ -309,12 +320,14 @@ public boolean onTouch(View v, MotionEvent event) {
               break;
             case MotionEvent.ACTION_MOVE:
               result |= handleMotionEvent(LowLevelGesture.ACTION_MOVE, event);
    +          mIsTouchEventConsumed = mIsTouchEventConsumed || result;
               break;
             case MotionEvent.ACTION_UP:
             case MotionEvent.ACTION_POINTER_UP:
               finishDisallowInterceptTouchEvent(v);
               result |= handleMotionEvent(LowLevelGesture.ACTION_UP, event);
               result |= handlePanMotionEvent(event);
    +          mIsTouchEventConsumed = mIsTouchEventConsumed || result;
               break;
             case MotionEvent.ACTION_CANCEL:
               finishDisallowInterceptTouchEvent(v);
    --- End diff --
    
    Reset to false when **cancel** fired?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #217: [android] disable click event when gesture...

Posted by sospartan <gi...@git.apache.org>.
Github user sospartan commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/217#discussion_r110367811
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java ---
    @@ -309,12 +320,14 @@ public boolean onTouch(View v, MotionEvent event) {
               break;
             case MotionEvent.ACTION_MOVE:
               result |= handleMotionEvent(LowLevelGesture.ACTION_MOVE, event);
    +          mIsTouchEventConsumed = mIsTouchEventConsumed || result;
               break;
             case MotionEvent.ACTION_UP:
             case MotionEvent.ACTION_POINTER_UP:
               finishDisallowInterceptTouchEvent(v);
               result |= handleMotionEvent(LowLevelGesture.ACTION_UP, event);
               result |= handlePanMotionEvent(event);
    +          mIsTouchEventConsumed = mIsTouchEventConsumed || result;
               break;
             case MotionEvent.ACTION_CANCEL:
               finishDisallowInterceptTouchEvent(v);
    --- End diff --
    
    click event should not trigger when any of gesture events (start/move)  fired. So `ACTION_CANCEL` will not reset flag.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #217: [android] disable click event when gesture...

Posted by YorkShen <gi...@git.apache.org>.
Github user YorkShen commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/217#discussion_r110095978
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java ---
    @@ -309,12 +320,14 @@ public boolean onTouch(View v, MotionEvent event) {
               break;
             case MotionEvent.ACTION_MOVE:
               result |= handleMotionEvent(LowLevelGesture.ACTION_MOVE, event);
    +          mIsTouchEventConsumed = mIsTouchEventConsumed || result;
               break;
             case MotionEvent.ACTION_UP:
             case MotionEvent.ACTION_POINTER_UP:
               finishDisallowInterceptTouchEvent(v);
               result |= handleMotionEvent(LowLevelGesture.ACTION_UP, event);
               result |= handlePanMotionEvent(event);
    +          mIsTouchEventConsumed = mIsTouchEventConsumed || result;
               break;
             case MotionEvent.ACTION_CANCEL:
               finishDisallowInterceptTouchEvent(v);
    --- End diff --
    
    Reset flag to false when it is canceled?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #217: [android] disable click event when gesture...

Posted by sospartan <gi...@git.apache.org>.
Github user sospartan commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/217#discussion_r110099218
  
    --- Diff: android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java ---
    @@ -309,12 +320,14 @@ public boolean onTouch(View v, MotionEvent event) {
               break;
             case MotionEvent.ACTION_MOVE:
               result |= handleMotionEvent(LowLevelGesture.ACTION_MOVE, event);
    +          mIsTouchEventConsumed = mIsTouchEventConsumed || result;
               break;
             case MotionEvent.ACTION_UP:
             case MotionEvent.ACTION_POINTER_UP:
               finishDisallowInterceptTouchEvent(v);
               result |= handleMotionEvent(LowLevelGesture.ACTION_UP, event);
               result |= handlePanMotionEvent(event);
    +          mIsTouchEventConsumed = mIsTouchEventConsumed || result;
               break;
             case MotionEvent.ACTION_CANCEL:
               finishDisallowInterceptTouchEvent(v);
    --- End diff --
    
    It's not necessary to reset flag here,`Pan` may already trigger by 'move' .


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-weex pull request #217: [android] disable click event when gesture...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-weex/pull/217


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---