Implement scrolling with group

This commit is contained in:
Dharanish
2024-07-01 23:41:02 +02:00
parent 506086f003
commit 676f141d99
2 changed files with 9 additions and 2 deletions

View File

@@ -63,8 +63,13 @@ class HabitCardListView(
set(value) {
field = value
attachedHolders
.map { it.itemView as HabitCardView }
.forEach { it.dataOffset = value }
.forEach {
if (it.itemView is HabitCardView) {
(it.itemView as HabitCardView).dataOffset = value
} else {
(it.itemView as HabitGroupCardView).dataOffset = value
}
}
}
private val attachedHolders = mutableListOf<HabitCardViewHolder>()

View File

@@ -30,6 +30,8 @@ class HabitGroupCardView(
) : FrameLayout(context),
ModelObservable.Listener {
var dataOffset = 0
var habitGroup: HabitGroup? = null
set(newHabitGroup) {
if (isAttachedToWindow) {