mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +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 {
|
sealed class Navigation {
|
||||||
object Back : Navigation()
|
object Back : Navigation()
|
||||||
object CreateRoom : Navigation()
|
object CreateRoom : Navigation()
|
||||||
|
object Close : Navigation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ class RoomDirectoryActivity : VectorBaseActivity() {
|
||||||
when (liveEvent.getContentIfNotHandled() ?: return@Observer) {
|
when (liveEvent.getContentIfNotHandled() ?: return@Observer) {
|
||||||
is Navigation.Back -> onBackPressed()
|
is Navigation.Back -> onBackPressed()
|
||||||
is Navigation.CreateRoom -> gotoCreateRoom()
|
is Navigation.CreateRoom -> gotoCreateRoom()
|
||||||
|
is Navigation.Close -> finish()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,8 +95,12 @@ class CreateRoomFragment : VectorBaseFragment(), CreateRoomController.Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun invalidate() = withState(viewModel) { state ->
|
override fun invalidate() = withState(viewModel) { state ->
|
||||||
if (state.asyncCreateRoomRequest is Success) {
|
val async = state.asyncCreateRoomRequest
|
||||||
vectorBaseActivity.notImplemented("navigate to freshly created room")
|
if (async is Success) {
|
||||||
|
// Navigate to freshly created room
|
||||||
|
navigator.openRoom(async())
|
||||||
|
|
||||||
|
navigationViewModel.goTo(RoomDirectoryActivity.Navigation.Close)
|
||||||
} else {
|
} else {
|
||||||
// Populate list with Epoxy
|
// Populate list with Epoxy
|
||||||
createRoomController.setData(state)
|
createRoomController.setData(state)
|
||||||
|
|
Loading…
Add table
Reference in a new issue