This is an automated email from the ASF dual-hosted git repository. kyork pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
The following commit(s) were added to refs/heads/master by this push: new 6245093 [Android] replace IWXDebugProxy as WXSDKInstance class (#1825) 6245093 is described below commit 624509345f0937d127fa56f9b2a7ef7c432df0ce Author: Mario <faterr...@gmail.com> AuthorDate: Tue Nov 27 15:22:42 2018 +0800 [Android] replace IWXDebugProxy as WXSDKInstance class (#1825) --- .../main/java/com/alibaba/weex/WXPageActivity.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java b/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java index 01f496d..28a36e3 100644 --- a/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java +++ b/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java @@ -54,18 +54,14 @@ import com.alibaba.weex.https.WXHttpTask; import com.alibaba.weex.https.WXRequestListener; import com.taobao.weex.IWXRenderListener; import com.taobao.weex.RenderContainer; -import com.taobao.weex.WXEnvironment; import com.taobao.weex.WXSDKEngine; import com.taobao.weex.WXSDKInstance; import com.taobao.weex.appfram.navigator.IActivityNavBarSetter; -import com.taobao.weex.bridge.WXBridgeManager; -import com.taobao.weex.common.IWXDebugProxy; import com.taobao.weex.common.WXRenderStrategy; import com.taobao.weex.ui.component.NestedContainer; import com.taobao.weex.ui.component.WXComponent; import com.taobao.weex.ui.component.WXVContainer; import com.taobao.weex.utils.WXFileUtils; -import com.taobao.weex.utils.WXJsonUtils; import com.taobao.weex.utils.WXLogUtils; import java.io.File; @@ -188,7 +184,7 @@ public class WXPageActivity extends WXBaseActivity implements IWXRenderListener, ctx.getWindow().getDecorView().getWindowVisibleDisplayFrame(outRect); mConfigMap.put("bundleUrl", mUri.toString()); String path = "file".equals(mUri.getScheme()) ? assembleFilePath(mUri) : mUri.toString(); - mInstance.render(TAG, WXFileUtils.loadAsset(path, WXPageActivity.this), + mInstance.render(path, WXFileUtils.loadAsset(path, WXPageActivity.this), mConfigMap, null, WXRenderStrategy.APPEND_ASYNC); } @@ -248,8 +244,13 @@ public class WXPageActivity extends WXBaseActivity implements IWXRenderListener, public void onSuccess(WXHttpTask task) { Log.i(TAG, "into--[http:onSuccess] url:" + url); try { + Uri uri = Uri.parse(url); mConfigMap.put("bundleUrl", url); - mInstance.render(TAG, new String(task.response.data, "utf-8"), mConfigMap, null, WXRenderStrategy.APPEND_ASYNC); + if (uri.getPath().endsWith(".wlasm")){ + mInstance.render(TAG, task.response.data, mConfigMap, null); + } else { + mInstance.render(TAG, new String(task.response.data, "utf-8"), mConfigMap, null, WXRenderStrategy.APPEND_ASYNC); + } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } @@ -532,8 +533,8 @@ public class WXPageActivity extends WXBaseActivity implements IWXRenderListener, private void registerBroadcastReceiver() { mReceiver = new RefreshBroadcastReceiver(); IntentFilter filter = new IntentFilter(); - filter.addAction(IWXDebugProxy.ACTION_DEBUG_INSTANCE_REFRESH); - filter.addAction(IWXDebugProxy.ACTION_INSTANCE_RELOAD); + filter.addAction(WXSDKInstance.ACTION_DEBUG_INSTANCE_REFRESH); + filter.addAction(WXSDKInstance.ACTION_INSTANCE_RELOAD); registerReceiver(mReceiver, filter); } @@ -603,8 +604,8 @@ public class WXPageActivity extends WXBaseActivity implements IWXRenderListener, public class RefreshBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - if (IWXDebugProxy.ACTION_INSTANCE_RELOAD.equals(intent.getAction()) || - IWXDebugProxy.ACTION_DEBUG_INSTANCE_REFRESH.equals(intent.getAction())) { + if (WXSDKInstance.ACTION_INSTANCE_RELOAD.equals(intent.getAction()) || + WXSDKInstance.ACTION_DEBUG_INSTANCE_REFRESH.equals(intent.getAction())) { // String myUrl = intent.getStringExtra("url"); // Log.e("WXPageActivity", "RefreshBroadcastReceiver reload onReceive ACTION_DEBUG_INSTANCE_REFRESH mBundleUrl:" + myUrl + " mUri:" + mUri);