aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/res/layout
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-16 02:51:12 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-16 02:51:12 -0600
commit04b33cf071672a955c3e3229f8d48de4c215dc18 (patch)
tree2c914f063023057ea944d56a65d49ca02f35cb99 /androidApp/src/main/res/layout
parentae8733682d89098348bd3d880f85028cb1bc2b6b (diff)
downloadetbsa-trackermap-mobile-04b33cf071672a955c3e3229f8d48de4c215dc18.tar.gz
etbsa-trackermap-mobile-04b33cf071672a955c3e3229f8d48de4c215dc18.tar.bz2
etbsa-trackermap-mobile-04b33cf071672a955c3e3229f8d48de4c215dc18.zip
- Basically fully implemented device item with all details and icons.
- Attributes for all models are deserialized as Map<String, JsonPrimitive>. - Removed redundant qualifier names
Diffstat (limited to 'androidApp/src/main/res/layout')
-rw-r--r--androidApp/src/main/res/layout/unit_item.xml146
-rw-r--r--androidApp/src/main/res/layout/units_activity.xml2
2 files changed, 113 insertions, 35 deletions
diff --git a/androidApp/src/main/res/layout/unit_item.xml b/androidApp/src/main/res/layout/unit_item.xml
index cdf0610..0c4b34d 100644
--- a/androidApp/src/main/res/layout/unit_item.xml
+++ b/androidApp/src/main/res/layout/unit_item.xml
@@ -9,56 +9,134 @@
app:cardCornerRadius="@dimen/card_border_radius"
app:cardElevation="0dp"
app:cardUseCompatPadding="true"
- app:contentPadding="16dp">
+ app:contentPadding="@dimen/card_padding">
- <LinearLayout
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
android:animateLayoutChanges="true">
- <TextView
- android:id="@+id/unitName"
- android:layout_width="match_parent"
+ <ImageView
+ android:id="@+id/statusIcon"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="26dp"
- tools:text="1AAUTO" />
+ android:layout_marginEnd="5dp"
+ android:src="@drawable/ic_baseline_fiber_manual_record_24"
+ app:tint="?android:textColorPrimary" />
- <TextView
- android:id="@+id/driverName"
- android:layout_width="match_parent"
+ <ImageView
+ android:id="@+id/engineStopIcon"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="18dp"
- tools:text="Javier Zavala" />
+ android:layout_toEndOf="@id/statusIcon"
+ android:visibility="gone"
+ android:layout_marginEnd="5dp"
+ android:src="@drawable/ic_baseline_lock_24" />
<TextView
- android:id="@+id/unitSpeed"
+ android:id="@+id/unitName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textSize="18dp"
- tools:text="0 Km/h - Stopped" />
+ android:layout_toEndOf="@id/engineStopIcon"
+ style="@style/TextAppearance.AppCompat.Body2"
+ tools:text="1AAUTO" />
- <TextView
- android:id="@+id/lastAddress"
+ <GridLayout
+ android:id="@+id/gridLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textSize="18dp"
- tools:text="404 Av. Arboledas, Celaya, Gto." />
+ android:layout_below="@id/unitName">
- <TextView
- android:id="@+id/lastDate"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18dp"
- tools:text="4 de Diciembre de 2021, 7:00 PM" />
+ <ImageView
+ android:id="@+id/driverNameIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="6dp"
+ android:layout_column="0"
+ android:layout_row="1"
+ android:contentDescription="@string/unit_driver_name"
+ android:src="@drawable/ic_baseline_person_24"
+ app:tint="?android:textColorSecondary" />
+
+ <TextView
+ android:id="@+id/driverName"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_column="1"
+ android:layout_row="1"
+ style="@style/TextAppearance.AppCompat.Caption"
+ tools:text="Javier Zavala" />
+
+ <ImageView
+ android:id="@+id/unitSpeedIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="2"
+ style="@style/TextAppearance.MaterialComponents.Caption"
+ android:contentDescription="@string/unit_speed"
+ android:src="@drawable/ic_baseline_speed_24"
+ app:tint="?android:textColorSecondary" />
+
+ <TextView
+ android:id="@+id/unitSpeed"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_column="1"
+ android:layout_row="2"
+ style="@style/TextAppearance.AppCompat.Caption"
+ tools:text="0 Km/h - Stopped" />
+
+ <ImageView
+ android:id="@+id/lastAddressIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="3"
+ android:contentDescription="@string/unit_last_address"
+ android:src="@drawable/ic_baseline_location_on_24"
+ app:tint="?android:textColorSecondary" />
+
+ <TextView
+ android:id="@+id/lastAddress"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_column="1"
+ android:layout_row="3"
+ style="@style/TextAppearance.AppCompat.Caption"
+ tools:text="404 Av. Arboledas, Celaya, Gto." />
+
+ <ImageView
+ android:id="@+id/lastDateIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="4"
+ android:contentDescription="@string/unit_last_date"
+ android:src="@drawable/ic_baseline_calendar_today_24"
+ app:tint="?android:textColorSecondary" />
+
+
+ <TextView
+ android:id="@+id/lastDate"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_column="1"
+ android:layout_row="4"
+ style="@style/TextAppearance.AppCompat.Caption"
+ tools:text="4 de Diciembre de 2021, 7:00 PM" />
+
+ </GridLayout>
<LinearLayout
android:id="@+id/itemOptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_below="@id/gridLayout"
+ android:layout_marginTop="@dimen/card_padding"
android:gravity="center"
android:orientation="horizontal"
- android:visibility="gone">
+ android:visibility="visible">
<com.google.android.material.button.MaterialButton
android:id="@+id/detailsButton"
@@ -66,8 +144,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/unit_details"
- android:textColor="@color/colorPrimaryDark"
- app:backgroundTint="@color/darkBackground" />
+ android:textColor="@color/colorAccent"
+ style="?borderlessButtonStyle" />
<com.google.android.material.button.MaterialButton
android:id="@+id/reportsButton"
@@ -76,8 +154,8 @@
android:layout_marginHorizontal="8dp"
android:layout_weight="1"
android:text="@string/unit_reports"
- android:textColor="@color/colorPrimaryDark"
- app:backgroundTint="@color/darkBackground" />
+ android:textColor="@color/colorAccent"
+ style="?borderlessButtonStyle" />
<com.google.android.material.button.MaterialButton
android:id="@+id/commandsButton"
@@ -85,11 +163,11 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/unit_commands"
- android:textColor="@color/colorPrimaryDark"
- app:backgroundTint="@color/darkBackground" />
+ android:textColor="@color/colorAccent"
+ style="?borderlessButtonStyle" />
</LinearLayout>
- </LinearLayout>
+ </RelativeLayout>
</com.google.android.material.card.MaterialCardView> \ No newline at end of file
diff --git a/androidApp/src/main/res/layout/units_activity.xml b/androidApp/src/main/res/layout/units_activity.xml
index 4f4ee77..f0d80ab 100644
--- a/androidApp/src/main/res/layout/units_activity.xml
+++ b/androidApp/src/main/res/layout/units_activity.xml
@@ -37,7 +37,7 @@
app:layout_constraintBottom_toBottomOf="@id/displayModeToggle"
android:layout_marginVertical="@dimen/search_vertical_margin"
android:layout_marginHorizontal="@dimen/search_horizontal_margin"
- app:cardCornerRadius="25dp"
+ app:cardCornerRadius="@dimen/card_border_radius"
app:cardElevation="@dimen/card_elevation">
<com.google.android.material.textfield.TextInputEditText