From 7baad408f97d7d4ab512b822bdc0799469e2d496 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 11 Jan 2022 18:05:27 -0600 Subject: Minor layout improvements --- .../mx/trackermap/TrackerMap/android/units/UnitsActivity.kt | 11 +++++++---- androidApp/src/main/res/layout/unit_item.xml | 11 +++++------ androidApp/src/main/res/layout/unit_map_fragment.xml | 8 ++++---- androidApp/src/main/res/values/dimen.xml | 3 +++ 4 files changed, 19 insertions(+), 14 deletions(-) (limited to 'androidApp') diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt index 9598077..409919a 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt @@ -39,21 +39,24 @@ class UnitsActivity : AppCompatActivity() { private fun setupEvents() { binding.drawerButton.setOnClickListener { - binding.drawerLayout.openDrawer(Gravity.LEFT) + binding.drawerLayout.openDrawer(binding.navigationView) } binding.navigationView.setNavigationItemSelectedListener { when (it.itemId) { R.id.nav_account -> { Toast.makeText(this, "Account button tapped!", Toast.LENGTH_SHORT).show() - true + binding.drawerLayout.closeDrawers() + false } R.id.nav_about -> { Toast.makeText(this, "About button tapped!", Toast.LENGTH_SHORT).show() - true + binding.drawerLayout.closeDrawers() + false } R.id.nav_logout -> { Toast.makeText(this, "Logout button tapped!", Toast.LENGTH_SHORT).show() - true + binding.drawerLayout.closeDrawers() + false } else -> false } diff --git a/androidApp/src/main/res/layout/unit_item.xml b/androidApp/src/main/res/layout/unit_item.xml index 261a7a6..d9432ba 100644 --- a/androidApp/src/main/res/layout/unit_item.xml +++ b/androidApp/src/main/res/layout/unit_item.xml @@ -17,8 +17,7 @@ android:layout_gravity="end" android:paddingTop="@dimen/card_padding" android:paddingBottom="@dimen/card_padding" - android:paddingStart="@dimen/card_padding" - android:paddingEnd="@dimen/card_padding" + android:paddingHorizontal="@dimen/card_padding" android:gravity="center" android:orientation="horizontal" android:visibility="visible"> @@ -31,8 +30,8 @@ app:cardBackgroundColor="@color/colorAccent" android:text="@string/unit_details" android:textColor="@color/colorAccent" - android:textSize="12sp" - style="?borderlessButtonStyle" /> + android:textSize="@dimen/card_action_text" + style="?borderlessButtonStyle"/> diff --git a/androidApp/src/main/res/layout/unit_map_fragment.xml b/androidApp/src/main/res/layout/unit_map_fragment.xml index 9149fc6..213d33d 100644 --- a/androidApp/src/main/res/layout/unit_map_fragment.xml +++ b/androidApp/src/main/res/layout/unit_map_fragment.xml @@ -155,7 +155,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/gridLayout" - android:layout_marginTop="@dimen/padding" + android:layout_marginVertical="@dimen/padding" android:gravity="center" android:orientation="horizontal" android:visibility="visible"> @@ -167,7 +167,7 @@ android:layout_weight="1" android:text="@string/unit_details" android:textColor="@color/colorAccent" - android:textSize="12sp" + android:textSize="@dimen/card_action_text" style="?borderlessButtonStyle" /> diff --git a/androidApp/src/main/res/values/dimen.xml b/androidApp/src/main/res/values/dimen.xml index 283f476..9507352 100644 --- a/androidApp/src/main/res/values/dimen.xml +++ b/androidApp/src/main/res/values/dimen.xml @@ -10,6 +10,9 @@ 16dp 16dp + + 11sp + 8dp 4dp -- cgit v1.2.3