-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make MultSelectBookmarksHelper not a singleton #1580
Make MultSelectBookmarksHelper not a singleton #1580
Conversation
84bf9a6
to
9c96ef3
Compare
Looks good overall. I think we need these changes as well:
I tried these updates here. If you find them good, we can merge them here or I can create another PR. |
This will cause back stack issues for bottom sheet dialog fragments with multi select. That means, if a bottom sheet dialog fragment is multi selecting, then on back press, it will just dismiss the dialog rather than closing the multi-select toolbar. This is fixed in the next commit.
3694267
to
11a22f2
Compare
To keep it working correctly, it each view model needs its own instance, and we're exposing that to the view from the view model.
9c96ef3
to
c4a7c3b
Compare
Changes look good to me. Thanks! I've rebased this PR onto the new code for #1579, which now targets
I also went ahead and ran through all the test scenarios again and didn't observe any issues. |
# Conflicts: # CHANGELOG.md # modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/bookmark/BookmarksContainerFragment.kt # modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/episode/EpisodeContainerFragment.kt
Description
This is a follow-up to #1579. That PR made the
MultiSelectEpisodesHelper
a singleton, and this PR makes the other multi-select helper (MultiSelectBookmarksHelper
) a singleton.We can't just make the
MultiSelectBookmarksHelper
a singleton without any other changes like we could with theMultiSelectEpisodeHelper
because we need to make sure that thePlayerContainerFragment
, theBookmarksFragment
it contains, and theBookmarksViewModel
for those views are all using the sameMultiSelectBookmarksHelper
. The most straightforward way to accomplish this seemed to be to just expose the helper from the view model. I'm definitely open to other ideas for how to handle this though.This builds on #1579 , and together they fix #98
Testing Instructions
1. Watch for ANR regressions
I think it's unlikely that this change would cause any ANR issues, but given that we had some ANR issues the last time we made significant changes to multiselect, please keep an eye out for any unexpected slowness as you test this change
2. Mult-Select Improvement
I tested this by turning on multiselect in the first screen, navigating to the second screen, and verifying that the second screen was not put into a multiselect state. When running through these tests, make sure you clear multiselect state from the relevant screens before testing (speaking from experience, it's easy to forget to do that and then to think a subsequent test is failing when it really isn't).
Let me know if there are any other test scenarios we should be covering here.
2.1. For each test:
2.2. With changes in #1579, but without changes from this PR
2.3. Expected results With changes from this PR
Checklist
./gradlew spotlessApply
to automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xml