Closed teaualune closed 1 year ago
@teaualune First, very sorry for late response. and thank you for your contribution. If you don't mind, could you rebase this?
@kyo504 I've rebased the PR and rewrites the example to HomeScreen
, please tell me if there's anything that need to be adjusted, thanks!
Since I'm facing the same problem described in #1 and not finding an existing solution, I propose this PR to implement the feature. I called it "consecutive" but the term can be changed according to reviewer's suggestion.
This PR includes the consecutive feature as well as several minor fixes:
UIManager.measure
The "consecutive" mode is only valid under
loop = true
condition, and it tweaks the animation loop into the following sequence:0
to position =-marqueeTextWidth.current
, so marquee text will be moved completely outside of the containercontainerWidth.current
(namelyresetToValue
) via a 0-duration timing animation. This moves marquee text to the right side of container, preparing to show againcontainerWidth.current
to position =-marqueeTextWidth.current
The complex duration calculations at line 167 and 172 are aimed to maintain same velocity between consecutive mode and the existing behavior.
Here is a sample video demonstrating both existing behavior and consecutive mode: https://imgur.com/a/54D46o2