Closed blonsky95 closed 4 years ago
NEXT THE OWNED THING
created custom class to have exercise class from store - MyCustomStoreExercise contains 3 properties, 2 in constructor (Exercise (Exercise) and category (String)) and third property is isOwned(Boolean), used in the Library class to access categories and is owned easily. When loaded in observers it modifies the isOwned . Because both userExercises and storeExercises have to be initialised to perform the isOwned modification, I have set a boolean "trap" and they basically wait for both of them to be initialised to set the content to adapter.
set the checked state of box when binding viewholder, due to recycler view, if you change checkbox state, but dont specify what it should be in the bindingviewholder fun, it will recycle that view and check other items in the recycler view. Thats why when binding I should assign the "isChecked" which I have, it now looks if it is contained in the checkedExercises arraylist.
Everything gucci for now here
So if I already have an exercise of name Squats, I will get an owned text next to it