-
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
End of Year: Fix pause and vm issues #581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the pause behavior when you hold now. It feels really naturally. I also noticed that it pauses when you scroll as well, which I also like.
1. Flinging scroll cycles the story
If you scroll slowly, the story doesn't change, but if you do a quick fling to scroll, then the story changes. This is only likely to come up with large font/display settings where scrolling is more necessary, but it did throw me because I initially didn't realize my fling is what was triggering the story to change and it seemed like the stories were just rotating faster, so I could imagine this might confuse a user.
Since this does not really come up on normal display sizes,imo this probably isn't the highest priority issue to address.
fling.mp4
2. Story continuing to play during share
If I did the tap-share-then-tap-the-story-really-fast move, then the Story would not stop playing like it normally does when I tap Share. The video below shows this issue.
3. Pause stopping working
I had a few times where the pause behavior stopped working. The only way I was able to recreate this consistently was with the tap-share-then-tap-the-story-really-fast move. I did cause the issue without tapping the share button, but I wasn't able to find any other way to consistently recreate it.
share-pause.mp4
Flow is not required as on login, when account is syncing, downloadListeningHistory(...) syncs podcasts and episodes before stories are displayed.
Also convert stories from state flow to a list as results from db are not flow based.
For 1. tried to improve the behavior in 53a18b5 but it's just a workaround. It is tricky to detect tap/ long press/ fling / scroll, I'll need more time to figure it out. For 2 & 3, I converted db functions to suspend from flow as now the sync listening history endpoint downloads podcasts and episodes on login before we show stories. This fixes stories state changes when episode 's Can you give it another try? I think we're very close to fixing it.🤞 |
I'm still able to recreate all 3 issues. FWIW, 2 & 3 feel like edge cases to me if the only way we can reproduce them is with the tap-share-and-then-quickly-tap-the-story action. I still haven't found another way to recreate it although I'm sure I caused it without sharing before (I only saw the issue with sharing this time, but I'm not sure if that's because it's better or because I just didn't do whatever is causing it).
Yeah, it does seems like it would be really hard to handle all those actions well. |
Going ahead and approving in case you'd like to merge this and try to do some improvements in separate PRs. |
Quite a few PRs are dependent on it, so I'll merge it and come up with a fix if I can reproduce the scenario. |
Description
This PR attempts to fix following two issues
Pause behavior: #567 (review)
For this, I added an
AwaitPointerEventScope
extension inspired from this post. - 68e8851StoriesViewModel
Scope: #570 (comment)Due to viewmodels not being scoped to a composable, I changed the way the dialog is shown. - 9c140aa
Testing Instructions
Test.1 Pause behavior
END_OF_YEAR_ENABLED
feature flag totrue
in base.gradleTest.2 Store reset on share
Checklist
modules/services/localization/src/main/res/values/strings.xml
I have tested any UI changes...