aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'androidApp/src/main')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt11
-rw-r--r--androidApp/src/main/res/layout/units_activity.xml3
-rw-r--r--androidApp/src/main/res/values/dimen.xml3
3 files changed, 15 insertions, 2 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 175e908..42e30d9 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
@@ -1,8 +1,12 @@
package mx.trackermap.TrackerMap.android.devices
+import android.util.TypedValue
import android.view.LayoutInflater
import android.view.ViewGroup
+import android.widget.FrameLayout
+import androidx.core.view.updateLayoutParams
import androidx.recyclerview.widget.RecyclerView
+import mx.trackermap.TrackerMap.android.R
import mx.trackermap.TrackerMap.android.databinding.UnitItemBinding
import mx.trackermap.TrackerMap.client.models.UnitInformation
@@ -24,7 +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<RecyclerView.LayoutParams> {
+ this.topMargin =
+ context.resources.getDimensionPixelSize(R.dimen.nav_height)
+ }
+ }
UnitRenderData.render(
UnitRenderData.UnitRenderViewHolder(
unitName = unitName,
diff --git a/androidApp/src/main/res/layout/units_activity.xml b/androidApp/src/main/res/layout/units_activity.xml
index 08d1cd0..86fd99c 100644
--- a/androidApp/src/main/res/layout/units_activity.xml
+++ b/androidApp/src/main/res/layout/units_activity.xml
@@ -11,11 +11,10 @@
android:id="@+id/displayContainer"
android:layout_width="0dp"
android:layout_height="0dp"
- android:layout_marginTop="@dimen/fab_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/displayModeToggle" />
+ app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/userButton"
diff --git a/androidApp/src/main/res/values/dimen.xml b/androidApp/src/main/res/values/dimen.xml
index d557010..5b17b3e 100644
--- a/androidApp/src/main/res/values/dimen.xml
+++ b/androidApp/src/main/res/values/dimen.xml
@@ -22,6 +22,9 @@
<dimen name="fab_margin">12dp</dimen>
<dimen name="fab_elevation">8dp</dimen>
+ <!-- fab_margin + 40dp (fabSize="mini") + fab_margin -->
+ <dimen name="nav_height">64dp</dimen>
+
<!-- Map -->
<dimen name="marker_label_text_size">11sp</dimen>
<dimen name="geofence_label_text_size">11sp</dimen>