diff --git a/commons/build.gradle b/commons/build.gradle index 1be11d5..131f670 100644 --- a/commons/build.gradle +++ b/commons/build.gradle @@ -41,7 +41,8 @@ dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1' - compile 'com.taobao.android:weex_sdk:0.7.0' + // compile 'com.taobao.android:weex_sdk:0.7.0' + provided 'com.taobao.android:weex_sdk:0.8.0.1' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.facebook.fresco:fresco:0.10.0' testCompile 'junit:junit:4.12' diff --git a/inspector/bintray-build.gradle b/inspector/bintray-build.gradle index ec2323c..7d93791 100644 --- a/inspector/bintray-build.gradle +++ b/inspector/bintray-build.gradle @@ -115,7 +115,7 @@ dependencies { testCompile 'org.powermock:powermock-api-mockito:1.6.1' testCompile 'org.powermock:powermock-module-junit4:1.6.1' provided 'com.android.support:appcompat-v7:23.1.1' - provided 'com.taobao.android:weex_sdk:0.7.0' + provided 'com.taobao.android:weex_sdk:0.8.0.1' provided 'com.alibaba:fastjson:1.1.45+' } diff --git a/inspector/build.gradle b/inspector/build.gradle index 9198c47..b11e124 100644 --- a/inspector/build.gradle +++ b/inspector/build.gradle @@ -48,7 +48,7 @@ dependencies { } testCompile 'org.powermock:powermock-api-mockito:1.6.1' testCompile 'org.powermock:powermock-module-junit4:1.6.1' - provided 'com.taobao.android:weex_sdk:0.7.0' + provided 'com.taobao.android:weex_sdk:0.8.0.1' provided 'com.alibaba:fastjson:1.1.45+' compile 'com.squareup.okhttp:okhttp:2.3.0' compile 'com.squareup.okhttp:okhttp-ws:2.3.0' diff --git a/inspector/src/main/java/com/taobao/weex/devtools/common/android/FragmentCompatUtil.java b/inspector/src/main/java/com/taobao/weex/devtools/common/android/FragmentCompatUtil.java index cc868a9..dc8c161 100644 --- a/inspector/src/main/java/com/taobao/weex/devtools/common/android/FragmentCompatUtil.java +++ b/inspector/src/main/java/com/taobao/weex/devtools/common/android/FragmentCompatUtil.java @@ -21,19 +21,15 @@ private FragmentCompatUtil() { } public static boolean isDialogFragment(Object fragment) { + boolean result = false; FragmentCompat supportLib = FragmentCompat.getSupportLibInstance(); - if (supportLib != null && - supportLib.getDialogFragmentClass().isInstance(fragment)) { - return true; - } - - FragmentCompat framework = FragmentCompat.getFrameworkInstance(); - if (framework != null && - framework.getDialogFragmentClass().isInstance(fragment)) { - return true; + result = supportLib != null && supportLib.getDialogFragmentClass().isInstance(fragment); + if (!result) { + FragmentCompat framework = FragmentCompat.getFrameworkInstance(); + result = framework != null && framework.getDialogFragmentClass().isInstance(fragment); } - return false; + return result; } @Nullable diff --git a/inspector/src/main/java/com/taobao/weex/devtools/common/android/ViewUtil.java b/inspector/src/main/java/com/taobao/weex/devtools/common/android/ViewUtil.java index 2c3721c..71db02d 100644 --- a/inspector/src/main/java/com/taobao/weex/devtools/common/android/ViewUtil.java +++ b/inspector/src/main/java/com/taobao/weex/devtools/common/android/ViewUtil.java @@ -29,15 +29,7 @@ private ViewUtil() { } private static boolean isHittable(View view) { - if (view.getVisibility() != View.VISIBLE) { - return false; - } - - if (ViewCompat.getInstance().getAlpha(view) < 0.001f) { - return false; - } - - return true; + return view.getVisibility() == View.VISIBLE && ViewCompat.getInstance().getAlpha(view) > 0.001f; } @Nullable diff --git a/inspector/src/main/java/com/taobao/weex/devtools/inspector/ChromeDevtoolsServer.java b/inspector/src/main/java/com/taobao/weex/devtools/inspector/ChromeDevtoolsServer.java index 4a30e25..a2d868a 100644 --- a/inspector/src/main/java/com/taobao/weex/devtools/inspector/ChromeDevtoolsServer.java +++ b/inspector/src/main/java/com/taobao/weex/devtools/inspector/ChromeDevtoolsServer.java @@ -163,6 +163,7 @@ private static void logDispatchException(JsonRpcException e) { break; default: LogRedirector.w(TAG, "Error processing remote message", e); + break; } } diff --git a/inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/MethodInvoker.java b/inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/MethodInvoker.java index 71bc918..d3c19ba 100644 --- a/inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/MethodInvoker.java +++ b/inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/MethodInvoker.java @@ -71,7 +71,7 @@ boolean invoke(Object receiver, String methodName, String argument) { return false; } - abstract T convertArgument(String argument); + protected abstract T convertArgument(String argument); } private static class StringMethodInvoker extends TypedMethodInvoker { @@ -80,7 +80,7 @@ private static class StringMethodInvoker extends TypedMethodInvoker { } @Override - String convertArgument(String argument) { + protected String convertArgument(String argument) { return argument; } } @@ -91,7 +91,7 @@ private static class CharSequenceMethodInvoker extends TypedMethodInvoker { } @Override - Integer convertArgument(String argument) { + protected Integer convertArgument(String argument) { return Integer.parseInt(argument); } } @@ -113,7 +113,7 @@ private static class FloatMethodInvoker extends TypedMethodInvoker { } @Override - Float convertArgument(String argument) { + protected Float convertArgument(String argument) { return Float.parseFloat(argument); } } @@ -124,7 +124,7 @@ private static class BooleanMethodInvoker extends TypedMethodInvoker { } @Override - Boolean convertArgument(String argument) { + protected Boolean convertArgument(String argument) { return Boolean.parseBoolean(argument); } } diff --git a/inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/ViewHighlightOverlays.java b/inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/ViewHighlightOverlays.java index e389d99..396d4b1 100644 --- a/inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/ViewHighlightOverlays.java +++ b/inspector/src/main/java/com/taobao/weex/devtools/inspector/elements/android/ViewHighlightOverlays.java @@ -25,7 +25,7 @@ abstract class ViewHighlightOverlays { public abstract void removeHighlight(View view); - static ViewHighlightOverlays newInstance() { + protected static ViewHighlightOverlays newInstance() { // This may not be needed since ViewHighlighter.newInstance() is already instantiating a // NoopHighlighter for SDK_INT < JELLY_BEAN_MR2, but just to make sure... if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { @@ -96,7 +96,7 @@ static abstract class HighlightDrawable extends ColorDrawable { public HighlightDrawable() { } - void highlightView(View view) { + protected void highlightView(View view) { ViewGroup.LayoutParams layoutParams = view.getLayoutParams(); if (layoutParams instanceof MarginLayoutParams) { MarginLayoutParams marginLayoutParams = (MarginLayoutParams) layoutParams; @@ -120,7 +120,7 @@ void highlightView(View view) { static class MainHighlightDrawable extends HighlightDrawable { @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(0, 0, view.getWidth(), view.getHeight()); } @@ -144,7 +144,7 @@ static class PaddingTopHighlightDrawable extends HighlightDrawable { } @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(mPaddings.left, 0, view.getWidth() - mPaddings.right, mPaddings.top); } @@ -156,7 +156,7 @@ static class PaddingBottomHighlightDrawable extends HighlightDrawable { } @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(mPaddings.left, view.getHeight() - mPaddings.bottom, view.getWidth() - mPaddings.right, view.getHeight()); @@ -169,7 +169,7 @@ static class PaddingRightHighlightDrawable extends HighlightDrawable { } @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(view.getWidth() - mPaddings.right, 0, view.getWidth(), view.getHeight()); } @@ -181,7 +181,7 @@ static class PaddingLeftHighlightDrawable extends HighlightDrawable { } @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(0, 0, mPaddings.left, view.getHeight()); } @@ -194,7 +194,7 @@ static class MarginTopHighlightDrawable extends HighlightDrawable { } @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(0, 0, view.getWidth(), mMargins.top); } @@ -213,7 +213,7 @@ static class MarginBottomHighlightDrawable extends HighlightDrawable { } @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(0, view.getHeight() - mMargins.bottom, view.getWidth(), view.getHeight()); } @@ -232,7 +232,7 @@ static class MarginRightHighlightDrawable extends HighlightDrawable { } @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(view.getWidth() - mMargins.right, 0, view.getWidth(), view.getHeight() + mMargins.top + mMargins.bottom); @@ -253,7 +253,7 @@ static class MarginLeftHighlightDrawable extends HighlightDrawable { } @Override - void highlightView(View view) { + public void highlightView(View view) { super.highlightView(view); setBounds(0, 0, mMargins.left, view.getHeight() + mMargins.top + mMargins.bottom); } diff --git a/inspector/src/main/java/com/taobao/weex/devtools/inspector/protocol/module/CSS.java b/inspector/src/main/java/com/taobao/weex/devtools/inspector/protocol/module/CSS.java index 99052cd..356c44d 100644 --- a/inspector/src/main/java/com/taobao/weex/devtools/inspector/protocol/module/CSS.java +++ b/inspector/src/main/java/com/taobao/weex/devtools/inspector/protocol/module/CSS.java @@ -376,7 +376,7 @@ private static class GetMatchedStylesForNodeResult implements JsonRpcResult { public List inherited; } - void initMatch(RuleMatch match, String value) { + private void initMatch(RuleMatch match, String value) { match.matchingSelectors = ListUtil.newImmutableList(0); Selector selector = new Selector(); diff --git a/inspector/src/main/java/com/taobao/weex/devtools/inspector/protocol/module/Runtime.java b/inspector/src/main/java/com/taobao/weex/devtools/inspector/protocol/module/Runtime.java index 13e9e72..25d4659 100644 --- a/inspector/src/main/java/com/taobao/weex/devtools/inspector/protocol/module/Runtime.java +++ b/inspector/src/main/java/com/taobao/weex/devtools/inspector/protocol/module/Runtime.java @@ -254,7 +254,7 @@ public EvaluateResponse evaluate(RuntimeReplFactory replFactory, JSONObject para EvaluateRequest request = mObjectMapper.convertValue(params, EvaluateRequest.class); try { - if (!request.objectGroup.equals("console")) { + if (!"console".equals(request.objectGroup)) { return buildExceptionResponse("Not supported by FAB"); } diff --git a/playground/app/build.gradle b/playground/app/build.gradle index 0fd3877..0fea80a 100755 --- a/playground/app/build.gradle +++ b/playground/app/build.gradle @@ -70,7 +70,7 @@ dependencies { androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' androidTestCompile 'com.android.support.test:runner:0.5' /*source dependency*/ - compile 'com.taobao.android:weex_sdk:0.7.0' + compile 'com.taobao.android:weex_sdk:0.8.0.1' compile project(':commons') compile 'com.taobao.android:dexposed:0.1.8' compile 'com.loopj.android:android-async-http:1.4.9@aar' @@ -87,5 +87,5 @@ dependencies { compile 'com.jakewharton.scalpel:scalpel:1.1.2' //compile 'com.google.android.gms:play-services-appindexing:8.1.0' compile project(':inspector') - // compile 'com.taobao.android:weex_inspector:0.0.2.2' + // compile 'com.taobao.android:weex_inspector:0.0.8.0-SNAPSHOT' }