From 538e6e453f07217445231f3be6971255d4b0441c Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Thu, 14 Apr 2022 13:22:54 +0200 Subject: [PATCH 1/5] Changes destination after joining space from hamburger invite --- .../src/main/java/im/vector/app/features/home/HomeActivity.kt | 2 +- .../java/im/vector/app/features/navigation/DefaultNavigator.kt | 3 +++ .../main/java/im/vector/app/features/navigation/Navigator.kt | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index 9d3f022e53..529d42e7cc 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -580,7 +580,7 @@ class HomeActivity : } override fun spaceInviteBottomSheetOnAccept(spaceId: String) { - navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.None) + navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.OpenRoomList) } override fun spaceInviteBottomSheetOnDecline(spaceId: String) { diff --git a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt index 8ff70c2954..d6fc7ca2fa 100644 --- a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt @@ -176,6 +176,9 @@ class DefaultNavigator @Inject constructor( Navigator.PostSwitchSpaceAction.OpenAddExistingRooms -> { startActivity(context, SpaceManageActivity.newIntent(context, spaceId, ManageType.AddRooms), false) } + Navigator.PostSwitchSpaceAction.OpenRoomList -> { + startActivity(context, SpaceExploreActivity.newIntent(context, spaceId), false) + } is Navigator.PostSwitchSpaceAction.OpenDefaultRoom -> { val args = TimelineArgs( postSwitchSpaceAction.roomId, diff --git a/vector/src/main/java/im/vector/app/features/navigation/Navigator.kt b/vector/src/main/java/im/vector/app/features/navigation/Navigator.kt index 85826fad5b..310105bd95 100644 --- a/vector/src/main/java/im/vector/app/features/navigation/Navigator.kt +++ b/vector/src/main/java/im/vector/app/features/navigation/Navigator.kt @@ -54,8 +54,9 @@ interface Navigator { sealed class PostSwitchSpaceAction { object None : PostSwitchSpaceAction() - data class OpenDefaultRoom(val roomId: String, val showShareSheet: Boolean) : PostSwitchSpaceAction() object OpenAddExistingRooms : PostSwitchSpaceAction() + object OpenRoomList : PostSwitchSpaceAction() + data class OpenDefaultRoom(val roomId: String, val showShareSheet: Boolean) : PostSwitchSpaceAction() } fun switchToSpace(context: Context, spaceId: String, postSwitchSpaceAction: PostSwitchSpaceAction) From 84960a77a502fe7f96e84bfc114a2a1e7e603eab Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Thu, 14 Apr 2022 15:06:50 +0200 Subject: [PATCH 2/5] Changes notification join space destination to explore rooms --- .../src/main/java/im/vector/app/features/home/HomeActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index 529d42e7cc..7a8dcf2634 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -613,6 +613,6 @@ class HomeActivity : } override fun mxToBottomSheetSwitchToSpace(spaceId: String) { - navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.None) + navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.OpenRoomList) } } From 5b8909b5d23064528337a8b58cbaa010a93714f4 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Thu, 14 Apr 2022 15:37:06 +0200 Subject: [PATCH 3/5] Adds changelog file --- changelog.d/5766.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5766.bugfix diff --git a/changelog.d/5766.bugfix b/changelog.d/5766.bugfix new file mode 100644 index 0000000000..d3290decab --- /dev/null +++ b/changelog.d/5766.bugfix @@ -0,0 +1 @@ +Changes destination after joining a space to Explore Space Rooms screen From 431651ba2f0749e6e81300bff32785e019a713ac Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Thu, 14 Apr 2022 16:39:55 +0200 Subject: [PATCH 4/5] Adds named parameters to OpenRoomList startActivity --- .../im/vector/app/features/navigation/DefaultNavigator.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt index d6fc7ca2fa..6ff11cb430 100644 --- a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt @@ -177,7 +177,11 @@ class DefaultNavigator @Inject constructor( startActivity(context, SpaceManageActivity.newIntent(context, spaceId, ManageType.AddRooms), false) } Navigator.PostSwitchSpaceAction.OpenRoomList -> { - startActivity(context, SpaceExploreActivity.newIntent(context, spaceId), false) + startActivity( + context = context, + intent = SpaceExploreActivity.newIntent(context, spaceId), + buildTask = false + ) } is Navigator.PostSwitchSpaceAction.OpenDefaultRoom -> { val args = TimelineArgs( From 8b893c41067d1fbd2c1389f028847412553ab249 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Thu, 14 Apr 2022 16:49:32 +0200 Subject: [PATCH 5/5] Collapses some named arguments on OpenRoomList startActivity --- .../im/vector/app/features/navigation/DefaultNavigator.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt index 6ff11cb430..6122cf1eee 100644 --- a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt @@ -177,11 +177,7 @@ class DefaultNavigator @Inject constructor( startActivity(context, SpaceManageActivity.newIntent(context, spaceId, ManageType.AddRooms), false) } Navigator.PostSwitchSpaceAction.OpenRoomList -> { - startActivity( - context = context, - intent = SpaceExploreActivity.newIntent(context, spaceId), - buildTask = false - ) + startActivity(context, SpaceExploreActivity.newIntent(context, spaceId), buildTask = false) } is Navigator.PostSwitchSpaceAction.OpenDefaultRoom -> { val args = TimelineArgs(