forked from penguin86/luna-tracker
Compare commits
3 Commits
11a4f12fbe
...
19774016e1
| Author | SHA1 | Date | |
|---|---|---|---|
| 19774016e1 | |||
| 409495948d | |||
| d74310fad5 |
@@ -59,7 +59,7 @@ class LunaEventRecyclerAdapter: RecyclerView.Adapter<LunaEventRecyclerAdapter.Lu
|
|||||||
LunaEvent.TYPE_CUSTOM -> item.notes
|
LunaEvent.TYPE_CUSTOM -> item.notes
|
||||||
else -> item.getTypeDescription(context)
|
else -> item.getTypeDescription(context)
|
||||||
}
|
}
|
||||||
holder.time.text = DateUtils.formatTimeAgo(context, item.time)
|
holder.time.text = DateUtils.formatTimeAgo(context, item.getEndTime())
|
||||||
var quantityText = numericUtils.formatEventQuantity(item)
|
var quantityText = numericUtils.formatEventQuantity(item)
|
||||||
|
|
||||||
// if the event is weight, show difference with the last one
|
// if the event is weight, show difference with the last one
|
||||||
|
|||||||
@@ -94,6 +94,18 @@ class LunaEvent: Comparable<LunaEvent> {
|
|||||||
this.quantity = quantity
|
this.quantity = quantity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getStartTime(): Long {
|
||||||
|
return time
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getEndTime(): Long {
|
||||||
|
return if (type == TYPE_SLEEP) {
|
||||||
|
time + quantity
|
||||||
|
} else {
|
||||||
|
time
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getTypeEmoji(context: Context): String {
|
fun getTypeEmoji(context: Context): String {
|
||||||
return context.getString(
|
return context.getString(
|
||||||
when (type) {
|
when (type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user