mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Create room screen - Navigate to change protocol
This commit is contained in:
parent
77fc793e89
commit
4f044c0cd6
2 changed files with 7 additions and 7 deletions
|
@ -91,7 +91,7 @@ class PublicRoomsFragment : VectorBaseFragment(), PublicRoomsController.Callback
|
|||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
return when (item.itemId) {
|
||||
R.id.menu_room_directory_change_protocol -> {
|
||||
vectorBaseActivity.addFragmentToBackstack(RoomDirectoryPickerFragment(), R.id.simpleFragmentContainer)
|
||||
navigationViewModel.goTo(RoomDirectoryActivity.Navigation.ChangeProtocol)
|
||||
true
|
||||
}
|
||||
else ->
|
||||
|
|
|
@ -24,6 +24,7 @@ import im.vector.riotredesign.core.extensions.addFragment
|
|||
import im.vector.riotredesign.core.extensions.addFragmentToBackstack
|
||||
import im.vector.riotredesign.core.platform.VectorBaseActivity
|
||||
import im.vector.riotredesign.features.roomdirectory.createroom.CreateRoomFragment
|
||||
import im.vector.riotredesign.features.roomdirectory.picker.RoomDirectoryPickerFragment
|
||||
import org.koin.android.scope.ext.android.bindScope
|
||||
import org.koin.android.scope.ext.android.getOrCreateScope
|
||||
|
||||
|
@ -34,6 +35,7 @@ class RoomDirectoryActivity : VectorBaseActivity() {
|
|||
object Back : Navigation()
|
||||
object CreateRoom : Navigation()
|
||||
object Close : Navigation()
|
||||
object ChangeProtocol : Navigation()
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,9 +50,10 @@ class RoomDirectoryActivity : VectorBaseActivity() {
|
|||
|
||||
navigationViewModel.navigateTo.observe(this, Observer { liveEvent ->
|
||||
when (liveEvent.getContentIfNotHandled() ?: return@Observer) {
|
||||
is Navigation.Back -> onBackPressed()
|
||||
is Navigation.CreateRoom -> gotoCreateRoom()
|
||||
is Navigation.Close -> finish()
|
||||
is Navigation.Back -> onBackPressed()
|
||||
is Navigation.CreateRoom -> addFragmentToBackstack(CreateRoomFragment(), R.id.simpleFragmentContainer)
|
||||
is Navigation.ChangeProtocol -> addFragmentToBackstack(RoomDirectoryPickerFragment(), R.id.simpleFragmentContainer)
|
||||
is Navigation.Close -> finish()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -61,7 +64,4 @@ class RoomDirectoryActivity : VectorBaseActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun gotoCreateRoom() {
|
||||
addFragmentToBackstack(CreateRoomFragment(), R.id.simpleFragmentContainer)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue