Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
exolution committed Nov 1, 2016
2 parents bae3479 + e9b57ea commit 8a0f413
Show file tree
Hide file tree
Showing 307 changed files with 396 additions and 17,222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@
import android.view.ViewGroup;
import android.widget.Toast;

import com.alibaba.weex.commons.util.AssertUtil;
import com.alibaba.weex.commons.util.ScreenUtil;
import com.alibaba.weex.commons.util.CommonUtils;
import com.taobao.weex.IWXRenderListener;
import com.taobao.weex.WXSDKEngine;
import com.taobao.weex.WXSDKInstance;
Expand All @@ -241,7 +240,8 @@ public abstract class AbsWeexActivity extends AppCompatActivity implements IWXRe
private WxReloadListener mReloadListener;
private WxRefreshListener mRefreshListener;
private String mUrl;// "http://your_current_IP:12580/examples/build/index.js";

private String mPageName = TAG;
protected Boolean isLocalUrl = false;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -277,21 +277,21 @@ protected void renderPageByURL(String url) {
}

protected void renderPageByURL(String url, String jsonInitData) {
AssertUtil.throwIfNull(mContainer, new RuntimeException("Can't render page, container is null"));
CommonUtils.throwIfNull(mContainer, new RuntimeException("Can't render page, container is null"));
Map<String, Object> options = new HashMap<>();
options.put(WXSDKInstance.BUNDLE_URL, url);
mInstance.renderByUrl(
getPageName(),
url,
options,
jsonInitData,
ScreenUtil.getDisplayWidth(this),
ScreenUtil.getDisplayHeight(this),
CommonUtils.getDisplayWidth(this),
CommonUtils.getDisplayHeight(this),
WXRenderStrategy.APPEND_ASYNC);
}

protected String getPageName() {
return TAG;
public String getPageName() {
return mPageName;
}

@Override
Expand Down Expand Up @@ -462,6 +462,10 @@ protected boolean isLocalPage() {
return isLocalPage;
}

public void setPageName(String pageName) {
mPageName = pageName;
}

public interface WxReloadListener {
void onReload();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ public static HashMap<String, String> getComponents() {
return sComponents;
}

public static void setComponents(HashMap<String, String> sComponents) {
AppConfig.sComponents = sComponents;
public static void setComponents(HashMap<String, String> components) {
AppConfig.sComponents = components;
}

public static HashMap<String, String> getModules() {
return sModules;
}

public static void setModules(HashMap<String, String> sModules) {
AppConfig.sModules = sModules;
public static void setModules(HashMap<String, String> modules) {
AppConfig.sModules = modules;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class ScreenUtil {
public class CommonUtils {
private static final String TAG = "WXTBUtil";

private static boolean isSupportSmartBar = false;
Expand Down Expand Up @@ -313,4 +313,10 @@ private static boolean isSupportSmartBar() {
}
return hasSmartBar;
}

public static<T extends Exception> void throwIfNull(Object object,T e) throws T {
if(object == null){
throw e;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.alibaba.weex.commons.util;

import com.taobao.weex.WXSDKEngine;
import com.taobao.weex.bridge.WXModuleManager;
import com.taobao.weex.common.WXException;

import java.util.HashMap;
Expand All @@ -10,7 +9,7 @@
/**
* Created by budao on 2016/10/25.
*/
public class ExtensionManager {
public class ExtensionUtils {
public static void registerComponent(String name, String className) {
try {
Class clazz = Class.forName(className);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ public class Constants {

// public static final String BUNDLE_URL = "http://t.cn?_wx_tpl=http://h5.waptest.taobao.com/app/weextc031/build/TC__Home.js";
public static final String BUNDLE_URL = "http://t.cn?_wx_tpl=http://g.tbcdn.cn/weex/weex-tc/0.1.0/build/TC__Home.js";
public static final String TEST_BUNDLE_URL = BUNDLE_URL;
public static final String WEEX_SAMPLES_KEY = "?weex-samples";
public static final String WEEX_TPL_KEY = "_wx_tpl";
public static final String PARAM_BUNDLE_URL = "bundleUrl";


//hot refresh
Expand Down
Loading

0 comments on commit 8a0f413

Please sign in to comment.