Skip to content
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

different animation effect Issue on multiple devices #314

Closed
kimyounghoons opened this issue Aug 23, 2023 · 9 comments · Fixed by #319
Closed

different animation effect Issue on multiple devices #314

kimyounghoons opened this issue Aug 23, 2023 · 9 comments · Fixed by #319
Labels

Comments

@kimyounghoons
Copy link

When testing on multiple devices, there is a difference between 120 Frame device and 60 Frame device animation. How should I solve it?

@DanielMartinus
Copy link
Owner

There's probably an issue where the deltatime is not correctly applied to one of parameters. I should dive into this and see what's causing this.

@omargda
Copy link

omargda commented Oct 18, 2023

I also observed differences in animation between a Samsung device and Google Pixel device. Samsung shoots down (as desired), but on a Pixel it shoots to the right

@DanielMartinus
Copy link
Owner

@omargda What configuration did you use? Can you share some more details about this specific case

@kit0kat
Copy link

kit0kat commented Dec 9, 2023

Hi, I'm facing the same issue.

I'm using this configuration:

   val leftParty = Party(
        spread = 45,
        angle = 315,
        position = Position.Relative(0.0, 0.35),
        emitter = Emitter(duration = 3, TimeUnit.SECONDS).perSecond(30)
    )
    val rightParty = Party(
        spread = 45,
        angle = 225,
        position = Position.Relative(1.0, 0.35),
        emitter = Emitter(duration = 3, TimeUnit.SECONDS).perSecond(30)
    )
// ...
KonfettiView(
  modifier = Modifier.fillMaxSize(),
  parties = listOf(leftParty, rightParty),
)

It looks like this:

image

60 Hz is fine but 120 Hz seems broken. It looks like the confetti cannon only has half power at 120 Hz haha.

@DanielMartinus
Copy link
Owner

DanielMartinus commented Dec 10, 2023

Thanks for the example! Right now the refresh rate seems to be locked at 60fps in the code. I'll make the proper adjustments and update the frame rate dynamically.

@DanielMartinus
Copy link
Owner

DanielMartinus commented Dec 10, 2023

Opened a branch with a fix here: #319

@kit0kat @kimyounghoons would you be able to check-out that branch (add-dynamic-framerate) and run the xml or compose example on your device with 120Hz?

@kit0kat
Copy link

kit0kat commented Dec 10, 2023

@DanielMartinus
I checked out your branch and tried both XML and Compose examples.
It now works perfectly at 120 Hz 👍You are amazing.
When will the update be available?

@DanielMartinus
Copy link
Owner

@kit0kat I've just released 2.0.4 that includes the fix

@kit0kat
Copy link

kit0kat commented Dec 11, 2023

Confirmed, fixed in production.
Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants