mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-15 18:59:12 +03:00
Respect spaces back navigation preference in new app layout
Change-Id: I1c11b0621160317c868de125a9ffe9ef4e303c28
This commit is contained in:
parent
401a7f5f7d
commit
3c8eb0e0e5
2 changed files with 5 additions and 1 deletions
|
@ -391,7 +391,7 @@ class NewHomeDetailFragment :
|
|||
}
|
||||
}
|
||||
|
||||
override fun onBackPressed(toolbarButton: Boolean) = if (spaceStateHandler.isRoot()) {
|
||||
override fun onBackPressed(toolbarButton: Boolean) = if (spaceStateHandler.isRoot() || !vectorPreferences.spaceBackNavigation()) {
|
||||
false
|
||||
} else {
|
||||
val lastSpace = spaceStateHandler.popSpaceBackstack()
|
||||
|
|
|
@ -1400,6 +1400,10 @@ class VectorPreferences @Inject constructor(
|
|||
* Only the IDs of the spaces are stored.
|
||||
*/
|
||||
fun setSpaceBackstack(spaceBackstack: List<String?>) {
|
||||
if (!spaceBackNavigation()) {
|
||||
// Don't build a huge stack that'll never get cleared
|
||||
return
|
||||
}
|
||||
val spaceIdsJoined = spaceBackstack.takeIf { it.isNotEmpty() }?.joinToString(",")
|
||||
defaultPrefs.edit().putString(SETTINGS_PERSISTED_SPACE_BACKSTACK, spaceIdsJoined).apply()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue