mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: Line breaks for time separations linked to TimeFrame (#1502)
This commit is contained in:
parent
45e50b829a
commit
16a8503207
3 changed files with 19 additions and 5 deletions
|
|
@ -147,6 +147,20 @@ enum class TimeFrame(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to detect a significant time separation between [Telemetry]s.
|
||||
*/
|
||||
fun timeThreshold(): Long {
|
||||
return when (this.ordinal) {
|
||||
TWENTY_FOUR_HOURS.ordinal ->
|
||||
TimeUnit.HOURS.toSeconds(6)
|
||||
FORTY_EIGHT_HOURS.ordinal ->
|
||||
TimeUnit.HOURS.toSeconds(12)
|
||||
else ->
|
||||
TimeUnit.DAYS.toSeconds(1)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the needed [Dp] depending on the amount of time being plotted.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue