Skip to content

Instantly share code, notes, and snippets.

@tokgozmusa
Last active February 19, 2021 09:44
Show Gist options
  • Save tokgozmusa/f76fa04a4f25fb5f1c02952ac9d5f749 to your computer and use it in GitHub Desktop.
Save tokgozmusa/f76fa04a4f25fb5f1c02952ac9d5f749 to your computer and use it in GitHub Desktop.
Android Layout Change Animation

In CardView XML: android:animateLayoutChanges="true"

and also the following in the code:

((androidx.cardview.widget.CardView) findViewById(R.id.view)).getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);


Check FastOutSlowInInterpolator

val timeInterpolator = FastOutLinearInInterpolator()
view.animate().translationY(SOME_VALUE).setDuration(200L).setInterpolator(timeInterpolator).start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment