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

The animation don't move #946

Open
weiawesome opened this issue Nov 21, 2022 · 10 comments
Open

The animation don't move #946

weiawesome opened this issue Nov 21, 2022 · 10 comments
Labels
needs info stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@weiawesome
Copy link

Description

[Description of the bug]

Steps to Reproduce

In short, I found that I used the app in dark mode it would stop.
(In IOS.)
later I will test Android, thanks.
And if I turn off the dark mode, it will work again(be ok)

Expected behavior: move

Actual behavior: don't move

Versions

"react-native": "0.69.6",
"lottie-react-native": "^5.1.4",

@matinzd
Copy link
Collaborator

matinzd commented Dec 1, 2022

What do you mean? Can you please send us a reproducible code or video for this issue?

@weiawesome
Copy link
Author

No problem!
This an app I made. And develope with expo.
https://github.com/weiawesome/HSR_Booking_App/blob/main/Result_img/problem.mp4

My phone is i13mini. Use expo-go app to preview it.
However, I try the same situation in Android device(Samsung s10+), but it is normal and can work.
And it is normal too in Android exported->aab file(it is normal and can work)

thank you to reply my question!

@matinzd
Copy link
Collaborator

matinzd commented Dec 2, 2022

@weiawesome
Copy link
Author

No!
I use a view to wrap it and let its Zindex be the top.

@stale
Copy link

stale bot commented Feb 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale There has been a lack of activity on this issue and it may be closed soon. label Feb 2, 2023
@matinzd matinzd removed the stale There has been a lack of activity on this issue and it may be closed soon. label Feb 2, 2023
@stale
Copy link

stale bot commented Apr 3, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale There has been a lack of activity on this issue and it may be closed soon. label Apr 3, 2023
@matinzd matinzd removed the stale There has been a lack of activity on this issue and it may be closed soon. label Apr 4, 2023
@syou98
Copy link

syou98 commented Oct 25, 2023

Hey @weiawesome
Did you find a solution ?
I have the same issue ...
Thank you

@weiawesome
Copy link
Author

Hey @weiawesome

Did you find a solution ?

I have the same issue ...

Thank you

I remember don't switch the darkness mode after into the app then the bug will not exist in IOS.

@450Oucema
Copy link

@syou98 @weiawesome
Did you tried to listen to AppState change events ?
I think that when you open the control center, the app states changes and the lottie stops.

you can try something like that:

const ref = useRef<LottieView>(null);

  const resetLottie = useCallback((state: AppStateStatus) => {
    if (state === 'active') {
      ref.current?.reset();
      ref.current?.play();
    }
  }, [ref]);

  useEffect(() => {
    const subscriber = AppState.addEventListener('change', resetLottie);
    return () => {
      subscriber.remove();
    };
  }, []);

  return (
    <LottieView
      ref={ref}
      {...props}
    />
  );

This will reset your lottie animation when you'll get back to the app.

@TheRogue76
Copy link
Collaborator

Is this issue still a problem with the latest version (6.5.1)? I can take a look (Reminder: Expo Go is still using the old 5.1.6 version of Lottie so please don't test this against Expo Go)

@TheRogue76 TheRogue76 added the stale There has been a lack of activity on this issue and it may be closed soon. label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants