[WEEX-244][android]Weex Android Support W3c Force Api
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/db3895a1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/db3895a1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/db3895a1 Branch: refs/heads/master Commit: db3895a16a9376b22231c324683910b37d8d7887 Parents: 5b901c0 Author: jianbai.gbj <jianbai....@alibaba-inc.com> Authored: Fri Mar 9 11:19:47 2018 +0800 Committer: jianbai.gbj <jianbai....@alibaba-inc.com> Committed: Fri Mar 9 11:19:47 2018 +0800 ---------------------------------------------------------------------- .../main/java/com/taobao/weex/ui/view/gesture/WXGesture.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/db3895a1/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java ---------------------------------------------------------------------- diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java index 1bac140..3335d9e 100644 --- a/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java +++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java @@ -383,7 +383,12 @@ public class WXGesture extends GestureDetector.SimpleOnGestureListener implement pageXY = getEventLocInPageCoordinate(motionEvent, pointerIndex, pos); screenXY = getEventLocInScreenCoordinate(motionEvent, pointerIndex, pos); } - return createJSONObject(screenXY, pageXY, (float) motionEvent.getPointerId(pointerIndex)); + JSONObject map = createJSONObject(screenXY, pageXY, (float) motionEvent.getPointerId(pointerIndex)); + float force = motionEvent.getPressure(); + if(force > 0 && force < 1) { + map.put("force", motionEvent.getPressure()); + } + return map; } /**