Skip to content

Commit

Permalink
*[android] merge feature-playground
Browse files Browse the repository at this point in the history
  • Loading branch information
xkli committed Aug 10, 2016
2 parents 044f593 + 31648b2 commit 90a8898
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions android/playground/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.alibaba.weex"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "0.5.2.2"
versionCode 5
versionName "0.5.2.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk{
abiFilters "x86"
Expand Down
6 changes: 3 additions & 3 deletions android/playground/app/src/main/assets/component/text-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/* 0 */
/***/ function(module, exports, __webpack_require__) {

;__weex_define__("@weex-component/610122a9602101680271cd31b3d07010", [], function(__weex_require__, __weex_exports__, __weex_module__){
;__weex_define__("@weex-component/621c9dd25370a65530622e88f51a4c08", [], function(__weex_require__, __weex_exports__, __weex_module__){

;
__webpack_require__(1);
Expand Down Expand Up @@ -384,7 +384,7 @@
{
"type": "wxc-panel",
"attr": {
"title": "text-lineheight",
"title": "line-height",
"type": "primary"
},
"children": [
Expand Down Expand Up @@ -433,7 +433,7 @@
}
})
})
;__weex_bootstrap__("@weex-component/610122a9602101680271cd31b3d07010", {
;__weex_bootstrap__("@weex-component/621c9dd25370a65530622e88f51a4c08", {
"transformerVersion": "0.3.1"
},undefined)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;


Expand Down Expand Up @@ -250,13 +252,13 @@ public void onError(WXHttpTask task) {
* hot refresh
*/
private void startHotRefresh() {
String host = mUri.getHost();
String port = mUri.getQueryParameter("wsport");
if (port == null || port.length() == 0) {
port = "8082";
try {
String host = new URL(mUri.toString()).getHost();
String wsUrl = "ws://" + host + ":8082";
mWXHandler.obtainMessage(Constants.HOT_REFRESH_CONNECT, 0, 0, wsUrl).sendToTarget();
} catch (MalformedURLException e) {
e.printStackTrace();
}
String wsUrl = "ws://" + host + ":" + port;
mWXHandler.obtainMessage(Constants.HOT_REFRESH_CONNECT, 0, 0, wsUrl).sendToTarget();
}

private void addOnListener() {
Expand Down Expand Up @@ -377,17 +379,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
finish();
return true;
} else if (id == R.id.action_refresh) {

if(mUri.isHierarchical() && mUri.getQueryParameterNames()!=null && mUri.getQueryParameterNames().contains(Constants.WEEX_TPL_KEY)){
String url=mUri.getQueryParameter(Constants.WEEX_TPL_KEY);
String scheme=mUri.getScheme();
if (mUri.isHierarchical() && (TextUtils.equals(scheme,"http") || TextUtils.equals(scheme,"https"))) {
String weexTpl = mUri.getQueryParameter(Constants.WEEX_TPL_KEY);
String url = TextUtils.isEmpty(weexTpl) ? mUri.toString() : weexTpl;
loadWXfromService(url);
return true;
}

if (TextUtils.equals(mUri.getScheme(), "http") || TextUtils.equals(mUri.getScheme(), "https")) {
loadWXfromService(mUri.toString());
return true;
}
}
return super.onOptionsItemSelected(item);
}
Expand Down
Binary file modified android/playground/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/playground/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 90a8898

Please sign in to comment.