FlowLayoutItem add fullSpan attribute

This commit is contained in:
pengfei.zhou
2021-10-11 16:26:56 +08:00
committed by osborn
parent 9429c75834
commit 0e77c62e13
13 changed files with 53 additions and 5 deletions

View File

@@ -69,7 +69,8 @@ class FlowAdapter extends RecyclerView.Adapter<FlowAdapter.DoricViewHolder> {
holder.flowLayoutItemNode.setId(jsObject.getProperty("id").asString().value());
holder.flowLayoutItemNode.blend(jsObject.getProperty("props").asObject());
}
if ((this.flowLayoutNode.hasHeader() && position == 0)
if (holder.flowLayoutItemNode.fullSpan
|| (this.flowLayoutNode.hasHeader() && position == 0)
|| (this.flowLayoutNode.hasFooter() && position == this.getItemCount() - 1)
|| this.flowLayoutNode.loadMore
&& position == this.itemCount + (this.flowLayoutNode.hasHeader() ? 1 : 0)) {

View File

@@ -32,6 +32,7 @@ import pub.doric.shader.StackNode;
@DoricPlugin(name = "FlowLayoutItem")
public class FlowLayoutItemNode extends StackNode {
public String identifier = "";
public boolean fullSpan = false;
public FlowLayoutItemNode(DoricContext doricContext) {
super(doricContext);
@@ -42,6 +43,8 @@ public class FlowLayoutItemNode extends StackNode {
protected void blend(FrameLayout view, String name, JSValue prop) {
if ("identifier".equals(name)) {
this.identifier = prop.asString().value();
} else if ("fullSpan".equals(name)) {
this.fullSpan = prop.asBoolean().value();
} else {
super.blend(view, name, prop);
}