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

Commit

Permalink
Merge branch '0.12-dev-rewrite' of github.com:xkli/incubator-weex int…
Browse files Browse the repository at this point in the history
…o 0.12-dev

This closes #134
  • Loading branch information
sospartan committed Mar 22, 2017
2 parents 1e46a44 + f1fc1a3 commit a6207a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,10 @@ public boolean isDestroy(){
return isDestroy;
}

public String getBundleUrl() {
/**
* @return If you use render () the return value may be empty
*/
public @Nullable String getBundleUrl() {
return mBundleUrl;
}

Expand All @@ -1276,6 +1279,7 @@ public View getContainerView() {
return mRenderContainer;
}

@Deprecated
public void setBundleUrl(String url){
mBundleUrl = url;
if(WXSDKManager.getInstance().getValidateProcessor()!=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@

import android.net.Uri;
import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.common.Constants;

import java.util.List;

Expand All @@ -223,6 +223,10 @@ public class DefaultUriAdapter implements URIAdapter {
@NonNull
@Override
public Uri rewrite(WXSDKInstance instance, String type, Uri uri) {
if (TextUtils.isEmpty(instance.getBundleUrl())) {
return uri;
}

Uri base = Uri.parse(instance.getBundleUrl());
Uri.Builder resultBuilder = uri.buildUpon();

Expand All @@ -231,8 +235,6 @@ public Uri rewrite(WXSDKInstance instance, String type, Uri uri) {
return resultBuilder.build();
}
return uri;


}

private Uri.Builder buildRelativeURI(Uri.Builder resultBuilder, Uri base, Uri uri) {
Expand Down

0 comments on commit a6207a6

Please sign in to comment.