Skip to content

Commit

Permalink
Merge pull request #24 from weexteam/dev
Browse files Browse the repository at this point in the history
fix some code style issues and update sdk version to 0.8.0.1
  • Loading branch information
littleseven authored Sep 13, 2016
2 parents 5245453 + 0428e6a commit dd34cfb
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 43 deletions.
3 changes: 2 additions & 1 deletion commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion inspector/bintray-build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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+'
}

Expand Down
2 changes: 1 addition & 1 deletion inspector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ private static void logDispatchException(JsonRpcException e) {
break;
default:
LogRedirector.w(TAG, "Error processing remote message", e);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
Expand All @@ -80,7 +80,7 @@ private static class StringMethodInvoker extends TypedMethodInvoker<String> {
}

@Override
String convertArgument(String argument) {
protected String convertArgument(String argument) {
return argument;
}
}
Expand All @@ -91,7 +91,7 @@ private static class CharSequenceMethodInvoker extends TypedMethodInvoker<CharSe
}

@Override
CharSequence convertArgument(String argument) {
protected CharSequence convertArgument(String argument) {
return argument;
}
}
Expand All @@ -102,7 +102,7 @@ private static class IntegerMethodInvoker extends TypedMethodInvoker<Integer> {
}

@Override
Integer convertArgument(String argument) {
protected Integer convertArgument(String argument) {
return Integer.parseInt(argument);
}
}
Expand All @@ -113,7 +113,7 @@ private static class FloatMethodInvoker extends TypedMethodInvoker<Float> {
}

@Override
Float convertArgument(String argument) {
protected Float convertArgument(String argument) {
return Float.parseFloat(argument);
}
}
Expand All @@ -124,7 +124,7 @@ private static class BooleanMethodInvoker extends TypedMethodInvoker<Boolean> {
}

@Override
Boolean convertArgument(String argument) {
protected Boolean convertArgument(String argument) {
return Boolean.parseBoolean(argument);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand All @@ -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());
}
Expand All @@ -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);
}
Expand All @@ -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());
Expand All @@ -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());
}
Expand All @@ -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());
}
Expand All @@ -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);
}
Expand All @@ -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());
}
Expand All @@ -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);
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ private static class GetMatchedStylesForNodeResult implements JsonRpcResult {
public List<InheritedStyleEntry> inherited;
}

void initMatch(RuleMatch match, String value) {
private void initMatch(RuleMatch match, String value) {
match.matchingSelectors = ListUtil.newImmutableList(0);

Selector selector = new Selector();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
4 changes: 2 additions & 2 deletions playground/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
}

0 comments on commit dd34cfb

Please sign in to comment.