LunaEvent: rework sleep event

Make the UI more flexible and
slightly easier to understand.
This commit is contained in:
2026-10-12 22:20:15 +02:00
committed by penguin86
parent 3ccd2db7b1
commit 01e7ad07c8
6 changed files with 146 additions and 66 deletions
@@ -58,12 +58,7 @@ class LunaEventRecyclerAdapter: RecyclerView.Adapter<LunaEventRecyclerAdapter.Lu
LunaEvent.Type.NOTE -> item.notes
else -> item.getRowItemTitle(context)
}
val endTime = if (item.type == LunaEvent.Type.SLEEP) {
item.quantity + item.time
} else {
item.time
}
holder.time.text = DateUtils.formatTimeAgo(context, endTime)
holder.time.text = DateUtils.formatTimeAgo(context, item.getEndTime())
var quantityText = numericUtils.formatEventQuantity(item)
// if the event is weight, show difference with the last one