mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Create room screen - Navigate to freshly created room
This commit is contained in:
parent
aa95ce3d02
commit
77fc793e89
2 changed files with 8 additions and 2 deletions
|
@ -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 a new issue