I have a LinearLayout for which I am using android:animateLayoutChanges="true" in the parent LinearLayout . When the user presses the toggle button, LinearLayout "collapses" (I set the view visibility as LinearLayout.GONE programmatically, and when I click on it again, it expands by setting the visibility to LinearLayout.VISIBLE .
Animation of its folding and expansion works correctly.
However, all elements under the resettable / expandable LinearLayout anchored to the vertex until the convolution animation is complete. Elements that are snapped back are NOT inside the parent whose animateLayoutChanges set to true , and I donβt think I can put it inside it.
Here is my layout hierarchy (I didn't mention attributes to keep it short):
<LinearLayout> <LinearLayout> <RelativeLayout> </RelativeLayout> <LinearLayout> </LinearLayout> </LinearLayout> </LinearLayout>
All this layout is inserted programmatically into another LinearLayout (see below):
<LinearLayout android:id="@+id/form_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <Button /> </LinearLayout>
I understand that the problem will be solved if I add a Button that binds to a LinearLayout that has animateLayoutChanges as true. However, this is not an option for several reasons.
So is there any other job?
android android-layout xml android-animation
ujvl
source share