From ed18a504e40c017054829496340aa1e15f5b660e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 7 Jun 2019 10:47:28 +0200 Subject: [PATCH] Open drawer when clicking on group avatar --- .../im/vector/riotredesign/features/home/HomeActivity.kt | 9 +++++---- .../riotredesign/features/home/HomeDetailFragment.kt | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotredesign/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/riotredesign/features/home/HomeActivity.kt index 538666e5..9ec42de8 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/home/HomeActivity.kt @@ -113,10 +113,6 @@ class HomeActivity : VectorBaseActivity(), ToolbarConfigurable { override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { - android.R.id.home -> { - drawerLayout.openDrawer(GravityCompat.START) - return true - } R.id.sliding_menu_sign_out -> { SignOutUiWorker(this).perform(Matrix.getInstance().currentSession!!) return true @@ -126,6 +122,11 @@ class HomeActivity : VectorBaseActivity(), ToolbarConfigurable { return true } + // Called by HomeDetailFragment + fun openDrawer() { + drawerLayout.openDrawer(GravityCompat.START) + } + override fun onBackPressed() { if (drawerLayout.isDrawerOpen(GravityCompat.START)) { drawerLayout.closeDrawer(GravityCompat.START) diff --git a/vector/src/main/java/im/vector/riotredesign/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/riotredesign/features/home/HomeDetailFragment.kt index ef6543b1..25c38c23 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/home/HomeDetailFragment.kt @@ -89,7 +89,7 @@ class HomeDetailFragment : VectorBaseFragment() { groupToolbarAvatarImageView ) groupToolbarAvatarImageView.setOnClickListener { - vectorBaseActivity.notImplemented("Group click in toolbar") + (vectorBaseActivity as? HomeActivity)?.openDrawer() } }