android: fix when flowlayout'item height is just,cannot show rowSpace properly
This commit is contained in:
parent
46d34e3288
commit
b4a704a613
@ -59,5 +59,13 @@ public class FlowLayoutItemNode extends StackNode {
|
||||
super.blend(jsObject);
|
||||
getNodeView().getLayoutParams().width = getLayoutParams().width;
|
||||
getNodeView().getLayoutParams().height = getLayoutParams().height;
|
||||
if (mSuperNode instanceof FlowLayoutNode) {
|
||||
if (getNodeView().getLayoutParams().width > 0) {
|
||||
getNodeView().getLayoutParams().width += ((FlowLayoutNode) mSuperNode).columnSpace;
|
||||
}
|
||||
if (getNodeView().getLayoutParams().height > 0) {
|
||||
getNodeView().getLayoutParams().height += ((FlowLayoutNode) mSuperNode).rowSpace;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,8 +96,8 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
|
||||
}
|
||||
}
|
||||
};
|
||||
private int columnSpace = 0;
|
||||
private int rowSpace = 0;
|
||||
int columnSpace = 0;
|
||||
int rowSpace = 0;
|
||||
private final Rect padding = new Rect();
|
||||
private final RecyclerView.ItemDecoration spacingItemDecoration = new RecyclerView.ItemDecoration() {
|
||||
@Override
|
||||
@ -337,10 +337,6 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
private int calibratePosition(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@DoricMethod
|
||||
public JSONArray findVisibleItems() {
|
||||
int[] firstPositions = staggeredGridLayoutManager.findFirstVisibleItemPositions(null);
|
||||
|
Reference in New Issue
Block a user