From 2ffc7cfef0ac9d40f3b97efd38a201cf43341dd7 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 13 Jan 2022 19:17:11 -0600 Subject: Fixed top margin on DevicesAdapter --- .../mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt index 42e30d9..53e726e 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt @@ -28,14 +28,14 @@ class DevicesAdapter( override fun onBindViewHolder(holder: ViewHolder, position: Int) { val unit = units[position] val context = holder.itemView.context - val metrics = context.resources.displayMetrics holder.binding.apply { - if (position == 0) { - swipeLayout.updateLayoutParams { - this.topMargin = + + swipeLayout.updateLayoutParams { + this.topMargin = if (position == 0) context.resources.getDimensionPixelSize(R.dimen.nav_height) - } + else 0 } + UnitRenderData.render( UnitRenderData.UnitRenderViewHolder( unitName = unitName, -- cgit v1.2.3