You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/03/06 02:54:26 UTC
[1/5] incubator-weex git commit: * [android] add updateStyle and
updateAttrs API
Repository: incubator-weex
Updated Branches:
refs/heads/0.11-dev 3621001f1 -> 33ba60a47
* [android] add updateStyle and updateAttrs API
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/171f148b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/171f148b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/171f148b
Branch: refs/heads/0.11-dev
Commit: 171f148b9df17cd954ac43a83fd21d44aee18dea
Parents: 33a6c1e
Author: zshshr <zh...@gmail.com>
Authored: Thu Mar 2 18:20:29 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Thu Mar 2 18:20:29 2017 +0800
----------------------------------------------------------------------
.../java/com/taobao/weex/ui/component/WXComponent.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/171f148b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
index 73bbd16..55da296 100755
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
@@ -443,12 +443,20 @@ public abstract class WXComponent<T extends View> implements IWXObject, IWXActi
component = this;
}
mCurrentRef = component.getDomObject().getRef();
- updateProperties(component.getDomObject().getStyles());
- updateProperties(component.getDomObject().getAttrs());
+ updateStyle(component);
+ updateAttrs(component);
updateExtra(component.getDomObject().getExtra());
}
}
+ public void updateStyle(WXComponent component){
+ updateProperties(component.getDomObject().getStyles());
+ }
+
+ public void updateAttrs(WXComponent component){
+ updateProperties(component.getDomObject().getAttrs());
+ }
+
public void refreshData(WXComponent component){
}
@@ -621,6 +629,7 @@ public abstract class WXComponent<T extends View> implements IWXObject, IWXActi
}
+ @Deprecated
public void updateProperties(Map<String, Object> props) {
if (props == null || mHost == null) {
return;
[2/5] incubator-weex git commit: * [android] bugfix NPE
Posted by so...@apache.org.
* [android] bugfix NPE
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/16633e3a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/16633e3a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/16633e3a
Branch: refs/heads/0.11-dev
Commit: 16633e3a05a37020ad2c9f2b80d2335591cf2c6e
Parents: 171f148
Author: zshshr <zh...@gmail.com>
Authored: Fri Mar 3 17:45:24 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Fri Mar 3 17:45:24 2017 +0800
----------------------------------------------------------------------
.../ui/view/refresh/wrapper/BaseBounceView.java | 52 ++++++++++++--------
1 file changed, 32 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/16633e3a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
index e517ab1..c3f10ba 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
@@ -213,6 +213,7 @@ import android.view.View;
import android.widget.FrameLayout;
import com.taobao.weex.common.Constants;
+import com.taobao.weex.dom.ImmutableDomObject;
import com.taobao.weex.ui.component.WXComponent;
import com.taobao.weex.ui.view.WXLoadingLayout;
import com.taobao.weex.ui.view.WXRefreshLayout;
@@ -303,21 +304,27 @@ public abstract class BaseBounceView<T extends View> extends FrameLayout {
public void setHeaderView(WXComponent refresh) {
setRefreshEnable(true);
if (swipeLayout != null) {
- if (swipeLayout.getHeaderView() != null) {
- swipeLayout.setRefreshHeight((int) refresh.getDomObject().getLayoutHeight());
+ WXRefreshView refreshView = swipeLayout.getHeaderView();
+ if (refreshView != null) {
+ ImmutableDomObject immutableDomObject = refresh.getDomObject();
+ if (immutableDomObject == null) {
+ int refreshHeight = (int) immutableDomObject.getLayoutHeight();
- String colorStr = (String) refresh.getDomObject().getStyles().get(Constants.Name.BACKGROUND_COLOR);
- String bgColor = WXUtils.getString(colorStr, null);
+ swipeLayout.setRefreshHeight(refreshHeight);
- if (bgColor != null) {
- if (!TextUtils.isEmpty(bgColor)) {
- int colorInt = WXResourceUtils.getColor(bgColor);
- if (!(colorInt == Color.TRANSPARENT)) {
- swipeLayout.setRefreshBgColor(colorInt);
+ String colorStr = (String) immutableDomObject.getStyles().get(Constants.Name.BACKGROUND_COLOR);
+ String bgColor = WXUtils.getString(colorStr, null);
+
+ if (bgColor != null) {
+ if (!TextUtils.isEmpty(bgColor)) {
+ int colorInt = WXResourceUtils.getColor(bgColor);
+ if (!(colorInt == Color.TRANSPARENT)) {
+ swipeLayout.setRefreshBgColor(colorInt);
+ }
}
}
+ refreshView.setRefreshView(refresh.getHostView());
}
- swipeLayout.getHeaderView().setRefreshView(refresh.getHostView());
}
}
}
@@ -329,21 +336,26 @@ public abstract class BaseBounceView<T extends View> extends FrameLayout {
public void setFooterView(WXComponent loading) {
setLoadmoreEnable(true);
if (swipeLayout != null) {
- if (swipeLayout.getFooterView() != null) {
- swipeLayout.setLoadingHeight((int) loading.getDomObject().getLayoutHeight());
+ WXRefreshView refreshView = swipeLayout.getFooterView();
+ if (refreshView != null) {
+ ImmutableDomObject object = loading.getDomObject();
+ if (object != null) {
+ int loadingHeight = (int) loading.getDomObject().getLayoutHeight();
+ swipeLayout.setLoadingHeight(loadingHeight);
- String colorStr = (String) loading.getDomObject().getStyles().get(Constants.Name.BACKGROUND_COLOR);
- String bgColor = WXUtils.getString(colorStr, null);
+ String colorStr = (String) loading.getDomObject().getStyles().get(Constants.Name.BACKGROUND_COLOR);
+ String bgColor = WXUtils.getString(colorStr, null);
- if (bgColor != null) {
- if (!TextUtils.isEmpty(bgColor)) {
- int colorInt = WXResourceUtils.getColor(bgColor);
- if (!(colorInt == Color.TRANSPARENT)) {
- swipeLayout.setLoadingBgColor(colorInt);
+ if (bgColor != null) {
+ if (!TextUtils.isEmpty(bgColor)) {
+ int colorInt = WXResourceUtils.getColor(bgColor);
+ if (!(colorInt == Color.TRANSPARENT)) {
+ swipeLayout.setLoadingBgColor(colorInt);
+ }
}
}
+ refreshView.setRefreshView(loading.getHostView());
}
- swipeLayout.getFooterView().setRefreshView(loading.getHostView());
}
}
}
[5/5] incubator-weex git commit: Merge branch 'android-bugfix-NPE' of
http://github.com/zshshr/incubator-weex into 0.11-dev This closes #31
Posted by so...@apache.org.
Merge branch 'android-bugfix-NPE' of http://github.com/zshshr/incubator-weex into 0.11-dev
This closes #31
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/33ba60a4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/33ba60a4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/33ba60a4
Branch: refs/heads/0.11-dev
Commit: 33ba60a47b1afaedb8ba70d6b7c5ffc7796aed32
Parents: 3621001 040f4b8
Author: sospartan <so...@gmail.com>
Authored: Mon Mar 6 10:53:45 2017 +0800
Committer: sospartan <so...@gmail.com>
Committed: Mon Mar 6 10:53:45 2017 +0800
----------------------------------------------------------------------
.../taobao/weex/ui/component/WXComponent.java | 13 ++++-
.../ui/view/refresh/wrapper/BaseBounceView.java | 55 +++++++++++---------
2 files changed, 41 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
[4/5] incubator-weex git commit: * [android] format code
Posted by so...@apache.org.
* [android] format code
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/040f4b89
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/040f4b89
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/040f4b89
Branch: refs/heads/0.11-dev
Commit: 040f4b892755c59768431e927bdcb40bf241c86a
Parents: cfb1b56
Author: zshshr <zh...@gmail.com>
Authored: Fri Mar 3 18:04:31 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Fri Mar 3 18:04:31 2017 +0800
----------------------------------------------------------------------
.../weex/ui/view/refresh/wrapper/BaseBounceView.java | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/040f4b89/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
index 3715929..c8a47a0 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
@@ -307,14 +307,11 @@ public abstract class BaseBounceView<T extends View> extends FrameLayout {
WXRefreshView refreshView = swipeLayout.getHeaderView();
if (refreshView != null) {
ImmutableDomObject immutableDomObject = refresh.getDomObject();
- if (immutableDomObject == null) {
+ if (immutableDomObject != null) {
int refreshHeight = (int) immutableDomObject.getLayoutHeight();
-
swipeLayout.setRefreshHeight(refreshHeight);
-
String colorStr = (String) immutableDomObject.getStyles().get(Constants.Name.BACKGROUND_COLOR);
String bgColor = WXUtils.getString(colorStr, null);
-
if (bgColor != null) {
if (!TextUtils.isEmpty(bgColor)) {
int colorInt = WXResourceUtils.getColor(bgColor);
@@ -338,13 +335,12 @@ public abstract class BaseBounceView<T extends View> extends FrameLayout {
if (swipeLayout != null) {
WXRefreshView refreshView = swipeLayout.getFooterView();
if (refreshView != null) {
- ImmutableDomObject object = loading.getDomObject();
- if (object != null) {
- int loadingHeight = (int) loading.getDomObject().getLayoutHeight();
+ ImmutableDomObject immutableDomObject = loading.getDomObject();
+ if (immutableDomObject != null) {
+ int loadingHeight = (int) immutableDomObject.getLayoutHeight();
swipeLayout.setLoadingHeight(loadingHeight);
- String colorStr = (String) loading.getDomObject().getStyles().get(Constants.Name.BACKGROUND_COLOR);
+ String colorStr = (String) immutableDomObject.getStyles().get(Constants.Name.BACKGROUND_COLOR);
String bgColor = WXUtils.getString(colorStr, null);
-
if (bgColor != null) {
if (!TextUtils.isEmpty(bgColor)) {
int colorInt = WXResourceUtils.getColor(bgColor);
[3/5] incubator-weex git commit: Merge branch '0.11-dev' of
https://github.com/apache/incubator-weex into android-bugfix-NPE
Posted by so...@apache.org.
Merge branch '0.11-dev' of https://github.com/apache/incubator-weex into android-bugfix-NPE
# Conflicts:
# android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/cfb1b562
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cfb1b562
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cfb1b562
Branch: refs/heads/0.11-dev
Commit: cfb1b562a4260bc2a2ce83b33fbee025a8691d4b
Parents: 16633e3 59dee77
Author: zshshr <zh...@gmail.com>
Authored: Fri Mar 3 17:58:27 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Fri Mar 3 17:58:27 2017 +0800
----------------------------------------------------------------------
.../com/taobao/weex/dom/ImmutableDomObject.java | 14 +-
.../java/com/taobao/weex/dom/flex/CSSNode.java | 8 +-
.../taobao/weex/ui/component/WXComponent.java | 2 +
.../com/taobao/weex/ui/component/WXImage.java | 29 ++-
.../com/taobao/weex/ui/component/WXLoading.java | 7 +-
.../com/taobao/weex/ui/component/WXSlider.java | 20 +-
.../taobao/weex/ui/component/WXVContainer.java | 13 ++
.../ui/component/list/BasicListComponent.java | 31 +--
.../com/taobao/weex/ui/view/WXImageView.java | 20 +-
.../weex/ui/view/border/BorderDrawable.java | 1 -
.../taobao/weex/ui/view/border/BorderEdge.java | 71 +++---
.../listview/adapter/ListBaseViewHolder.java | 37 +++-
.../ui/view/refresh/wrapper/BaseBounceView.java | 1 -
examples/module/websocket-demo.we | 222 ++++++++++---------
ios/playground/WeexDemo/WXDemoViewController.m | 4 -
ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 12 +
ios/sdk/WeexSDK/Sources/Bridge/WXBridgeMethod.m | 2 +
ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m | 8 +-
.../WeexSDK/Sources/Component/WXEditComponent.h | 2 +-
.../Sources/Component/WXScrollerComponent.m | 2 +-
.../Sources/Component/WXTextInputComponent.h | 2 +-
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.h | 6 -
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 6 +-
.../WeexSDK/Sources/Module/WXAnimationModule.m | 4 +
.../WeexSDK/Sources/Module/WXWebSocketModule.m | 4 +-
.../Sources/Protocol/WXJSExceptionProtocol.h | 21 ++
ios/sdk/WeexSDK/Sources/Utility/WXConvert.h | 2 +-
ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 53 ++---
ios/sdk/WeexSDK/Sources/WeexSDK.h | 1 +
test/pages/image-onload.we | 19 ++
test/scripts/components/image-onload.test.js | 39 ++++
31 files changed, 430 insertions(+), 233 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cfb1b562/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cfb1b562/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
----------------------------------------------------------------------
diff --cc android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
index c3f10ba,1809a78..3715929
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/wrapper/BaseBounceView.java
@@@ -336,26 -330,22 +336,25 @@@ public abstract class BaseBounceView<T
public void setFooterView(WXComponent loading) {
setLoadmoreEnable(true);
if (swipeLayout != null) {
- ImmutableDomObject domObject;
- if (swipeLayout.getFooterView() != null && (domObject = loading.getDomObject()) != null) {
- swipeLayout.setLoadingHeight((int) domObject.getLayoutHeight());
-
- String colorStr = (String) loading.getDomObject().getStyles().get(Constants.Name.BACKGROUND_COLOR);
- String bgColor = WXUtils.getString(colorStr, null);
+ WXRefreshView refreshView = swipeLayout.getFooterView();
+ if (refreshView != null) {
+ ImmutableDomObject object = loading.getDomObject();
+ if (object != null) {
+ int loadingHeight = (int) loading.getDomObject().getLayoutHeight();
+ swipeLayout.setLoadingHeight(loadingHeight);
-
+ String colorStr = (String) loading.getDomObject().getStyles().get(Constants.Name.BACKGROUND_COLOR);
+ String bgColor = WXUtils.getString(colorStr, null);
- if (bgColor != null) {
- if (!TextUtils.isEmpty(bgColor)) {
- int colorInt = WXResourceUtils.getColor(bgColor);
- if (!(colorInt == Color.TRANSPARENT)) {
- swipeLayout.setLoadingBgColor(colorInt);
+ if (bgColor != null) {
+ if (!TextUtils.isEmpty(bgColor)) {
+ int colorInt = WXResourceUtils.getColor(bgColor);
+ if (!(colorInt == Color.TRANSPARENT)) {
+ swipeLayout.setLoadingBgColor(colorInt);
+ }
}
}
+ refreshView.setRefreshView(loading.getHostView());
}
- swipeLayout.getFooterView().setRefreshView(loading.getHostView());
}
}
}