Merge pull request #482 from meshtastic/env

add EnvironmentMetrics to nodes tab
This commit is contained in:
Andre K 2022-09-12 18:30:02 -03:00 committed by GitHub
commit 382535da47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 2 deletions

View file

@ -42,6 +42,7 @@ class UsersFragment : ScreenFragment("Users"), Logging {
val lastTime = itemView.lastConnectionView
val powerIcon = itemView.batteryIcon
val signalView = itemView.signalView
val envMetrics = itemView.envMetrics
}
private val nodesAdapter = object : RecyclerView.Adapter<ViewHolder>() {
@ -136,6 +137,13 @@ class UsersFragment : ScreenFragment("Users"), Logging {
holder.lastTime.text = formatAgo(n.lastHeard)
if (n.envMetricStr.isNotEmpty()) {
holder.envMetrics.text = n.envMetricStr
holder.envMetrics.visibility = View.VISIBLE
} else {
holder.envMetrics.visibility = View.GONE
}
if (n.num == ourNodeInfo?.num) {
val info = model.myNodeInfo.value
if (info != null) {