Open drawer when clicking on group avatar

This commit is contained in:
Benoit Marty 2019-06-07 10:47:28 +02:00
parent aec7e72dcf
commit ed18a504e4
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -89,7 +89,7 @@ class HomeDetailFragment : VectorBaseFragment() {
groupToolbarAvatarImageView
)
groupToolbarAvatarImageView.setOnClickListener {
vectorBaseActivity.notImplemented("Group click in toolbar")
(vectorBaseActivity as? HomeActivity)?.openDrawer()
}
}