zshshr closed pull request #1400: [android] adapter scheme "tel"
URL: https://github.com/apache/incubator-weex/pull/1400
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/android/playground/app/src/main/AndroidManifest.xml 
b/android/playground/app/src/main/AndroidManifest.xml
index 22128e26e9..264f3815e3 100755
--- a/android/playground/app/src/main/AndroidManifest.xml
+++ b/android/playground/app/src/main/AndroidManifest.xml
@@ -33,6 +33,7 @@ under the License.
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
+    <uses-permission android:name="android.permission.CALL_PHONE" />
 
     <uses-feature android:name="android.hardware.camera"/>
     <uses-feature android:name="android.hardware.camera.autofocus"/>
diff --git 
a/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java
 
b/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java
index 5ab286aff4..d2f9ba0747 100644
--- 
a/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java
+++ 
b/android/playground/app/src/main/java/com/alibaba/weex/extend/module/WXEventModule.java
@@ -67,6 +67,14 @@ public void openURL(String url) {
       return;
     }
 
+
+    if(TextUtils.equals("tel", scheme)){
+      Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse(url));
+      intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+      mWXSDKInstance.getContext().startActivity(intent);
+      return;
+    }
+
     if (TextUtils.equals("http", scheme) || TextUtils.equals("https", scheme) 
|| TextUtils.equals("file", scheme)) {
       builder.append(url);
     } else {
diff --git a/android/sdk/src/main/java/com/taobao/weex/common/Constants.java 
b/android/sdk/src/main/java/com/taobao/weex/common/Constants.java
index 1dc90190e6..d077dcdffa 100644
--- a/android/sdk/src/main/java/com/taobao/weex/common/Constants.java
+++ b/android/sdk/src/main/java/com/taobao/weex/common/Constants.java
@@ -217,6 +217,9 @@
     String INCLUDE_FONT_PADDING = "includeFontPadding";
     String ENABLE_COPY = "enableCopy";
 
+    String PAGE_ENABLED = "pagingEnabled";
+
+
 
     interface  Recycler{
       String LIST_DATA = "listData";
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXHeader.java 
b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXHeader.java
index d55106e82c..bda9f83905 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXHeader.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXHeader.java
@@ -37,9 +37,9 @@ public WXHeader(WXSDKInstance instance, WXVContainer parent, 
String instanceId,
 
   public WXHeader(WXSDKInstance instance, WXVContainer parent, boolean lazy, 
BasicComponentData basicComponentData) {
     super(instance, parent, lazy, basicComponentData);
-    String parantType = parent.getComponentType();
-    if(WXBasicComponentType.LIST.equals(parantType)
-            || WXBasicComponentType.RECYCLE_LIST.equals(parantType)){
+    String parentType = parent.getComponentType();
+    if(WXBasicComponentType.LIST.equals(parentType)
+            || WXBasicComponentType.RECYCLE_LIST.equals(parentType)){
       setSticky(Constants.Value.STICKY);
     }
   }
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
 
b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
index 0439345cdd..195d2ae0db 100644
--- 
a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
+++ 
b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
@@ -26,6 +26,7 @@
 import com.alibaba.fastjson.JSON;
 
 import android.content.Context;
+import android.support.v7.widget.PagerSnapHelper;
 import android.text.TextUtils;
 import com.taobao.weex.WXSDKInstance;
 import com.taobao.weex.annotation.Component;
@@ -81,6 +82,15 @@ protected BounceRecyclerView generateListView(Context 
context, int orientation)
         bounceRecyclerView.getSwipeLayout().setNestedScrollingEnabled(true);
       }
     }
+
+    /**
+     *  enable pagingEnabled attr
+     */
+    if(WXUtils.getBoolean(getAttrs().get(Constants.Name.PAGE_ENABLED),false)){
+      PagerSnapHelper snapHelper = new PagerSnapHelper();
+      snapHelper.attachToRecyclerView(bounceRecyclerView.getInnerView());
+    }
+
     return bounceRecyclerView;
   }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to