Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Animations and Transitions Animations Basics Introducing ObjectAnimator

Hussein Nasereddine
Hussein Nasereddine
2,231 Points

ObjectAnimator.ofInt() is not making any changes

Hi,

I am using the layout below to make a small test regarding the ObjectAnimator,

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:id="@+id/panel" android:layout_width="match_parent" android:layout_height="300dp" android:background="@android:color/black" android:orientation="vertical" > <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World" android:textColor="@android:color/white" android:textSize="25sp" /> </LinearLayout> </RelativeLayout>

in the main activity i wrote the following,

LinearLayout mPanel;

mPanel = (LinearLayout) findViewById(R.id.panel);

ObjectAnimator.ofInt(mPanel, "bottom", mPanel.getTop(), mPanel.getBottom()).start();

but nothing is showing, and the linearLayout disappeared