Reputation: 1204
I'm quite new to animation transition. I want to add an animation in the home screen. I don't know which way to go, is Lottie fit for this or official android libraries.
The animation take about 2-3 seconds and should animate every time I go to that specific screen. Please help, some explanations would be great Here's some screenshots:
Upvotes: 0
Views: 98
Reputation: 601
You can use ObjectAnimator
and AnimatorSet
.
Translate that blocks to bottom in order and with some delay.
The code you need is something like that:
ObjectAnimator translateAnimator1 = ObjectAnimator.ofFloat(view1, "translationY", 0, 500).setDuration(2500);
ObjectAnimator translateAnimator2 = ObjectAnimator.ofFloat(view2, "translationY", 0, 500).setDuration(2500);
translateAnimator2.setStartDelay(500);
ObjectAnimator translateAnimator3 = ObjectAnimator.ofFloat(view3, "translationY", 0, 500).setDuration(2500);
translateAnimator3.setStartDelay(1000);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(translateAnimator1).with(translateAnimator2).with(translateAnimator3);
animatorSet.start();
ObjectAnimator
and AnimatorSet
has some extra properties like setRepeatCount
etc. that maybe useful.
Upvotes: 1