Archived
Updated EventPageFragment.kt to have access to its own ViewModel and, by extension, its own reference to the database, which forgoes the need to transport data from EventFragment.kt through StudIPEventPageAdapter.kt to EventPageFragment.kt and allows for filtering for a specific day's items through the database rather than needing to iterate through the list via an extension function manually. Also implemented DiffUtil to perform individual updates rather than calling notifyDataSetChanged() every time a single item has been changed.
This commit is contained in:
@@ -20,7 +20,7 @@ import com.denizk0461.studip.model.CanteenOfferGroup
|
||||
* @param displayAllergens whether the user wants allergens to be marked
|
||||
*/
|
||||
class CanteenOfferPageAdapter(
|
||||
val fragmentActivity: FragmentActivity,
|
||||
fragmentActivity: FragmentActivity,
|
||||
private var offers: List<CanteenOfferGroup>,
|
||||
private var daysCovered: Int,
|
||||
private val onClickListener: CanteenOfferItemAdapter.OnClickListener,
|
||||
|
||||
Reference in New Issue
Block a user