I\'ve got a view that is effectively is a button. Here is its XML layout (add_new.xml)
set layout_width and layout_height to 0 where you want to hide item, by doing this
layout_width
layout_height
0
//if item's parent layout is LinearLayout, change according to your item xml holder.itemView.setLayoutParams(new LinearLayout.LayoutParams(0,0));