Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Problem when animating width #25

Open
henriquecm opened this issue Jan 6, 2017 · 0 comments
Open

Problem when animating width #25

henriquecm opened this issue Jan 6, 2017 · 0 comments

Comments

@henriquecm
Copy link

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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant