Fix statistics activity
This commit is contained in:
parent
67b3b2613d
commit
ae87a6ae0c
1 changed files with 2 additions and 1 deletions
|
@ -53,8 +53,9 @@ object ActivityMonitor : Application.ActivityLifecycleCallbacks {
|
||||||
var result = ""
|
var result = ""
|
||||||
for ((key, value) in keys)
|
for ((key, value) in keys)
|
||||||
if (key.startsWith("Monitor") && key.endsWith("total")) {
|
if (key.startsWith("Monitor") && key.endsWith("total")) {
|
||||||
|
val v = if (value is Long) value else SafeParse.stringToLong(value as String)
|
||||||
val activity = key.split("_")[1].replace("Activity", "")
|
val activity = key.split("_")[1].replace("Activity", "")
|
||||||
val duration = DateUtil.niceTimeScalar(value as Long)
|
val duration = DateUtil.niceTimeScalar(v as Long)
|
||||||
val start = SP.getLong(key.replace("total", "start"), 0)
|
val start = SP.getLong(key.replace("total", "start"), 0)
|
||||||
val days = T.msecs(DateUtil.now() - start).days()
|
val days = T.msecs(DateUtil.now() - start).days()
|
||||||
result += "<b><span style=\"color:yellow\">$activity:</span></b> <b>$duration</b> in <b>$days</b> days<br>"
|
result += "<b><span style=\"color:yellow\">$activity:</span></b> <b>$duration</b> in <b>$days</b> days<br>"
|
||||||
|
|
Loading…
Reference in a new issue