forked from GitHub-Mirror/riotX-android
Create room screen - Navigate to change protocol
This commit is contained in:
parent
77fc793e89
commit
4f044c0cd6
@ -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()
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user