19
I need to change the width of a RelativeLayout from 0 to 600px programmatically, in an animated way. I'm using the following code:
Animation a = new Animation() {
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
RelativeLayout.LayoutParams drawerParams = (LayoutParams) drawer.getLayoutParams();
drawerParams.width = 600;
drawer.setLayoutParams(drawerParams);
}
};
a.setDuration(1000); //Animate for 1s
layout.startAnimation(a);
However, for some reason this isn't working. Can anyone point me in the right direction?