Create room screen - Navigate to change protocol

This commit is contained in:
Benoit Marty 2019-06-10 08:27:27 +02:00
parent 77fc793e89
commit 4f044c0cd6
2 changed files with 7 additions and 7 deletions

View File

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

View File

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


@ -49,7 +51,8 @@ class RoomDirectoryActivity : VectorBaseActivity() {
navigationViewModel.navigateTo.observe(this, Observer { liveEvent ->
when (liveEvent.getContentIfNotHandled() ?: return@Observer) {
is Navigation.Back -> onBackPressed()
is Navigation.CreateRoom -> gotoCreateRoom()
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)
}
}