Created
July 3, 2017 10:59
-
-
Save seriabov/3705c1e78f342f47cac8f5e386b42f06 to your computer and use it in GitHub Desktop.
Enable animatelayoutchanges when change not caused by items being added to or removed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enable animatelayoutchanges when change not caused by items being added to or removed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { | |
((ViewGroup) findViewById(R.id.llRoot)).getLayoutTransition() | |
.enableTransitionType(LayoutTransition.CHANGING); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/llRoot" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:animateLayoutChanges="true" | |
android:background="@android:color/holo_blue_bright" | |
android:gravity="center" | |
android:orientation="horizontal" | |
android:padding="10dp"> | |
<ImageView | |
android:layout_width="48dp" | |
android:layout_height="48dp" | |
android:src="@mipmap/ic_launcher"/> | |
<TextView | |
android:id="@+id/tvText" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="some text" | |
android:textAppearance="?android:attr/textAppearanceMedium"/> | |
</LinearLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment