You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by zs...@apache.org on 2017/04/27 06:52:52 UTC
[1/6] incubator-weex git commit: * [android] bugfix for recycler
styleWidth==0
Repository: incubator-weex
Updated Branches:
refs/heads/0.12-dev 3bac9eb57 -> eb7ec0df0
* [android] bugfix for recycler styleWidth==0
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/96f64899
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/96f64899
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/96f64899
Branch: refs/heads/0.12-dev
Commit: 96f64899f9978707c4c1bfe78ebeb7c738e2342a
Parents: 602c3f9
Author: zshshr <zh...@gmail.com>
Authored: Tue Apr 25 17:55:49 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Tue Apr 25 17:55:49 2017 +0800
----------------------------------------------------------------------
.../main/java/com/taobao/weex/dom/WXRecyclerDomObject.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/96f64899/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java b/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
index 241b762..6df4b6c 100644
--- a/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
+++ b/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
@@ -67,7 +67,9 @@ public class WXRecyclerDomObject extends WXDomObject{
if (!mIsPreCalculateCellWidth) {
preCalculateCellWidth();
}
- child.getStyles().put(Constants.Name.WIDTH, mColumnWidth);
+ if(mColumnWidth!=0 &&mColumnCount!= Float.NaN) {
+ child.getStyles().put(Constants.Name.WIDTH, mColumnWidth);
+ }
}
}
@@ -104,6 +106,10 @@ public class WXRecyclerDomObject extends WXDomObject{
public void updateRecyclerAttr(){
preCalculateCellWidth();
+ if(mColumnWidth!=0 &&mColumnCount!= Float.NaN){
+ WXLogUtils.w("preCalculateCellWidth mColumnGap :" + mColumnGap + " mColumnWidth:" + mColumnWidth + " mColumnCount:" + mColumnCount);
+ return;
+ }
int count = getChildCount();
for(int i=0;i<count; i++){
WXDomObject domObject = getChild(i);
[3/6] incubator-weex git commit: * [android] avoid case of
mColumnWidth ==0
Posted by zs...@apache.org.
* [android] avoid case of mColumnWidth ==0
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d84b0737
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d84b0737
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d84b0737
Branch: refs/heads/0.12-dev
Commit: d84b0737676ce2f1c0594edb776c46fff1965328
Parents: 1fc3db3
Author: zshshr <zh...@gmail.com>
Authored: Wed Apr 26 16:48:01 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Wed Apr 26 16:48:01 2017 +0800
----------------------------------------------------------------------
.../src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d84b0737/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java b/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
index 6df4b6c..b4b0be0 100644
--- a/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
+++ b/android/sdk/src/main/java/com/taobao/weex/dom/WXRecyclerDomObject.java
@@ -67,7 +67,7 @@ public class WXRecyclerDomObject extends WXDomObject{
if (!mIsPreCalculateCellWidth) {
preCalculateCellWidth();
}
- if(mColumnWidth!=0 &&mColumnCount!= Float.NaN) {
+ if(mColumnWidth!=0 && mColumnWidth!= Float.NaN) {
child.getStyles().put(Constants.Name.WIDTH, mColumnWidth);
}
}
@@ -106,7 +106,7 @@ public class WXRecyclerDomObject extends WXDomObject{
public void updateRecyclerAttr(){
preCalculateCellWidth();
- if(mColumnWidth!=0 &&mColumnCount!= Float.NaN){
+ if(mColumnWidth!=0 && mColumnWidth!= Float.NaN){
WXLogUtils.w("preCalculateCellWidth mColumnGap :" + mColumnGap + " mColumnWidth:" + mColumnWidth + " mColumnCount:" + mColumnCount);
return;
}
[5/6] incubator-weex git commit: * [android] deprecated static
getViewPortWidth
Posted by zs...@apache.org.
* [android] deprecated static getViewPortWidth
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/247e5016
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/247e5016
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/247e5016
Branch: refs/heads/0.12-dev
Commit: 247e50165a2043fef0ae1d688dac4ade55f2cf4c
Parents: c1f9d7d
Author: zshshr <zh...@gmail.com>
Authored: Thu Apr 27 14:49:32 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Thu Apr 27 14:49:32 2017 +0800
----------------------------------------------------------------------
.../weex/dom/action/GetComponentRectAction.java | 29 +++++++++++---------
.../taobao/weex/ui/component/WXScroller.java | 16 ++++++-----
2 files changed, 25 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/247e5016/android/sdk/src/main/java/com/taobao/weex/dom/action/GetComponentRectAction.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/action/GetComponentRectAction.java b/android/sdk/src/main/java/com/taobao/weex/dom/action/GetComponentRectAction.java
index 29c881d..cf8e224 100644
--- a/android/sdk/src/main/java/com/taobao/weex/dom/action/GetComponentRectAction.java
+++ b/android/sdk/src/main/java/com/taobao/weex/dom/action/GetComponentRectAction.java
@@ -48,8 +48,9 @@ class GetComponentRectAction implements RenderAction {
}
@Override
public void executeRender(RenderActionContext context) {
+ WXSDKInstance instance = context.getInstance();
JSCallback jsCallback = new SimpleJSCallback(context.getInstance().getInstanceId(), mCallback);
- if (context.getInstance().isDestroy()) {
+ if (instance == null ||instance.isDestroy()) {
//do nothing
}else if (TextUtils.isEmpty(mRef)) {
Map<String, Object> options = new HashMap<>();
@@ -62,14 +63,15 @@ class GetComponentRectAction implements RenderAction {
WXComponent component = context.getComponent(mRef);
Map<String, Object> options = new HashMap<>();
if (component != null) {
+ int viewPort = instance.getInstanceViewPortWidth();
Map<String, Float> size = new HashMap<>();
Rect sizes = component.getComponentSize();
- size.put("width", getWebPxValue(sizes.width()));
- size.put("height", getWebPxValue(sizes.height()));
- size.put("bottom", getWebPxValue(sizes.bottom));
- size.put("left", getWebPxValue(sizes.left));
- size.put("right", getWebPxValue(sizes.right));
- size.put("top", getWebPxValue(sizes.top));
+ size.put("width", getWebPxValue(sizes.width(),viewPort));
+ size.put("height", getWebPxValue(sizes.height(),viewPort));
+ size.put("bottom", getWebPxValue(sizes.bottom,viewPort));
+ size.put("left", getWebPxValue(sizes.left,viewPort));
+ size.put("right", getWebPxValue(sizes.right,viewPort));
+ size.put("top", getWebPxValue(sizes.top,viewPort));
options.put("size", size);
options.put("result", true);
} else {
@@ -87,12 +89,13 @@ class GetComponentRectAction implements RenderAction {
Map<String, Float> sizes = new HashMap<>();
int[] location = new int[2];
instance.getContainerView().getLocationOnScreen(location);
+ int viewport = instance.getInstanceViewPortWidth();
sizes.put("left", 0f);
sizes.put("top", 0f);
- sizes.put("right", getWebPxValue(container.getWidth()));
- sizes.put("bottom", getWebPxValue(container.getHeight()));
- sizes.put("width", getWebPxValue(container.getWidth()));
- sizes.put("height", getWebPxValue(container.getHeight()));
+ sizes.put("right", getWebPxValue(container.getWidth(),viewport));
+ sizes.put("bottom", getWebPxValue(container.getHeight(),viewport));
+ sizes.put("width", getWebPxValue(container.getWidth(),viewport));
+ sizes.put("height", getWebPxValue(container.getHeight(),viewport));
options.put("size", sizes);
options.put("result", true);
jsCallback.invoke(options);
@@ -105,8 +108,8 @@ class GetComponentRectAction implements RenderAction {
}
@NonNull
- private float getWebPxValue(int value) {
- return WXViewUtils.getWebPxByWidth(value, WXSDKInstance.getViewPortWidth());
+ private float getWebPxValue(int value,int viewport) {
+ return WXViewUtils.getWebPxByWidth(value, viewport);
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/247e5016/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
index c5252a4..ca2e174 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXScroller.java
@@ -158,11 +158,13 @@ public class WXScroller extends WXVContainer<ViewGroup> implements WXScrollViewL
Map<String, Object> contentSize = new HashMap<>(2);
Map<String, Object> contentOffset = new HashMap<>(2);
- contentSize.put(Constants.Name.WIDTH, WXViewUtils.getWebPxByWidth(frame.width(), getInstance().getViewPortWidth()));
- contentSize.put(Constants.Name.HEIGHT, WXViewUtils.getWebPxByWidth(frame.height(), getInstance().getViewPortWidth()));
+ int viewport = getInstance().getInstanceViewPortWidth();
- contentOffset.put(Constants.Name.X, - WXViewUtils.getWebPxByWidth(x, getInstance().getViewPortWidth()));
- contentOffset.put(Constants.Name.Y, - WXViewUtils.getWebPxByWidth(y, getInstance().getViewPortWidth()));
+ contentSize.put(Constants.Name.WIDTH, WXViewUtils.getWebPxByWidth(frame.width(), viewport));
+ contentSize.put(Constants.Name.HEIGHT, WXViewUtils.getWebPxByWidth(frame.height(), viewport));
+
+ contentOffset.put(Constants.Name.X, - WXViewUtils.getWebPxByWidth(x, viewport));
+ contentOffset.put(Constants.Name.Y, - WXViewUtils.getWebPxByWidth(y, viewport));
event.put(Constants.Name.CONTENT_SIZE, contentSize);
event.put(Constants.Name.CONTENT_OFFSET, contentOffset);
@@ -487,7 +489,7 @@ public class WXScroller extends WXVContainer<ViewGroup> implements WXScrollViewL
@WXComponentProp(name = Constants.Name.OFFSET_ACCURACY)
public void setOffsetAccuracy(int accuracy) {
- float realPx = WXViewUtils.getRealPxByWidth(accuracy, getInstance().getViewPortWidth());
+ float realPx = WXViewUtils.getRealPxByWidth(accuracy, getInstance().getInstanceViewPortWidth());
this.mOffsetAccuracy = (int) realPx;
}
@@ -562,7 +564,7 @@ public class WXScroller extends WXVContainer<ViewGroup> implements WXScrollViewL
smooth = WXUtils.getBoolean(options.get(Constants.Name.ANIMATED), true);
if (offset != null) {
try {
- offsetFloat = WXViewUtils.getRealPxByWidth(Float.parseFloat(offset), getInstance().getViewPortWidth());
+ offsetFloat = WXViewUtils.getRealPxByWidth(Float.parseFloat(offset), getInstance().getInstanceViewPortWidth());
}catch (Exception e ){
WXLogUtils.e("Float parseFloat error :"+e.getMessage());
}
@@ -672,7 +674,7 @@ public class WXScroller extends WXVContainer<ViewGroup> implements WXScrollViewL
if (TextUtils.isEmpty(offset)) {
return;
}
- int offsetInt = (int)WXViewUtils.getRealPxByWidth(Float.parseFloat(offset), WXSDKInstance.getViewPortWidth());
+ int offsetInt = (int)WXViewUtils.getRealPxByWidth(Float.parseFloat(offset), getInstance().getInstanceViewPortWidth());
int contentH = scrollView.getChildAt(0).getHeight();
int scrollerH = scrollView.getHeight();
[6/6] incubator-weex git commit: Merge branch '0.12-dev' of
https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.12-dev
Posted by zs...@apache.org.
Merge branch '0.12-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.12-dev
* '0.12-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex:
+ [test] Add compositing test
* [html5] fix lint.
+ [test] Add screenshot diff util and border tests
* [all] remove integration test from CI
* [jsfm] v0.20.6
* [jsfm] v0.20.5
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/eb7ec0df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/eb7ec0df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/eb7ec0df
Branch: refs/heads/0.12-dev
Commit: eb7ec0df0f07819abeeee329f8cf4ef2472f8687
Parents: 247e501 3bac9eb
Author: zshshr <zh...@gmail.com>
Authored: Thu Apr 27 14:51:45 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Thu Apr 27 14:51:45 2017 +0800
----------------------------------------------------------------------
.eslintrc | 9 +-
.travis.yml | 25 --
package.json | 5 +-
test/pages/attributes/compositing.vue | 89 +++++++
test/pages/css/border.vue | 283 +++++++++++++++++++++++
test/screenshot/border-ios.png | Bin 0 -> 168396 bytes
test/screenshot/compositing-ios.png | Bin 0 -> 228661 bytes
test/scripts/attributes/compositing.test.js | 63 +++++
test/scripts/css/border.test.js | 63 +++++
test/scripts/util.js | 33 +++
10 files changed, 542 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
[2/6] incubator-weex git commit: * [android] closed concurrent
compile to fix native crash
Posted by zs...@apache.org.
* [android] closed concurrent compile to fix native crash
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1fc3db3f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1fc3db3f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1fc3db3f
Branch: refs/heads/0.12-dev
Commit: 1fc3db3f1852de77d9b9cf413ce628d7ce5ce3fb
Parents: 96f6489
Author: zshshr <zh...@gmail.com>
Authored: Wed Apr 26 16:39:41 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Wed Apr 26 16:39:41 2017 +0800
----------------------------------------------------------------------
android/sdk/libs/armeabi/libweexjsc.so | Bin 7815820 -> 7652256 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1fc3db3f/android/sdk/libs/armeabi/libweexjsc.so
----------------------------------------------------------------------
diff --git a/android/sdk/libs/armeabi/libweexjsc.so b/android/sdk/libs/armeabi/libweexjsc.so
index 5729111..2ae4bed 100755
Binary files a/android/sdk/libs/armeabi/libweexjsc.so and b/android/sdk/libs/armeabi/libweexjsc.so differ
[4/6] incubator-weex git commit: * [android] avoid float parse
exception
Posted by zs...@apache.org.
* [android] avoid float parse exception
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c1f9d7df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c1f9d7df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c1f9d7df
Branch: refs/heads/0.12-dev
Commit: c1f9d7dfa694b01d7483a3920a6403d6c16322a1
Parents: d84b073
Author: zshshr <zh...@gmail.com>
Authored: Thu Apr 27 14:41:58 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Thu Apr 27 14:41:58 2017 +0800
----------------------------------------------------------------------
android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c1f9d7df/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java b/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
index dff1317..27adf85 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
@@ -55,6 +55,9 @@ public class WXUtils {
}
String temp = value.toString().trim();
+ if(TextUtils.isEmpty(temp)){
+ return df;
+ }
if (temp.endsWith("wx")) {
try {
return transferWx(temp);