aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-11 20:49:59 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-11 20:49:59 -0600
commit9b5850870bef2770f281d51b5c96ac9103ab3667 (patch)
tree4acde4e1afa8ac4e01dc426de34409e786749c99 /androidApp/src/main
parentee9e673695e221e115758b1ac32a6b63683ae7c9 (diff)
downloadetbsa-trackermap-mobile-9b5850870bef2770f281d51b5c96ac9103ab3667.tar.gz
etbsa-trackermap-mobile-9b5850870bef2770f281d51b5c96ac9103ab3667.tar.bz2
etbsa-trackermap-mobile-9b5850870bef2770f281d51b5c96ac9103ab3667.zip
More layout tweaks and fixes
Diffstat (limited to 'androidApp/src/main')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/UnitRenderData.kt5
-rw-r--r--androidApp/src/main/res/layout/unit_map_fragment.xml62
-rw-r--r--androidApp/src/main/res/values/dimen.xml2
3 files changed, 37 insertions, 32 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/UnitRenderData.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/UnitRenderData.kt
index 1b23ba0..f9b7a27 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/UnitRenderData.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/UnitRenderData.kt
@@ -147,14 +147,13 @@ class UnitRenderData {
val imageLayout = GridLayout.LayoutParams()
imageLayout.width = GridLayout.LayoutParams.WRAP_CONTENT
imageLayout.height = GridLayout.LayoutParams.WRAP_CONTENT
- imageLayout.setGravity(Gravity.CENTER_VERTICAL)
imageLayout.marginEnd =
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6f, metrics).toInt()
imageLayout.rowSpec = GridLayout.spec(i)
imageLayout.columnSpec = GridLayout.spec(0)
imageView.layoutParams = imageLayout
- /* Property ext */
+ /* Property text */
val textView = TextView(gridLayout.context)
textView.text = detail.second
@@ -167,6 +166,8 @@ class UnitRenderData {
gridLayout.addView(imageView)
gridLayout.addView(textView)
+
+ imageLayout.setGravity(Gravity.CENTER)
}
actionCallback?.let { callback ->
diff --git a/androidApp/src/main/res/layout/unit_map_fragment.xml b/androidApp/src/main/res/layout/unit_map_fragment.xml
index a920b14..87eb4ac 100644
--- a/androidApp/src/main/res/layout/unit_map_fragment.xml
+++ b/androidApp/src/main/res/layout/unit_map_fragment.xml
@@ -31,50 +31,54 @@
app:contentPaddingRight="@dimen/card_padding"
android:visibility="gone">
- <RelativeLayout
+ <LinearLayout
android:id="@+id/mainContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:orientation="vertical"
android:animateLayoutChanges="true">
- <ImageView
- android:id="@+id/statusIcon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="5dp"
- android:src="@drawable/device_status"
- app:tint="?android:textColorPrimary"
- tools:ignore="ContentDescription" />
-
- <ImageView
- android:id="@+id/engineStopIcon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toEndOf="@id/statusIcon"
- android:visibility="gone"
- android:layout_marginEnd="5dp"
- android:src="@drawable/device_unlocked"
- tools:ignore="ContentDescription" />
-
- <TextView
- android:id="@+id/unitName"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_toEndOf="@id/engineStopIcon"
- style="@style/TextAppearance.AppCompat.Body2"
- tools:text="1AAUTO" />
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/statusIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="5dp"
+ android:src="@drawable/device_status"
+ app:tint="?android:textColorPrimary"
+ tools:ignore="ContentDescription" />
+
+ <ImageView
+ android:id="@+id/engineStopIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:layout_marginEnd="5dp"
+ android:src="@drawable/device_unlocked"
+ tools:ignore="ContentDescription" />
+
+ <TextView
+ android:id="@+id/unitName"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ style="@style/TextAppearance.AppCompat.Body2"
+ tools:text="1AAUTO" />
+
+ </LinearLayout>
<GridLayout
android:id="@+id/gridLayout"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/unitName" />
+ android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/itemOptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@id/gridLayout"
android:layout_marginVertical="@dimen/padding"
android:gravity="center"
android:orientation="horizontal"
@@ -112,7 +116,7 @@
</LinearLayout>
- </RelativeLayout>
+ </LinearLayout>
</androidx.cardview.widget.CardView>
diff --git a/androidApp/src/main/res/values/dimen.xml b/androidApp/src/main/res/values/dimen.xml
index 9507352..8acc9a3 100644
--- a/androidApp/src/main/res/values/dimen.xml
+++ b/androidApp/src/main/res/values/dimen.xml
@@ -11,7 +11,7 @@
<dimen name="card_margin">16dp</dimen>
<!-- Card Buttons -->
- <dimen name="card_action_text">11sp</dimen>
+ <dimen name="card_action_text">12sp</dimen>
<!-- Search -->
<dimen name="search_horizontal_margin">8dp</dimen>