Here is my current code. I want to hide a specific item on my recyclerview
but when I use visibility.gone
still occupies spaces on the recyclerview. I also tried all the possible solutions How to hide an item from Recycler View on a particular condition? Any help
for(int j =0; j < minusList.size(); j++){
int availableRooms = minusList.get(j);
if(norooms > availableRooms){ //norooms is the number of rooms wanted
holder.itemView.setVisibility(View.GONE);
mAdapter.notifyItemRemoved(position);
}else{
holder.rRoomsLeft.setText("Room available");
}
}
Here is my XML
<android.support.v7.widget.RecyclerView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false" />