Is it possible to remove view or adapter from MergeAdapter
somehow? I'd try to extend it and remove the view from pieces
but it's private
. Or maybe there's an alternative solution to show/hide view in this adapter? I tried to set its layout_height
to zero and visibility to View.GONE
, but it still shows the empty list item. Thanks in advance.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
To remove a view or an adapter from
MergeAdapter
use the following methods:setActive()
on your mergeAdapter Instance.For Example : To remove a
Textview
(mytextView) from aMergeAdapter
(merAdapter) use:And to enable it again(to make it visible) use:
Refer the
MergeAdapter
documentation for details:https://github.com/commonsguy/cwac-merge
your MergeAdapter should be having method called
getCount()
.. if i have understood you right, returning zero from there may solve your problem..Not presently, sorry. It shouldn't be too hard to add (remove it from the collection and call
notifyDataSetChanged()
to update theAdapterView
) if you wanted to take a shot at it. Contributions are welcome! :-)Expanding on Mark Murphy's answer, I think this is as simple as adding this method to MergeAdapter:
remove()
takes an object and will do all of the necessary testing & removal for you, if that object is contained in the pieces list. You could make this return a bool or something for your own purposes, but I had no such need.Then just call something like: