Animation takes a long time to appear
See original GitHub issueI’m trying to show the lottie animation on my splash screen. Below is the code for my SplashActivity. I’m adding delay of 2.5 secs to display the splash and firing an intent to MainActivity after this. But still no animations shows up till 2.5 secs. It just shows white screen. I added 5 secs then it shows up. But I don’t want to do like this. I just want to show the animation in 1 sec.
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
LottieAnimationView lottieAnimationView = findViewById(R.id.lottie_animation);
lottieAnimationView.setAnimation("animation.json");
lottieAnimationView.playAnimation();
lottieAnimationView.loop(true);
Handler mHandler = new Handler(Looper.getMainLooper());
mHandler.postDelayed(() -> {
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}, 1500);`
What to do here ?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Why Does Animation Take So Long? | Video Production Bristol
There are a few reasons why animation still takes a long time to create, but we can argue that animation has become faster...
Read more >Why animations take a long time? Is there a way to use ...
Animation is hard, that's why it takes so long. Technology is already making it easier to make high-quality animation in shorter amounts of...
Read more >Why are some animations slow? - web.dev
Animating well is core to a great web experience. This post explains why certain types of animation perform better than others.
Read more >Set the start time and speed of an animation effect
To run your animation effect at a faster or slower pace, change the Duration setting. On the slide, click the text or object...
Read more >animation-delay - CSS: Cascading Style Sheets | MDN
The animation-delay CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@saketkumar For subsequent launches, you warn the cache just by using the
LottieCompositionFactorymethods with a cache key. The next time you call it, it’ll just return the pre-parsed composition.I also ran into the same situation but able to fix it. First make the lottie animation visible to true in the XML file then just your work will be done. PS: don’t include any other code of lottie animation in corresponding Java file. All this will lead to showing animation on the splash screen as soon as it is launched till the activity get changed after delayed amount of time