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

Commit

Permalink
[Android] Add some annotation to suppress android lint. (#2779)
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkShen authored and lucky-chen committed Aug 2, 2019
1 parent 756eb78 commit 9ea64b9
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 11 deletions.
Expand Up @@ -1680,6 +1680,7 @@ private Drawable prepareBackgroundRipple() {
new int[]{rippleColor});
return new RippleDrawable(colorStateList, new ColorDrawable(colorInt), null) {
@Override
@SuppressLint("CanvasSize")
public void draw(@NonNull Canvas canvas) {
if (mBackgroundDrawable != null) {
Path border = mBackgroundDrawable.getContentPath(new RectF(0, 0, canvas.getWidth(), canvas.getHeight()));
Expand Down
Expand Up @@ -18,6 +18,7 @@
*/
package com.taobao.weex.ui.component;

import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
Expand Down Expand Up @@ -554,6 +555,7 @@ public void onPageScrollStateChanged(int state) {
}
}

@SuppressLint("ClickableViewAccessibility")
private void hackTwoItemsInfiniteScroll() {
if (mViewPager == null || mAdapter == null) {
return;
Expand Down
Expand Up @@ -939,6 +939,7 @@ public void onBindViewHolder(final ListBaseViewHolder holder, int position) {
if (anchorComponent != null && anchorComponent.getHostView() != null && !isExcluded) {
View anchor = anchorComponent.getHostView();
anchor.setOnTouchListener(new View.OnTouchListener() {
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN) {
Expand Down
Expand Up @@ -18,6 +18,7 @@
*/
package com.taobao.weex.ui.component.pesudo;

import android.annotation.SuppressLint;
import android.view.MotionEvent;
import android.view.View;

Expand All @@ -33,6 +34,7 @@ public TouchActivePseudoListener(OnActivePseudoListner l, boolean consumeInTouch
mIsConsumeOnTouch = consumeInTouch;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
Expand Down
Expand Up @@ -18,6 +18,7 @@
*/
package com.taobao.weex.ui.component.richtext;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.Layout;
Expand All @@ -37,6 +38,7 @@ public WXRichTextView(Context context) {
super(context);
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean superResult = super.onTouchEvent(event);
Expand Down
Expand Up @@ -150,6 +150,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
return false;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent ev) {
if(!scrollable) {
Expand Down
Expand Up @@ -67,6 +67,7 @@ public void setLines(int lines) {
mLines = lines;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean result = super.onTouchEvent(event);
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.Rect;
import android.util.AttributeSet;
Expand Down Expand Up @@ -105,6 +106,7 @@ public boolean dispatchTouchEvent(MotionEvent event) {
return result;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent ev) {
if(!scrollable) {
Expand Down
Expand Up @@ -23,20 +23,17 @@
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.annotation.Keep;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.taobao.weex.ui.component.WXImage;
import com.taobao.weex.ui.view.gesture.WXGesture;
import com.taobao.weex.ui.view.gesture.WXGestureObservable;
import com.taobao.weex.utils.ImageDrawable;
import com.taobao.weex.utils.WXLogUtils;

import java.lang.ref.WeakReference;
import java.util.Arrays;

Expand Down Expand Up @@ -108,6 +105,7 @@ public WXGesture getGestureListener() {
return wxGesture;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean result = super.onTouchEvent(event);
Expand Down
Expand Up @@ -182,6 +182,7 @@ protected void dispatchDraw(Canvas canvas) {
}
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent ev) {
if(!scrollable) {
Expand Down
Expand Up @@ -18,6 +18,7 @@
*/
package com.taobao.weex.ui.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.support.v7.widget.SwitchCompat;
import android.view.Gravity;
Expand Down Expand Up @@ -46,6 +47,7 @@ public WXGesture getGestureListener() {
return wxGesture;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean result = super.onTouchEvent(event);
Expand Down
Expand Up @@ -18,11 +18,11 @@
*/
package com.taobao.weex.ui.view;

import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.support.annotation.ColorInt;
import android.support.annotation.Nullable;
import android.support.v7.widget.PopupMenu;
Expand All @@ -31,11 +31,9 @@
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;

import com.taobao.weex.ui.component.WXText;
import com.taobao.weex.ui.view.gesture.WXGesture;
import com.taobao.weex.ui.view.gesture.WXGestureObservable;

import java.lang.ref.WeakReference;

/**
Expand Down Expand Up @@ -65,6 +63,7 @@ protected void onDraw(Canvas canvas) {
canvas.restore();
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean result = super.onTouchEvent(event);
Expand Down
Expand Up @@ -64,6 +64,7 @@ public void setOnVideoPauseListener(VideoPlayListener listener) {
mVideoPauseListener = listener;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean result = super.onTouchEvent(event);
Expand Down
Expand Up @@ -18,6 +18,10 @@
*/
package com.taobao.weex.ui.view.gesture;

import static com.taobao.weex.common.Constants.Event.STOP_PROPAGATION;
import static com.taobao.weex.common.Constants.Event.STOP_PROPAGATION_RAX;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Point;
import android.graphics.PointF;
Expand All @@ -30,7 +34,6 @@
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.view.ViewParent;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.taobao.weex.bridge.EventResult;
Expand All @@ -44,16 +47,12 @@
import com.taobao.weex.utils.WXLogUtils;
import com.taobao.weex.utils.WXUtils;
import com.taobao.weex.utils.WXViewUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import static com.taobao.weex.common.Constants.Event.STOP_PROPAGATION;
import static com.taobao.weex.common.Constants.Event.STOP_PROPAGATION_RAX;

public class WXGesture extends GestureDetector.SimpleOnGestureListener implements OnTouchListener {

private final static String TAG = "Gesture";
Expand Down Expand Up @@ -207,6 +206,7 @@ public boolean removeTouchListener(OnTouchListener listener) {
return false;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
if(requestDisallowInterceptTouchEvent){
Expand Down
Expand Up @@ -18,6 +18,7 @@
*/
package com.taobao.weex.ui.view.listview;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
Expand Down Expand Up @@ -88,6 +89,7 @@ public WXGesture getGestureListener() {
return mGesture;
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event) {
if(!scrollable) {
Expand Down
Expand Up @@ -217,6 +217,7 @@ private static File _desSoCopyFile(String soName) {
/**
* copyStartUpSo
*/
@SuppressLint("SdCardPath")
public static void copyStartUpSo() {
try {
// copy libjsb.so to cache/weex/jsb/cputype
Expand Down Expand Up @@ -402,6 +403,7 @@ static boolean checkSoIsValid(String libName, long size) {
* @param version the version of the so library
* @return the path of the so library
*/
@SuppressLint("SdCardPath")
static String _targetSoFile(String libName, int version) {
Context context = mContext;
if (null == context) {
Expand Down

0 comments on commit 9ea64b9

Please sign in to comment.