mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-14 21:18:51 -06:00
Implement scrolling with group
This commit is contained in:
@@ -63,8 +63,13 @@ class HabitCardListView(
|
|||||||
set(value) {
|
set(value) {
|
||||||
field = value
|
field = value
|
||||||
attachedHolders
|
attachedHolders
|
||||||
.map { it.itemView as HabitCardView }
|
.forEach {
|
||||||
.forEach { it.dataOffset = value }
|
if (it.itemView is HabitCardView) {
|
||||||
|
(it.itemView as HabitCardView).dataOffset = value
|
||||||
|
} else {
|
||||||
|
(it.itemView as HabitGroupCardView).dataOffset = value
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val attachedHolders = mutableListOf<HabitCardViewHolder>()
|
private val attachedHolders = mutableListOf<HabitCardViewHolder>()
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ class HabitGroupCardView(
|
|||||||
) : FrameLayout(context),
|
) : FrameLayout(context),
|
||||||
ModelObservable.Listener {
|
ModelObservable.Listener {
|
||||||
|
|
||||||
|
var dataOffset = 0
|
||||||
|
|
||||||
var habitGroup: HabitGroup? = null
|
var habitGroup: HabitGroup? = null
|
||||||
set(newHabitGroup) {
|
set(newHabitGroup) {
|
||||||
if (isAttachedToWindow) {
|
if (isAttachedToWindow) {
|
||||||
|
|||||||
Reference in New Issue
Block a user