From 1c877fcc48fba0afa0362ae7273cf9e0cd03458f Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 11 Jan 2022 17:45:13 -0600 Subject: Implements base drawer layout menu --- .../TrackerMap/android/units/UnitsActivity.kt | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'androidApp/src/main/java') 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 6bc7aab..9598077 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 @@ -2,6 +2,8 @@ package mx.trackermap.TrackerMap.android.units import android.os.Bundle import android.util.Log +import android.view.Gravity +import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.core.widget.doAfterTextChanged import androidx.fragment.app.commit @@ -36,11 +38,27 @@ class UnitsActivity : AppCompatActivity() { } private fun setupEvents() { - binding.profileButton.setOnClickListener { - Log.d("UnitsActivity", "Profile tapped") + binding.drawerButton.setOnClickListener { + binding.drawerLayout.openDrawer(Gravity.LEFT) + } + binding.navigationView.setNavigationItemSelectedListener { + when (it.itemId) { + R.id.nav_account -> { + Toast.makeText(this, "Account button tapped!", Toast.LENGTH_SHORT).show() + true + } + R.id.nav_about -> { + Toast.makeText(this, "About button tapped!", Toast.LENGTH_SHORT).show() + true + } + R.id.nav_logout -> { + Toast.makeText(this, "Logout button tapped!", Toast.LENGTH_SHORT).show() + true + } + else -> false + } } binding.displayModeToggle.setOnClickListener { - Log.d("UnitsActivity", "Units display toggle tapped") unitsViewModel.toggleDisplayMode() } binding.searchInput.doAfterTextChanged { -- cgit v1.2.3