Transitioned from a fairly custom solution to using a colour palette generated by the Material Theme Builder to simplify colour management. Also began work on a bottom sheet for displaying allergens and additives in canteen offers.

This commit is contained in:
denizk0461
2023-04-23 17:13:48 +02:00
parent fbad84aa09
commit b957172721
42 changed files with 456 additions and 273 deletions
@@ -16,10 +16,12 @@ import com.denizk0461.studip.model.CanteenOfferGroup
* @param daysCovered tells for how many days offers are available for.
* Example: if the next two weeks are available, Monday through Friday and
* excluding weekends, this value should be 10.
* @param onClickListener for managing click and long press events
*/
class CanteenOfferPageAdapter(
private var offers: List<CanteenOfferGroup>,
private var daysCovered: Int,
private val onClickListener: CanteenOfferItemAdapter.OnClickListener,
) : RecyclerView.Adapter<CanteenOfferPageAdapter.CanteenOfferPageViewHolder>() {
/**
@@ -50,8 +52,12 @@ class CanteenOfferPageAdapter(
/*
* Create new adapter for every page. Attribute position denotes day that will be set up
* by the newly created adapter (0 = Monday, 4 = Friday)
* TODO check if the filtered list is empty, and tell the user if it is
*/
adapter = CanteenOfferItemAdapter(offers.filter { it.dateId == position }) // TODO check if empty
adapter = CanteenOfferItemAdapter(
offers.filter { it.dateId == position },
onClickListener
)
// Animate creation of new page
scheduleLayoutAnimation()