Merge pull request #2314 from Andries-Smit/wear/fixup-simple-ui-outdated
Wear fixup simple UI outdated
This commit is contained in:
commit
7b8e5ece99
1 changed files with 8 additions and 11 deletions
|
@ -24,6 +24,7 @@ class SimpleUi @Inject constructor(
|
||||||
private val sp: SP,
|
private val sp: SP,
|
||||||
private val dateUtil: DateUtil
|
private val dateUtil: DateUtil
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private var batteryReceiver: BroadcastReceiver? = null
|
private var batteryReceiver: BroadcastReceiver? = null
|
||||||
private var mBackgroundPaint = Paint()
|
private var mBackgroundPaint = Paint()
|
||||||
private lateinit var mTimePaint: Paint
|
private lateinit var mTimePaint: Paint
|
||||||
|
@ -89,19 +90,15 @@ class SimpleUi @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isOutdated(singleBg: EventData.SingleBg): Boolean {
|
private fun isOutdated(singleBg: EventData.SingleBg): Boolean =
|
||||||
val timeSince = (System.currentTimeMillis() - singleBg.timeStamp).toDouble()
|
singleBg.timeStamp > 0 && (System.currentTimeMillis() - singleBg.timeStamp) > 1000 * 60 * 12
|
||||||
return singleBg.timeStamp > 0 && (timeSince <= 1000 * 60 * 12)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getBgColour(level: Long): Int {
|
private fun getBgColour(level: Long): Int =
|
||||||
if (level == 1L) {
|
when (level) {
|
||||||
return colorDarkHigh
|
1L -> colorDarkHigh
|
||||||
|
0L -> colorDarkMid
|
||||||
|
else -> colorDarkLow
|
||||||
}
|
}
|
||||||
return if (level == 0L) {
|
|
||||||
colorDarkMid
|
|
||||||
} else colorDarkLow
|
|
||||||
}
|
|
||||||
|
|
||||||
private val isCharging: Boolean
|
private val isCharging: Boolean
|
||||||
get() {
|
get() {
|
||||||
|
|
Loading…
Reference in a new issue