start Scale With Bubble - Android Animation

Android examples for Animation:Scale Animation

Description

start Scale With Bubble

Demo Code


//package com.java2s;

import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;

import android.view.View;
import android.view.animation.BounceInterpolator;

public class Main {
    public static void startScaleWithBubble(View bubbleView,
            boolean isActive) {
        float coefficient = isActive ? 0.0f : 1.0f;
        bubbleView.setPivotY(bubbleView.getHeight());
        ObjectAnimator scale = ObjectAnimator.ofPropertyValuesHolder(
                bubbleView,/*from w  w w. jav a  2s .co m*/
                PropertyValuesHolder.ofFloat("scaleX", coefficient),
                PropertyValuesHolder.ofFloat("scaleY", coefficient));
        scale.setDuration(bubbleView.getResources().getInteger(
                android.R.integer.config_longAnimTime));
        scale.setInterpolator(new BounceInterpolator());
        scale.start();
    }
}

Related Tutorials