Animation takes a long time to "show"
See original GitHub issueI’m trying to show a dialog with an animation while the user waits for the AsyncTask to finish.
To achieve this, I used the following code (inside AsyncTask)?
protected void onPreExecute() {
super.onPreExecute();
//Custom Dialog
customDialog = new Dialog(mContext);
customDialog.setContentView(R.layout.dialog_custom);
customDialog.setTitle("Looking for address");
//Custom Dialog Animation
LottieAnimationView animationView = (LottieAnimationView) customDialog.findViewById(R.id.animation_view);
animationView.setAnimation("PinJump.json"); //Lottie's premade animation
animationView.loop(true);
animationView.playAnimation();
//Custom Dialog Text
TextView text = (TextView) customDialog.findViewById(R.id.textView);
text.setText(R.string.dialog_looking_for_address);
customDialog.show();
}
The code above works wonderfully.
The only problem is that the animation takes about north of 1 second to show up. So I end up seeing the text way before the animation.
Is there anyway to make the animation show up as soon as the dialog is up? I tried casting the json file directly to the XML, but no dice, same thing happened.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11
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 does animation take so long? - Reddit
For some perspective, it can take an hour+ to get a simple ... Animation is a precise, time consuming art that one can...
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 >How Long Does It Take To Produce an Animation?
A simple animated video with superficial details and without animated characters can be completed in around 4 weeks. However, more intensive scenes, with...
Read more >Animation Lead Time - TV Tropes
Good animation takes a long time. Even the simplest animated TV shows can see a production period of a year for a single...
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

@MegBasutkar05 The APIs have moved to
LottieCompositionFactoryLottieComposition.Factory.fromAssetFileName is deprecated now. So is there an alternative way to go about it?