I have a a layout part of another layout that I make visible as follows:
AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f);
animation.setDuration(4000);
myLayout.setAnimation(animation);
myLayout.setVisibility(View.VISIBLE);
In my example with the animation the linear layout appears (the myLayout
) and the text inside the myLayout
(which has TextViews
) fades in.
Is there a way to make both the myLayout
and the children TextViews
fade in?
Update:
The problem is that when I set the animation on the parent layout, it is the children that appear slowly according to the animation.
So I have:
<LinearLayout
android:id="@+id/parent”
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/someElement”
android:layout_marginTop=“5dp"
android:visibility="gone"
>
<TextView
android:id="@+id/child”
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize=“20sp”
android:textColor="@color/red”
android:gravity="center_vertical"
android:visibility="gone"
/>
</LinearLayout>
and the parent pops down fast and the children text appears slowly.
What I would like is the parent to smoothly pop down and the child to appear also slowly