Skip to content

Exit selection mode when back button is pressed on Library tabs - #225

Closed
rivaldi8 wants to merge 3 commits into
timusus:mainfrom
rivaldi8:fix/alexm-exit-selection-mode-on-back-pressed
Closed

rivaldi8 wants to merge 3 commits into
timusus:mainfrom
rivaldi8:fix/alexm-exit-selection-mode-on-back-pressed

Conversation

@rivaldi8

@rivaldi8 rivaldi8 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Implements it for Artists, Albums and Songs tabs. Genres and Playlists don't support selecting items. Previously, this would close the application.

Ideally, we should also have a back button (<-) in the selection toolbar doing the same, but I think it's better left until this part is migrated to Compose.

@rivaldi8
rivaldi8 force-pushed the fix/alexm-exit-selection-mode-on-back-pressed branch from 961a6f3 to 5b817c9 Compare May 6, 2026 17:15
timusus added a commit that referenced this pull request Sep 24, 2026
…ts (#225)

Pressing the system back button while a selection was active exited
the whole Library tab instead of clearing the selection. Add a
per-Fragment OnBackPressedCallback, disabled by default, that clears
selection; enable/disable it alongside the contextual toolbar
show/hide in the uiState collector. Genre and Playlist tabs have no
selection state, so they're unaffected.

Changelog: The back button now exits multi-select mode on the Songs, Albums and Artists tabs instead of leaving the library

Co-authored-by: Àlex Magaz Graça <alexandre.magaz@gmail.com>
@timusus

timusus commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Landed on main as 8228a00, reworked onto current main, with you credited as co-author. Verified by unit tests plus the full emulator suite, which now carries a check for this change. Thanks!

@timusus timusus closed this Sep 24, 2026
@rivaldi8
rivaldi8 deleted the fix/alexm-exit-selection-mode-on-back-pressed branch September 26, 2026 00:49
timusus added a commit that referenced this pull request Sep 26, 2026
Songs/Albums/Artists selection persisted across pager tab switches and
past navigating away from the Library destination, since all six tab
ViewModels share the destination's nav-entry ViewModelStore (#225).
LibrarySelectionCoordinator centralises the clearing rule in one place
instead of duplicating it into each selectable tab's ViewModel.

Closes #456
timusus added a commit that referenced this pull request Sep 26, 2026
…posed

Rotation and pushing a detail pane dispose LibraryDestination while its entry
and ViewModels survive, so clearing on dispose wiped a live selection. Tab
switches still clear it (#225).

Changelog: none
Refs #456
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants