feat:Flowlayout support scrollable

This commit is contained in:
pengfei.zhou
2021-04-23 17:47:11 +08:00
committed by osborn
parent 418b71c7a3
commit c2ca3c0b31
3 changed files with 21 additions and 1 deletions

View File

@@ -71,6 +71,14 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
e.printStackTrace();
}
}
@Override
public boolean canScrollVertically() {
if (!scrollable) {
return false;
}
return super.canScrollVertically();
}
};
private int columnSpace = 0;
private int rowSpace = 0;
@@ -89,6 +97,7 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
private String onScrollEndFuncId;
private DoricJSDispatcher jsDispatcher = new DoricJSDispatcher();
private int itemCount = 0;
private boolean scrollable = true;
public FlowLayoutNode(DoricContext doricContext) {
super(doricContext);
@@ -117,6 +126,12 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
@Override
protected void blend(RecyclerView view, String name, JSValue prop) {
switch (name) {
case "scrollable":
if (!prop.isBoolean()) {
return;
}
this.scrollable = prop.asBoolean().value();
break;
case "columnSpace":
if (!prop.isNumber()) {
return;