mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Create room screen - Navigate to freshly created room
This commit is contained in:
parent
aa95ce3d02
commit
77fc793e89
@ -33,6 +33,7 @@ class RoomDirectoryActivity : VectorBaseActivity() {
|
||||
sealed class Navigation {
|
||||
object Back : Navigation()
|
||||
object CreateRoom : Navigation()
|
||||
object Close : Navigation()
|
||||
}
|
||||
|
||||
|
||||
@ -49,6 +50,7 @@ class RoomDirectoryActivity : VectorBaseActivity() {
|
||||
when (liveEvent.getContentIfNotHandled() ?: return@Observer) {
|
||||
is Navigation.Back -> onBackPressed()
|
||||
is Navigation.CreateRoom -> gotoCreateRoom()
|
||||
is Navigation.Close -> finish()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -95,8 +95,12 @@ class CreateRoomFragment : VectorBaseFragment(), CreateRoomController.Listener {
|
||||
}
|
||||
|
||||
override fun invalidate() = withState(viewModel) { state ->
|
||||
if (state.asyncCreateRoomRequest is Success) {
|
||||
vectorBaseActivity.notImplemented("navigate to freshly created room")
|
||||
val async = state.asyncCreateRoomRequest
|
||||
if (async is Success) {
|
||||
// Navigate to freshly created room
|
||||
navigator.openRoom(async())
|
||||
|
||||
navigationViewModel.goTo(RoomDirectoryActivity.Navigation.Close)
|
||||
} else {
|
||||
// Populate list with Epoxy
|
||||
createRoomController.setData(state)
|
||||
|
Loading…
Reference in New Issue
Block a user