CymChad / CymChad/BaseRecyclerViewAdapterHelper
请问 BaseNodeAdapter 的Footer 可以动态显示隐藏吗?
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 24.6k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
形如以下java代码
public class RootNode extends BaseExpandNode implements NodeFooterImp {
private List<BaseNode> childNode;
private String title;
public boolean expand;
public RootNode(List<BaseNode> childNode, String title) {
this.childNode = childNode;
this.title = title;
this.expand = false;
}
/**
* {@link BaseNode}
* 重写此方法,获取子节点。如果没有子节点,返回 null 或者 空数组
*
* @return child nodes
*/
@Nullable
@Override
public List<BaseNode> getChildNode() {
return childNode;
}
/**
* {@link NodeFooterImp}
* (可选实现)
* 重写此方法,获取脚部节点
*
* @return
*/
@Nullable
@Override
public BaseNode getFooterNode() {
// 想通过model的一个变量控制是否显示footer,就是为了点击此处,收起节点
if (expand) {
return new RootFooterNode("收起");
} else {
return null;
}
}
}

感谢
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The example centers on RootNode.getFooterNode(), BaseNodeAdapter, and NodeFooterImp. Start by tracing how BaseNodeAdapter reads getFooterNode() and handles node changes; verify whether changing expand can update the footer after binding. Done means a tested way to show and hide the footer dynamically.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100