Flowlayout's loadMoreView supports fullSpan,default is false

This commit is contained in:
pengfei.zhou
2021-10-11 18:32:14 +08:00
committed by osborn
parent 738c072ee4
commit f09f7859b9
7 changed files with 20 additions and 23 deletions

View File

@@ -67,9 +67,11 @@ class FlowAdapter extends RecyclerView.Adapter<FlowAdapter.DoricViewHolder> {
holder.flowLayoutItemNode.setId(jsObject.getProperty("id").asString().value());
holder.flowLayoutItemNode.blend(jsObject.getProperty("props").asObject());
}
if (holder.flowLayoutItemNode.fullSpan
|| this.flowLayoutNode.loadMore
&& position >= this.itemCount) {
boolean fullSpan = this.flowLayoutNode.loadMore && position >= this.itemCount;
if (holder.flowLayoutItemNode.fullSpan != null) {
fullSpan = holder.flowLayoutItemNode.fullSpan;
}
if (fullSpan) {
StaggeredGridLayoutManager.LayoutParams layoutParams = new StaggeredGridLayoutManager.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
holder.itemView.getLayoutParams().height

View File

@@ -32,7 +32,7 @@ import pub.doric.shader.StackNode;
@DoricPlugin(name = "FlowLayoutItem")
public class FlowLayoutItemNode extends StackNode {
public String identifier = "";
public boolean fullSpan = false;
public Boolean fullSpan = null;
public FlowLayoutItemNode(DoricContext doricContext) {
super(doricContext);

View File

@@ -104,9 +104,6 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
private int itemCount = 0;
private boolean scrollable = true;
String headerViewId;
String footerViewId;
public FlowLayoutNode(DoricContext doricContext) {
super(doricContext);
this.flowAdapter = new FlowAdapter(this);
@@ -214,12 +211,6 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
}
this.onScrollEndFuncId = prop.asString().value();
break;
case "header":
this.headerViewId = prop.asString().value();
break;
case "footer":
this.footerViewId = prop.asString().value();
break;
default:
super.blend(view, name, prop);
break;