mirror of https://github.com/M66B/FairEmail.git
Hide item decorators for hidden items
This commit is contained in:
parent
c499ff8f0a
commit
f0bdc40d7b
|
@ -310,7 +310,15 @@ public class FragmentMessages extends FragmentBase {
|
|||
LinearLayoutManager llm = new LinearLayoutManager(getContext());
|
||||
rvMessage.setLayoutManager(llm);
|
||||
|
||||
DividerItemDecoration itemDecorator = new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL);
|
||||
DividerItemDecoration itemDecorator = new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL) {
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
if (view.findViewById(R.id.clItem).getVisibility() == View.GONE)
|
||||
outRect.setEmpty();
|
||||
else
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
}
|
||||
};
|
||||
itemDecorator.setDrawable(getContext().getDrawable(R.drawable.divider));
|
||||
rvMessage.addItemDecoration(itemDecorator);
|
||||
|
||||
|
|
Loading…
Reference in New Issue