diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-11 17:45:13 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-11 17:45:13 -0600 |
commit | 1c877fcc48fba0afa0362ae7273cf9e0cd03458f (patch) | |
tree | 5f3aaee090d521a792f87348438a52bef0d8963e /androidApp/src/main/java/mx | |
parent | 877d064c1a7cc8dc985750de3fe5cd8d8b935fb1 (diff) | |
download | etbsa-trackermap-mobile-1c877fcc48fba0afa0362ae7273cf9e0cd03458f.tar.gz etbsa-trackermap-mobile-1c877fcc48fba0afa0362ae7273cf9e0cd03458f.tar.bz2 etbsa-trackermap-mobile-1c877fcc48fba0afa0362ae7273cf9e0cd03458f.zip |
Implements base drawer layout menu
Diffstat (limited to 'androidApp/src/main/java/mx')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt | 24 |
1 files changed, 21 insertions, 3 deletions
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 { |