weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luckyc...@apache.org
Subject [incubator-weex] branch master updated: Fix some lint problems (#2776)
Date Thu, 01 Aug 2019 11:23:36 GMT
This is an automated email from the ASF dual-hosted git repository.

luckychen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 529a56f  Fix some lint problems (#2776)
529a56f is described below

commit 529a56fee97897178795d8167a1ab0b1d53023e5
Author: YorkShen <shenyuancs@gmail.com>
AuthorDate: Thu Aug 1 19:23:28 2019 +0800

    Fix some lint problems (#2776)
---
 android/sdk/build.gradle                                            | 3 +++
 android/sdk/src/main/AndroidManifest.xml                            | 5 ++---
 .../main/java/com/taobao/weex/render/WXAbstractRenderContainer.java | 5 +++--
 .../sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java | 5 ++---
 .../java/com/taobao/weex/ui/component/list/BasicListComponent.java  | 2 ++
 .../src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java    | 6 ++----
 .../sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java  | 2 ++
 android/sdk/src/main/java/com/taobao/weex/ui/view/WXWebView.java    | 2 ++
 .../com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java | 2 ++
 .../com/taobao/weex/ui/view/refresh/wrapper/BounceScrollerView.java | 2 ++
 weex-playground                                                     | 2 +-
 11 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle
index f80bd7d..b6dd8fa 100755
--- a/android/sdk/build.gradle
+++ b/android/sdk/build.gradle
@@ -207,8 +207,11 @@ android {
 
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
+    //noinspection GradleDependency
     compileOnly "com.android.support:recyclerview-v7:${project.supportLibVersion}"
+    //noinspection GradleDependency
     compileOnly "com.android.support:support-v4:${project.supportLibVersion}"
+    //noinspection GradleDependency
     compileOnly "com.android.support:appcompat-v7:${project.supportLibVersion}"
     compileOnly "com.alibaba:fastjson:${project.fastjsonLibVersion}"
 
diff --git a/android/sdk/src/main/AndroidManifest.xml b/android/sdk/src/main/AndroidManifest.xml
index 33d2f69..e0d8d4b 100755
--- a/android/sdk/src/main/AndroidManifest.xml
+++ b/android/sdk/src/main/AndroidManifest.xml
@@ -18,9 +18,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-          package="com.taobao.weex"
-          android:versionCode="1"
-          android:versionName="1.0">
+          package="com.taobao.weex">
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
     <application>
         <receiver
diff --git a/android/sdk/src/main/java/com/taobao/weex/render/WXAbstractRenderContainer.java
b/android/sdk/src/main/java/com/taobao/weex/render/WXAbstractRenderContainer.java
index 2122047..ade7339 100644
--- a/android/sdk/src/main/java/com/taobao/weex/render/WXAbstractRenderContainer.java
+++ b/android/sdk/src/main/java/com/taobao/weex/render/WXAbstractRenderContainer.java
@@ -18,15 +18,15 @@
  */
 package com.taobao.weex.render;
 
+import android.annotation.TargetApi;
 import android.content.Context;
+import android.os.Build;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
 import android.widget.FrameLayout;
-
 import com.taobao.weex.WXSDKInstance;
-
 import java.lang.ref.WeakReference;
 
 public class WXAbstractRenderContainer extends FrameLayout {
@@ -46,6 +46,7 @@ public class WXAbstractRenderContainer extends FrameLayout {
         super(context, attrs, defStyleAttr);
     }
 
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
     public WXAbstractRenderContainer(@NonNull Context context, @Nullable AttributeSet attrs,
int defStyleAttr, int defStyleRes) {
         super(context, attrs, defStyleAttr, defStyleRes);
     }
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
index d3464dd..4394c4b 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
@@ -18,6 +18,7 @@
  */
 package com.taobao.weex.ui.component;
 
+import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
 import android.content.Context;
 import android.content.Intent;
@@ -52,7 +53,6 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewOverlay;
 import android.widget.FrameLayout;
-
 import com.alibaba.fastjson.JSONArray;
 import com.taobao.weex.ComponentObserver;
 import com.taobao.weex.IWXActivityStateListener;
@@ -91,7 +91,6 @@ import com.taobao.weex.ui.animation.WXAnimationModule;
 import com.taobao.weex.ui.component.basic.WXBasicComponent;
 import com.taobao.weex.ui.component.binding.Statements;
 import com.taobao.weex.ui.component.list.WXCell;
-import com.taobao.weex.ui.component.list.template.jni.NativeRenderLayoutDirection;
 import com.taobao.weex.ui.component.list.template.jni.NativeRenderObjectUtils;
 import com.taobao.weex.ui.component.pesudo.OnActivePseudoListner;
 import com.taobao.weex.ui.component.pesudo.PesudoStatus;
@@ -113,7 +112,6 @@ import com.taobao.weex.utils.WXReflectionUtils;
 import com.taobao.weex.utils.WXResourceUtils;
 import com.taobao.weex.utils.WXUtils;
 import com.taobao.weex.utils.WXViewUtils;
-
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -247,6 +245,7 @@ public abstract class WXComponent<T extends View> extends WXBasicComponent
imple
   }
 
 
+  @SuppressLint("RtlHardcoded")
   public void setMarginsSupportRTL(ViewGroup.MarginLayoutParams lp, int left, int top, int
right, int bottom) {
       lp.setMargins(left, top, right, bottom);
       if (lp instanceof FrameLayout.LayoutParams) {
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
index 402f456..721ea7f 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
@@ -18,6 +18,7 @@
  */
 package com.taobao.weex.ui.component.list;
 
+import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
 import android.content.Context;
 import android.graphics.Color;
@@ -174,6 +175,7 @@ public abstract class BasicListComponent<T extends ViewGroup &
ListComponentView
     stickyHelper = new WXStickyHelper(this);
   }
 
+  @SuppressLint("RtlHardcoded")
   @Override
   public void setMarginsSupportRTL(ViewGroup.MarginLayoutParams lp, int left, int top, int
right, int bottom) {
     if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1)
{
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
index fc1367f..a158dcc 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
@@ -18,6 +18,7 @@
  */
 package com.taobao.weex.ui.module;
 
+import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
@@ -27,15 +28,11 @@ import android.text.TextUtils;
 import android.view.Gravity;
 import android.widget.EditText;
 import android.widget.Toast;
-
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.taobao.weex.WXSDKEngine;
 import com.taobao.weex.annotation.JSMethod;
 import com.taobao.weex.bridge.JSCallback;
 import com.taobao.weex.utils.WXLogUtils;
-
-import java.net.URLDecoder;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -59,6 +56,7 @@ public class WXModalUIModule extends WXSDKEngine.DestroyableModule {
   private Toast toast;
   private Dialog activeDialog;
 
+  @SuppressLint("ShowToast")
   @JSMethod(uiThread = true)
   public void toast(JSONObject jsObj) {
     if(mWXSDKInstance.getContext() == null){
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java
index 0308708..aacd25a 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java
@@ -25,6 +25,7 @@ import static com.taobao.weex.bridge.WXBridgeManager.METHOD_CALL_JS;
 import static com.taobao.weex.common.WXJSBridgeMsgType.MODULE_INTERVAL;
 import static com.taobao.weex.common.WXJSBridgeMsgType.MODULE_TIMEOUT;
 
+import android.annotation.SuppressLint;
 import android.os.Handler;
 import android.os.Message;
 import android.support.annotation.FloatRange;
@@ -61,6 +62,7 @@ public class WXTimerModule extends WXModule implements Destroyable, Handler.Call
   private Handler handler;
   private SparseArray<Integer> antiIntAutoBoxing;
 
+  @SuppressLint("UseSparseArrays")
   public WXTimerModule() {
     handler = new Handler(WXBridgeManager.getInstance().getJSLooper(), this);
     antiIntAutoBoxing = new SparseArray<>();
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXWebView.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXWebView.java
index 1b3ce37..135efc9 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXWebView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXWebView.java
@@ -18,6 +18,7 @@
  */
 package com.taobao.weex.ui.view;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.Color;
@@ -210,6 +211,7 @@ public class WXWebView implements IWebView {
         return mWebView;
     }
 
+    @SuppressLint({"SetJavaScriptEnabled", "AddJavascriptInterface"})
     private void initWebView(WebView wv) {
         WebSettings settings = wv.getSettings();
         settings.setJavaScriptEnabled(true);
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java
b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java
index bb1d241..84e7ac7 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceRecyclerView.java
@@ -18,6 +18,7 @@
  */
 package com.taobao.weex.ui.view.refresh.wrapper;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.support.annotation.Nullable;
 import android.view.MotionEvent;
@@ -30,6 +31,7 @@ import com.taobao.weex.ui.view.gesture.WXGestureObservable;
 import com.taobao.weex.ui.view.listview.WXRecyclerView;
 import com.taobao.weex.ui.view.listview.adapter.RecyclerViewBaseAdapter;
 
+@SuppressLint("ViewConstructor")
 public class BounceRecyclerView extends BaseBounceView<WXRecyclerView> implements ListComponentView,WXGestureObservable
{
 
   public static final int DEFAULT_COLUMN_COUNT = 1;
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceScrollerView.java
b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceScrollerView.java
index 050607f..20e2249 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceScrollerView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BounceScrollerView.java
@@ -18,11 +18,13 @@
  */
 package com.taobao.weex.ui.view.refresh.wrapper;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
 
 import com.taobao.weex.ui.component.WXScroller;
 import com.taobao.weex.ui.view.WXScrollView;
 
+@SuppressLint("ViewConstructor")
 public class BounceScrollerView extends BaseBounceView<WXScrollView> {
 
     public BounceScrollerView(Context context, int orientation, WXScroller waScroller) {
diff --git a/weex-playground b/weex-playground
index 996e447..e6e18a2 160000
--- a/weex-playground
+++ b/weex-playground
@@ -1 +1 @@
-Subproject commit 996e447ef1e0ecc5416e91147e05632c4f4802fa
+Subproject commit e6e18a2f9948d7fd57e839828c751d5b97d96b53


Mime
View raw message