Comments (2)
如题,假如我不需要用到多级功能,是否可以直接封装成 TreeItem 传进去?
我尝试了这种方式,代码如下:
@TreeDataType(iClass = AccountItem.class) public class Account {} public class AccountItem extends TreeItem<Account> {} public class AccountFragment extends Fragment { private final TreeRecyclerAdapter adapter = new TreeRecyclerAdapter(); LinearLayoutManager manager = new LinearLayoutManager(requireContext()); recyclerView.setLayoutManager(manager); ... private void notifyList(List<Account> list) { List<TreeItem> items = ItemHelperFactory.createItems(list); adapter.getItemManager().replaceAllItem(items); } }似乎没办法正常显示
可以的,参考下demo中的mine和tbhome
注意notify更新在主线程
from treerecyclerview.
如题,假如我不需要用到多级功能,是否可以直接封装成 TreeItem 传进去?
我尝试了这种方式,代码如下:@TreeDataType(iClass = AccountItem.class) public class Account {} public class AccountItem extends TreeItem<Account> {} public class AccountFragment extends Fragment { private final TreeRecyclerAdapter adapter = new TreeRecyclerAdapter(); LinearLayoutManager manager = new LinearLayoutManager(requireContext()); recyclerView.setLayoutManager(manager); ... private void notifyList(List<Account> list) { List<TreeItem> items = ItemHelperFactory.createItems(list); adapter.getItemManager().replaceAllItem(items); } }似乎没办法正常显示
可以的,参考下demo中的mine和tbhome
注意notify更新在主线程
好的,感谢
from treerecyclerview.
Related Issues (20)
- java.lang.NullPointerException HOT 5
- 展开
- 城市列表哪里,如果adapter设置为SHOW_DEFAULT默认不展开,第一次点击时需要点击两次才能展开
- 三级城市点击就闪退了,日志如下,估计是字符串数据格式对不上,解析异常了,但是没看到在哪 HOT 1
- 在TreeItem中获取data经常复用问题 如何解决 HOT 2
- 怎么给Adapter里面传入context?
- 我想要默认三级都展开,但一级不可点击,可以加上这样的需求吗 HOT 2
- 可不可以实现:第一第二级默认展开,一级不可以点击,点击二级打开第三级? HOT 7
- 我想默认全部展开,然后还可以自由的收放,要怎么做呢大佬 HOT 4
- 如何添加空布局 HOT 1
- 大佬好,我在三级item中遇到一个问题 HOT 5
- 混淆问题 HOT 7
- 刷新问题 HOT 2
- 你好,请问:如何将二级Item中的部分View(eg: 一个按钮)的点击事件向上抛出到Activity中使用? HOT 1
- 点击最后一个一级菜单,展开子菜单,屏幕不会上移以显示展开的子菜单 HOT 1
- 是否支持多类型? HOT 1
- 不能直接通过数据源移除吗?
- 如何折叠其他已经展开的item和他的子item呢?
- 支持动态修改数据源吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from treerecyclerview.