aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-13 18:46:43 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-13 18:46:43 -0600
commit40b9a03ecb0d0f191934fb2e6102c6e7e05aef5e (patch)
tree5dcffe06f3b38ba8d16acf1d6d231e12b2d948bb /androidApp/src/main
parent2f23203099cd152c36571a39c42ff3056c13484c (diff)
downloadetbsa-trackermap-mobile-40b9a03ecb0d0f191934fb2e6102c6e7e05aef5e.tar.gz
etbsa-trackermap-mobile-40b9a03ecb0d0f191934fb2e6102c6e7e05aef5e.tar.bz2
etbsa-trackermap-mobile-40b9a03ecb0d0f191934fb2e6102c6e7e05aef5e.zip
Full screen map/devices fragment on UnitsActivity
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>