-
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
Add auto scroll to discover featured carousal #818
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.
Looks good and works well! I have a couple of UI/UX thoughts here, apart from the first one they're somewhat my personal preferences, so I'm sharing them more as food for thought for you and @adamzelinski . They're certainly not blockers.
1. "Flashing" images
When the discover carousel is loaded the first time, the images load as they are swiped into view, which creates a bit of a "flash" that I find jarring. It would be good to preload at least the next image now that we're animating the carousel, so it is already loaded when it comes into view.
flashing_images_trimmed.mp4
2. Animation Speed
The animation from one item to the next feels a bit fast and abrupt and distracting to me. Maybe slowing it down and/or using a different kind of easing would help. This may just be my personal preference though.
3. Auto scroll after manually swiping the list
It felt to me like the animation picked back up a bit too quickly for my taste after I swiped the list. I wonder if it would be better to either give a longer delay after the user manually swipes on the list, or maybe even to turn off the automatic scrolling entirely. 🤔
4. Scrolling back to the first item
Feels like it might be nice if instead of scrolling back through all the items at the end, it instead still animated "forward", with the next item being the first. I found this pretty tricky to get working well on the Plus Upgrade screens I did for onboarding, so although I'm sure you could accomplish this, I suspect it may not be worth the effort.
...tures/discover/src/main/java/au/com/shiftyjelly/pocketcasts/discover/view/DiscoverAdapter.kt
Show resolved
Hide resolved
This is looking really nice thanks @ashiagr and thanks for the great feedback @mchowning |
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.
Hey @mchowning, @adamzelinski 👋
I've tried to address your feedback and left comments mentioning revised prefetch count or durations. Let me know if any of those need to be adjusted.
I'll address scrolling back to the first item animation separately. For now, I've matched it with the iOS app which switches from last to first without any animation.
device-2023-03-08-163930.mp4
...r/src/main/java/au/com/shiftyjelly/pocketcasts/discover/util/ScrollingLinearLayoutManager.kt
Show resolved
Hide resolved
@@ -73,6 +79,7 @@ import au.com.shiftyjelly.pocketcasts.ui.R as UR | |||
private const val MAX_ROWS_SMALL_LIST = 20 | |||
private const val CURRENT_PAGE = "current_page" | |||
private const val TOTAL_PAGES = "total_pages" | |||
private const val INITIAL_PREFETCH_COUNT = 3 |
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.
Increased prefetch count from 1 to 3. It might still not be sufficient on a slower network. Let me know if I should increase it.
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.
The flicker might be less frequenty, but I'm definitely still seeing it. I'm at home on a broadband wifi network, so it doesn't feel like network speed should be the issue. Not sure what's going on here because it feels like increasing the prefetch should have fixed it. 🤔
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 could see the flickering more noticeably on a manual swipe as compared to auto-scroll. On checking LinearLayoutManager
documentation:
By default, {@code LinearLayoutManager} lays out 1 extra page of items while smooth
scrolling, in the direction of the scroll, and no extra space is laid out in all other
situations. You can override this method to implement your own custom pre-cache logic.
protected void calculateExtraLayoutSpace(...)
I've overridden this method in 0fd13a5 and provided an extra page space so that it works for a manual swipe as well. This shouldn't cause too much overhead as an extra page should already have been laid out in case of smooth scrolling. It seems to have improved pre-caching behavior.
Screen.Recording.2023-03-10.at.1.37.33.PM.mov
Feel free to drop any feedback and I'll take it up separately.
...tures/discover/src/main/java/au/com/shiftyjelly/pocketcasts/discover/view/DiscoverAdapter.kt
Show resolved
Hide resolved
Updates look good. I did leave a few UI comments, but nothing I think you need to change unless Adam suggests a change. Great work on this @ashiagr ! |
Description
This adds auto scroll to discover featured carousal
Testing Instructions
No auto scroll on default
Auto Scroll
DISCOVER_FEATURED_AUTO_SCROLL
feature flag inbase.gradle
Auto scroll and manual scroll
Additionally, test that the auto-scroll timer doesn't keep running when the app is backgrounded or moving to another screen.
Screenshots or Screencast
device-2023-03-07-182325.mp4