Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove view from MergeAdapter

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.

like image 558
ernazm Avatar asked Dec 05 '22 20:12

ernazm


1 Answers

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 a MergeAdapter(merAdapter) use:

merAdapter.setActive(mytextViiew,false);

And to enable it again(to make it visible) use:

merAdapter.setActive(mytextViiew,true);

Refer the MergeAdapter documentation for details:

https://github.com/commonsguy/cwac-merge

like image 66
Nirav Sanghvi Avatar answered Dec 27 '22 17:12

Nirav Sanghvi