You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/06/07 10:04:50 UTC

[1/4] incubator-weex git commit: * [ios] add force touch force value for touch event

Repository: incubator-weex
Updated Branches:
  refs/heads/0.14-dev e07d20f26 -> d1a9ba4b3


* [ios] add force touch force value for touch event


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/4368ec28
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/4368ec28
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/4368ec28

Branch: refs/heads/0.14-dev
Commit: 4368ec28602efe71c9cf748bb23892ae68e95499
Parents: afb5d1b
Author: acton393 <zh...@gmail.com>
Authored: Wed May 31 17:28:26 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Wed May 31 17:28:26 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4368ec28/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
index 1757926..86ef164 100644
--- a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
+++ b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
@@ -760,7 +760,21 @@ if ([removeEventName isEqualToString:@#eventName]) {\
             touch.wx_identifier = @(_touchIdentifier++);
         }
         NSDictionary *resultTouch = [_component touchResultWithScreenLocation:screenLocation pageLocation:pageLocation identifier:touch.wx_identifier];
-        [resultTouches addObject:resultTouch];
+        NSMutableDictionary * mutableResultTouch = [resultTouch mutableCopy];
+        if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
+            NSLog(@"touch force: %lf, maximum:%lf", touch.force, touch.maximumPossibleForce);
+            float value = touch.force*60;
+            float maxValue = touch.maximumPossibleForce*60;
+            if (touch.maximumPossibleForce) {
+                // the forece value will be range 1 from 0.
+                [mutableResultTouch setObject:[NSNumber numberWithFloat:value/maxValue] forKey:@"force"];
+            }else {
+                [mutableResultTouch setObject:[NSNumber numberWithFloat:0.0] forKey:@"force"];
+            }
+            
+        }
+        
+        [resultTouches addObject:mutableResultTouch];
     }
     
     [_component fireEvent:eventName params:@{@"changedTouches":resultTouches ?: @[]}];


[2/4] incubator-weex git commit: * [ios] remove unused line

Posted by ac...@apache.org.
* [ios] remove unused line


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9dda8068
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9dda8068
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9dda8068

Branch: refs/heads/0.14-dev
Commit: 9dda80689006ecdc586ae37c375d61947ca46935
Parents: 4368ec2
Author: acton393 <zh...@gmail.com>
Authored: Fri Jun 2 16:45:46 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Jun 2 16:45:46 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9dda8068/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
index 86ef164..98a27b7 100644
--- a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
+++ b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
@@ -761,8 +761,8 @@ if ([removeEventName isEqualToString:@#eventName]) {\
         }
         NSDictionary *resultTouch = [_component touchResultWithScreenLocation:screenLocation pageLocation:pageLocation identifier:touch.wx_identifier];
         NSMutableDictionary * mutableResultTouch = [resultTouch mutableCopy];
+        
         if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
-            NSLog(@"touch force: %lf, maximum:%lf", touch.force, touch.maximumPossibleForce);
             float value = touch.force*60;
             float maxValue = touch.maximumPossibleForce*60;
             if (touch.maximumPossibleForce) {
@@ -771,7 +771,6 @@ if ([removeEventName isEqualToString:@#eventName]) {\
             }else {
                 [mutableResultTouch setObject:[NSNumber numberWithFloat:0.0] forKey:@"force"];
             }
-            
         }
         
         [resultTouches addObject:mutableResultTouch];


[3/4] incubator-weex git commit: * [ios] fix onpullingdown event dy value

Posted by ac...@apache.org.
* [ios] fix onpullingdown event  dy value


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/dcf3eb31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/dcf3eb31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/dcf3eb31

Branch: refs/heads/0.14-dev
Commit: dcf3eb31faa24ea853c011fa3991371e2903772b
Parents: 9dda806
Author: acton393 <zh...@gmail.com>
Authored: Fri Jun 2 18:02:35 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Jun 2 18:02:35 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/dcf3eb31/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
index 30188f1..9798b41 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
@@ -468,8 +468,6 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
         _direction = @"up";
         [self handleLoadMore];
     }
-   
-    _lastContentOffset = scrollView.contentOffset;
     
     CGFloat scaleFactor = self.weexInstance.pixelScaleFactor;
     [_refreshComponent pullingdown:@{
@@ -478,7 +476,8 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
              REFRESH_PULLINGDISTANCE: @(scrollView.contentOffset.y/scaleFactor),
              @"type":@"pullingdown"
     }];
-
+    _lastContentOffset = scrollView.contentOffset;
+    
     // check sticky
     [self adjustSticky];
     [self handleAppear];


[4/4] incubator-weex git commit: Merge branch '0.14-force-touch' of https://github.com/acton393/incubator-weex into wip-us-0.14-dev

Posted by ac...@apache.org.
Merge branch '0.14-force-touch' of https://github.com/acton393/incubator-weex into wip-us-0.14-dev


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d1a9ba4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d1a9ba4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d1a9ba4b

Branch: refs/heads/0.14-dev
Commit: d1a9ba4b3987f3cb4987ede0ffe4d7790fd3e0a4
Parents: e07d20f dcf3eb3
Author: acton393 <zh...@gmail.com>
Authored: Wed Jun 7 18:01:06 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Wed Jun 7 18:01:06 2017 +0800

----------------------------------------------------------------------
 .../WeexSDK/Sources/Component/WXScrollerComponent.m  |  5 ++---
 ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m  | 15 ++++++++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------