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 | 7734d6f38ec5835960493e8fc97edfe89f724105 (patch) | |
tree | 914c630234277a2679a8ec306cd69675078da060 /androidApp/src/main/java/mx | |
parent | 5dd2bf01865705f5ee74374472895ffed30f2b26 (diff) | |
download | etbsa-trackermap-mobile-7734d6f38ec5835960493e8fc97edfe89f724105.tar.gz etbsa-trackermap-mobile-7734d6f38ec5835960493e8fc97edfe89f724105.tar.bz2 etbsa-trackermap-mobile-7734d6f38ec5835960493e8fc97edfe89f724105.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 { |