Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Top most LinearLayout-->
- <LinearLayout>
- <!-- LinearLayout containing android:animateLayoutChanges="true"-->
- <LinearLayout>
- <!-- RelativeLayout containing button to toggle LinearLayout visibility below-->
- <RelativeLayout>
- </RelativeLayout>
- <!-- LinearLayout that has its visibility toggled -->
- <LinearLayout>
- </LinearLayout>
- </LinearLayout>
- </LinearLayout>
- <LinearLayout
- android:id="@+id/form_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
- <!-- This is where the previous XML layout containing the toggle-able LinearLayout
- is inserted programmatically. -->
- <!-- This button snaps back up to the top before the animation is complete. -->
- <Button />
- </LinearLayout>
- myButton.animate().translationY(floatYposition).setDuration(300); //300 milliseconds
- <LinearLayout android:id="@+id/transitions_container">
- <!--add your widgets here-->
- </LinearLayout>
- final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
- button.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- TransitionManager.beginDelayedTransition(transitionsContainer);
- // do your staff with changing children of transitionsContainer
- }
- });
Add Comment
Please, Sign In to add comment