From f79edd64a663f6dd9ae72bc2bcfb5de2f9d46a65 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Wed, 1 Jun 2022 15:36:09 +0200 Subject: [PATCH] Disable space stack for viewpager navigation Change-Id: I7b895cc8cd945f2038bf0be07cdc140496394428 --- vector/src/main/java/im/vector/app/AppStateHandler.kt | 2 +- .../main/java/im/vector/app/features/home/HomeDetailFragment.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/AppStateHandler.kt b/vector/src/main/java/im/vector/app/AppStateHandler.kt index 69d6763c87..b8224f6d2d 100644 --- a/vector/src/main/java/im/vector/app/AppStateHandler.kt +++ b/vector/src/main/java/im/vector/app/AppStateHandler.kt @@ -121,7 +121,7 @@ class AppStateHandler @Inject constructor( Timber.w(Exception("Home pager: setCurrentSpace/SELECT")) } - if (isForwardNavigation) { + if (isForwardNavigation && from in listOf(SelectSpaceFrom.SELECT, SelectSpaceFrom.INIT)) { spaceBackstack.addLast(currentSpace?.roomId) } diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt index 0d0e9cafed..7d6272cf68 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt @@ -828,7 +828,7 @@ class HomeDetailFragment @Inject constructor( return this } - override fun onBackPressed(toolbarButton: Boolean) = if (getCurrentSpace() != null) { + override fun onBackPressed(toolbarButton: Boolean) = if (!pagerPagingEnabled && getCurrentSpace() != null) { navigateBack() true } else {