Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Fix some lint problems (#2776)
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkShen authored and lucky-chen committed Aug 1, 2019
1 parent cf31bc0 commit 529a56f
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 13 deletions.
3 changes: 3 additions & 0 deletions android/sdk/build.gradle
Expand Up @@ -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}"

Expand Down
5 changes: 2 additions & 3 deletions android/sdk/src/main/AndroidManifest.xml
Expand Up @@ -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
Expand Down
Expand Up @@ -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 {
Expand All @@ -46,6 +46,7 @@ public WXAbstractRenderContainer(@NonNull Context context, @Nullable AttributeSe
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);
}
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -52,7 +53,6 @@
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;
Expand Down Expand Up @@ -91,7 +91,6 @@
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;
Expand All @@ -113,7 +112,6 @@
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;
Expand Down Expand Up @@ -247,6 +245,7 @@ protected final void setContentBoxMeasurement(final ContentBoxMeasurement conten
}


@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) {
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -174,6 +175,7 @@ public BasicListComponent(WXSDKInstance instance, WXVContainer parent, BasicComp
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) {
Expand Down
Expand Up @@ -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;
Expand All @@ -27,15 +28,11 @@
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;

Expand All @@ -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){
Expand Down
Expand Up @@ -25,6 +25,7 @@
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;
Expand Down Expand Up @@ -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<>();
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -210,6 +211,7 @@ private void showWebView(boolean shown) {
return mWebView;
}

@SuppressLint({"SetJavaScriptEnabled", "AddJavascriptInterface"})
private void initWebView(WebView wv) {
WebSettings settings = wv.getSettings();
settings.setJavaScriptEnabled(true);
Expand Down
Expand Up @@ -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;
Expand All @@ -30,6 +31,7 @@
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;
Expand Down
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion weex-playground
Submodule weex-playground updated 103 files

0 comments on commit 529a56f

Please sign in to comment.