I have a home screen on my app and several fragments with different content that I add programmatically at the start of this screen. I'm trying to animate the appearance of each fragment and I want for them to show one after another but can't figure it out, they all appear at the same time.
My best guess was to use different animation files with different startOffset
animation_1.xml
<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale="0.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:duration="500"
android:pivotX = "50%"
android:pivotY = "50%" />
animation_2.xml
<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale="0.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:duration="500"
android:startOffset="500"
android:pivotX = "50%"
android:pivotY = "50%" />
but I'm gonna add like 10 different fragments and I don't think this is the most effective way to do it. ¿Any ideas?