Open henriquecm opened 7 years ago
When i try to animate width it just go left without change width then only when it finish the animation the view change the width.
ViewAnimator code:
ViewAnimator.animate(cardView) .scale(0,1) .duration(300) .thenAnimate(cardView) .dp().width(36,200) .duration(200) .start();
XML code:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:animateLayoutChanges="true" > <android.support.v7.widget.CardView android:id="@+id/fave_card" android:layout_width="wrap_content" android:layout_height="36dp" android:minWidth="36dp" android:layout_margin="16dp" app:cardBackgroundColor="@color/primary_light" app:cardCornerRadius="18dp"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center" android:layout_gravity="center"> <ImageView android:id="@+id/fave_image" android:layout_width="36dp" android:layout_height="36dp" android:layout_gravity="center_vertical" android:gravity="center_vertical"/> <TextView android:id="@+id/fave_text" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:gravity="center_vertical" tools:text="Placeholder"/> </LinearLayout> </android.support.v7.widget.CardView> </LinearLayout>
When i try to animate width it just go left without change width then only when it finish the animation the view change the width.
ViewAnimator code:
XML code: