Colin11
Colin11

Reputation: 141

Translate relative layout and get the changed height in Android Animation

I want to translate the relative layout from bottom up and want to continuously get the changed height of the layout. What's the right way of doing?

Animation animation = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_up);
animation.setDuration(333);
view.startAnimation(animation);

Right now, I am just using the above code but I don't know how to listen to the changed height.

Thanks, Colin

Upvotes: 3

Views: 299

Answers (1)

Victor
Victor

Reputation: 4199

Use this library :AndroidViewAnimations

it has listeners and nice animations, Highly reccommended

Example : Refer

Using android own implemntaion

fadeInAnimation.setAnimationListener(new Animation.AnimationListener() {
    @Override
    public void onAnimationStart(Animation animation) {

    }

    @Override
    public void onAnimationEnd(Animation animation) {

    }

    @Override
    public void onAnimationRepeat(Animation animation) {

    }
});

Upvotes: 1

Related Questions