Fixed a bug that would cause the tab for a day without canteen offers to not be shown, causing the offers for the next days to be shifted over, thus not showing the offers for the last day that's available online. I know I didn't explain that very well, but it's fixed now anyway, soo (: also made some minor visual adjustments to margins and colours

This commit is contained in:
denizk0461
2023-04-20 21:35:09 +02:00
parent 07a2902367
commit b39aa1f003
11 changed files with 88 additions and 64 deletions
@@ -45,24 +45,23 @@ class StudIPEventItemAdapter(
val colorTextHintLighter = TypedValue()
val theme = holder.binding.root.context.theme
theme.resolveAttribute(R.attr.colorPrimaryTranslucent, colorPrimaryTranslucent, true)
theme.resolveAttribute(R.attr.colorCardBackground, colorCardBackground, true)
theme.resolveAttribute(R.attr.colorTextHintLighter, colorTextHintLighter, true)
theme.apply {
resolveAttribute(R.attr.colorPrimaryTranslucent, colorPrimaryTranslucent, true)
resolveAttribute(R.attr.colorCardBackground, colorCardBackground, true)
resolveAttribute(R.attr.colorTextHintLighter, colorTextHintLighter, true)
}
if (!isAnyCourseHighlighted && currentItem.isCurrentCourse(currentCalendar)) { // highlight
isAnyCourseHighlighted = true
holder.binding.cardBackground.apply {
backgroundTintList = ColorStateList.valueOf(colorPrimaryTranslucent.data)//R.attr.colorPrimaryTranslucent)
backgroundTintList = ColorStateList.valueOf(colorPrimaryTranslucent.data)
strokeColor = context.getColor(android.R.color.transparent)
}//colorPrimary.data
// holder.binding.cardBackground.strokeWidth = 6 // TODO replace this with proper float -> dp conversion
// R.color.list_card_selected)
}
} else { // un-highlight
holder.binding.cardBackground.apply {
backgroundTintList = ColorStateList.valueOf(colorCardBackground.data)//context.getColor(R.attr.colorCardBackground))
backgroundTintList = ColorStateList.valueOf(colorCardBackground.data)
strokeColor = colorTextHintLighter.data
}
// holder.binding.cardBackground.strokeWidth = 3 // this should (?) be 1dp
}
holder.binding.cardBackground.setOnClickListener {