From ee9e673695e221e115758b1ac32a6b63683ae7c9 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 11 Jan 2022 20:05:03 -0600 Subject: unit_item.xml data fields are generated programmatically, and DevicesAdapter code was refactored into UnitRenderData to be shared with UnitMapFragment. --- androidApp/src/main/res/drawable/device_locked.xml | 2 +- .../src/main/res/drawable/device_unlocked.xml | 2 +- androidApp/src/main/res/layout/unit_item.xml | 136 +++++---------------- .../src/main/res/layout/unit_map_fragment.xml | 89 +------------- androidApp/src/main/res/values/colors.xml | 3 + 5 files changed, 38 insertions(+), 194 deletions(-) (limited to 'androidApp/src/main/res') diff --git a/androidApp/src/main/res/drawable/device_locked.xml b/androidApp/src/main/res/drawable/device_locked.xml index 1fe62c8..0a69232 100644 --- a/androidApp/src/main/res/drawable/device_locked.xml +++ b/androidApp/src/main/res/drawable/device_locked.xml @@ -1,4 +1,4 @@ - diff --git a/androidApp/src/main/res/drawable/device_unlocked.xml b/androidApp/src/main/res/drawable/device_unlocked.xml index ed352bf..3c6d329 100644 --- a/androidApp/src/main/res/drawable/device_unlocked.xml +++ b/androidApp/src/main/res/drawable/device_unlocked.xml @@ -1,4 +1,4 @@ - diff --git a/androidApp/src/main/res/layout/unit_item.xml b/androidApp/src/main/res/layout/unit_item.xml index d9432ba..d46e7a1 100644 --- a/androidApp/src/main/res/layout/unit_item.xml +++ b/androidApp/src/main/res/layout/unit_item.xml @@ -15,9 +15,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="end" - android:paddingTop="@dimen/card_padding" - android:paddingBottom="@dimen/card_padding" - android:paddingHorizontal="@dimen/card_padding" + android:padding="@dimen/card_padding" android:gravity="center" android:orientation="horizontal" android:visibility="visible"> @@ -31,18 +29,17 @@ android:text="@string/unit_details" android:textColor="@color/colorAccent" android:textSize="@dimen/card_action_text" - style="?borderlessButtonStyle"/> + style="?android:borderlessButtonStyle"/> + style="?android:borderlessButtonStyle"/> + style="?android:borderlessButtonStyle" /> @@ -70,127 +67,52 @@ android:clickable="true" android:focusable="true"> - + android:orientation="vertical"> - - - - - - - - - - - + android:gravity="center_vertical" + android:orientation="horizontal"> - - + android:layout_marginEnd="5dp" + android:src="@drawable/device_status" + app:tint="?android:textColorPrimary" + tools:ignore="ContentDescription" /> + android:visibility="gone" + android:layout_marginEnd="5dp" + android:src="@drawable/device_unlocked" + tools:ignore="ContentDescription" /> - - + style="@style/TextAppearance.AppCompat.Body2" + tools:text="1AAUTO" /> + - - - + - + diff --git a/androidApp/src/main/res/layout/unit_map_fragment.xml b/androidApp/src/main/res/layout/unit_map_fragment.xml index 213d33d..a920b14 100644 --- a/androidApp/src/main/res/layout/unit_map_fragment.xml +++ b/androidApp/src/main/res/layout/unit_map_fragment.xml @@ -68,87 +68,7 @@ android:id="@+id/gridLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@id/unitName"> - - - - - - - - - - - - - - - - - - + android:layout_below="@id/unitName" /> + style="?android:borderlessButtonStyle" /> + style="?android:borderlessButtonStyle" /> + style="?android:borderlessButtonStyle" /> diff --git a/androidApp/src/main/res/values/colors.xml b/androidApp/src/main/res/values/colors.xml index 8f96260..0ebcff7 100644 --- a/androidApp/src/main/res/values/colors.xml +++ b/androidApp/src/main/res/values/colors.xml @@ -5,4 +5,7 @@ #EB473E #FDFDFD #ECEFF3 + + #388E3C + #D32F2F \ No newline at end of file -- cgit v1.2.3