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/04/28 02:56:40 UTC
[06/21] incubator-weex git commit: * [android] bugfix for recycler
styleWidth==0
* [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/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);