Archived
Implemented ability to change the fragment opened on app start; made some optimisations to DietaryPreferences.kt. BUG: tab layout mediator is annoying af
This commit is contained in:
@@ -68,11 +68,13 @@ class CanteenOfferItemAdapter(
|
||||
// Inflate a new icon holder
|
||||
val img = ItemIconBinding.inflate(LayoutInflater.from(holder.binding.root.context))
|
||||
|
||||
val (_, drawableId) = DietaryPreferences.getData(DietaryPreferences.ERROR.ordinal)
|
||||
|
||||
// Set a cross icon
|
||||
img.imageView.setImageDrawable(
|
||||
AppCompatResources.getDrawable(
|
||||
holder.binding.root.context,
|
||||
DietaryPreferences.indexToDrawable[11]!!,
|
||||
drawableId,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -117,11 +119,13 @@ class CanteenOfferItemAdapter(
|
||||
// Inflate a new icon holder
|
||||
val img = ItemIconBinding.inflate(LayoutInflater.from(holder.binding.root.context))
|
||||
|
||||
val (_, drawableId) = DietaryPreferences.getData(index)
|
||||
|
||||
// Set the appropriate icon
|
||||
img.imageView.setImageDrawable(
|
||||
AppCompatResources.getDrawable(
|
||||
holder.binding.root.context,
|
||||
DietaryPreferences.indexToDrawable[index]!!,
|
||||
drawableId,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user