Add a click action at the top of the drawer to open the general settings

This commit is contained in:
Benoit Marty 2020-10-14 12:21:27 +02:00
parent ea57697215
commit 95df786227

View file

@ -25,6 +25,7 @@ import im.vector.app.core.extensions.replaceChildFragment
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.features.grouplist.GroupListFragment import im.vector.app.features.grouplist.GroupListFragment
import im.vector.app.features.settings.VectorPreferences import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.settings.VectorSettingsActivity
import im.vector.app.features.workers.signout.SignOutUiWorker import im.vector.app.features.workers.signout.SignOutUiWorker
import kotlinx.android.synthetic.main.fragment_home_drawer.* import kotlinx.android.synthetic.main.fragment_home_drawer.*
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
@ -57,6 +58,11 @@ class HomeDrawerFragment @Inject constructor(
homeDrawerUserIdView.text = user.userId homeDrawerUserIdView.text = user.userId
} }
} }
// Profile
homeDrawerHeader.debouncedClicks {
sharedActionViewModel.post(HomeActivitySharedAction.CloseDrawer)
navigator.openSettings(requireActivity(), directAccess = VectorSettingsActivity.EXTRA_DIRECT_ACCESS_GENERAL)
}
// Settings // Settings
homeDrawerHeaderSettingsView.debouncedClicks { homeDrawerHeaderSettingsView.debouncedClicks {
sharedActionViewModel.post(HomeActivitySharedAction.CloseDrawer) sharedActionViewModel.post(HomeActivitySharedAction.CloseDrawer)