Right now I have two separate fragments with a RecyclerView inside them. My first RecyclerView adapter is called MainRestaurantCardAdapter
and the second is called ListRestaurantCardAdapter
.
MainRestaurantCardAdapter
handles (and displays) only one item (a Restaurant
object) at a time.
ListRestaurantCardAdapter
handles an entire list of Restaurant
s, like a typical RecyclerView adapter.
The list gets added to whenever the user clicks the "save" button on the from the MainRestaurantCardAdapter
.
Whenever the button (ImageButton) is clicked, the button changes to indicate it has been saved. What I want is if the user deletes the item from the list, the button is returned to the original (so it can be clicked again).
My problem is I'm not sure where to store the Observable which is essentially watching a boolean value. And also, how to have both RecyclerView adapters subscribe to the Observable.
I hope this makes sense, I'll be glad to clear up anything.