Search in sources :

Example 51 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project android-adDialog by yipianfengye.

the class MetaballView method startAnimation.

private void startAnimation() {
    wa = new MoveAnimation();
    wa.setDuration(2500);
    wa.setInterpolator(new AccelerateDecelerateInterpolator());
    wa.setRepeatCount(Animation.INFINITE);
    wa.setRepeatMode(Animation.REVERSE);
    startAnimation(wa);
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator)

Example 52 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project DiscreteScrollView by yarolegovich.

the class ForecastView method setForecast.

public void setForecast(Forecast forecast) {
    Weather weather = forecast.getWeather();
    currentGradient = weatherToGradient(weather);
    if (getWidth() != 0 && getHeight() != 0) {
        initGradient();
    }
    weatherDescription.setText(weather.getDisplayName());
    weatherTemperature.setText(forecast.getTemperature());
    Glide.with(getContext()).load(weatherToIcon(weather)).into(weatherImage);
    invalidate();
    weatherImage.animate().scaleX(1f).scaleY(1f).setInterpolator(new AccelerateDecelerateInterpolator()).setDuration(300).start();
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator)

Example 53 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project easy by MehdiBenmesa.

the class SplashActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_svg);
    final PathView pathView = (PathView) findViewById(R.id.pathView);
    final PathView pathView2 = (PathView) findViewById(R.id.pathView2);
    pathView.getPathAnimator().delay(1000).duration(3500).listenerStart(new PathView.AnimatorBuilder.ListenerStart() {

        @Override
        public void onAnimationStart() {
        }
    }).listenerEnd(new PathView.AnimatorBuilder.ListenerEnd() {

        @Override
        public void onAnimationEnd() {
            Intent i = new Intent(SplashActivity.this, StartActivity.class);
            startActivity(i);
            finish();
        }
    }).interpolator(new AccelerateDecelerateInterpolator()).start();
    pathView.useNaturalColors();
    pathView.setFillAfter(true);
    pathView2.getPathAnimator().delay(1000).duration(2500).listenerStart(new PathView.AnimatorBuilder.ListenerStart() {

        @Override
        public void onAnimationStart() {
        }
    }).listenerEnd(new PathView.AnimatorBuilder.ListenerEnd() {

        @Override
        public void onAnimationEnd() {
        }
    }).interpolator(new AccelerateDecelerateInterpolator()).start();
    pathView2.useNaturalColors();
    pathView2.setFillAfter(true);
}
Also used : PathView(com.eftimoff.androipathview.PathView) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) Intent(android.content.Intent)

Example 54 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project easy by MehdiBenmesa.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_svg);
    final PathView pathView = (PathView) findViewById(R.id.pathView);
    final PathView pathView2 = (PathView) findViewById(R.id.pathView2);
    pathView.getPathAnimator().delay(1000).duration(3500).listenerStart(new PathView.AnimatorBuilder.ListenerStart() {

        @Override
        public void onAnimationStart() {
        }
    }).listenerEnd(new PathView.AnimatorBuilder.ListenerEnd() {

        @Override
        public void onAnimationEnd() {
            Intent i = new Intent(MainActivity.this, StartActivity.class);
            startActivity(i);
            finish();
        }
    }).interpolator(new AccelerateDecelerateInterpolator()).start();
    pathView.useNaturalColors();
    pathView.setFillAfter(true);
    pathView2.getPathAnimator().delay(1000).duration(2500).listenerStart(new PathView.AnimatorBuilder.ListenerStart() {

        @Override
        public void onAnimationStart() {
        }
    }).listenerEnd(new PathView.AnimatorBuilder.ListenerEnd() {

        @Override
        public void onAnimationEnd() {
        }
    }).interpolator(new AccelerateDecelerateInterpolator()).start();
    pathView2.useNaturalColors();
    pathView2.setFillAfter(true);
}
Also used : PathView(com.eftimoff.androipathview.PathView) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) Intent(android.content.Intent) StartActivity(dz.easy.androidclient.Activities.StartActivity)

Example 55 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PagerBottomTabStrip by tyzlmjj.

the class MaterialItemLayout method initialize.

/**
     * 初始化方法
     *
     * @param items 按钮集合
     * @param mode  {@link MaterialMode}
     */
public void initialize(List<MaterialItemView> items, int mode) {
    mItems = items;
    //判断是否需要切换背景
    if ((mode & MaterialMode.CHANGE_BACKGROUND_COLOR) > 0) {
        //初始化一些成员变量
        mChangeBackgroundMode = true;
        mOvals = new ArrayList<>();
        mColors = new ArrayList<>();
        mInterpolator = new AccelerateDecelerateInterpolator();
        mTempRectF = new RectF();
        mPaint = new Paint();
        //获取各项的选中颜色,并替换成白色
        for (MaterialItemView v : mItems) {
            mColors.add(v.getCheckedColor());
            v.setCheckedColor(Color.WHITE);
        }
        //设置默认的背景
        setBackgroundColor(mColors.get(DEFAULT_SELECTED));
    } else {
        //设置按钮点击效果
        for (MaterialItemView v : mItems) {
            v.setBackgroundResource(R.drawable.material_item_background);
        }
    }
    //判断是否隐藏文字
    if ((mode & MaterialMode.HIDE_TEXT) > 0) {
        mShiftingMode = true;
        for (MaterialItemView v : mItems) {
            v.setShiftingMode(true);
        }
    }
    //添加按钮到布局,并注册点击事件
    int n = mItems.size();
    for (int i = 0; i < n; i++) {
        MaterialItemView v = mItems.get(i);
        v.setChecked(false);
        this.addView(v);
        final int finali = i;
        v.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                setSelect(finali, mLastUpX, mLastUpY);
            }
        });
    }
    //默认选中第一项
    mSelected = DEFAULT_SELECTED;
    mItems.get(DEFAULT_SELECTED).setChecked(true);
}
Also used : RectF(android.graphics.RectF) MaterialItemView(me.majiajie.pagerbottomtabstrip.item.MaterialItemView) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) Paint(android.graphics.Paint) MaterialItemView(me.majiajie.pagerbottomtabstrip.item.MaterialItemView) View(android.view.View) Paint(android.graphics.Paint)

Aggregations

AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)165 ValueAnimator (android.animation.ValueAnimator)38 ObjectAnimator (android.animation.ObjectAnimator)31 Animator (android.animation.Animator)30 View (android.view.View)30 AnimatorSet (android.animation.AnimatorSet)22 Animation (android.view.animation.Animation)19 Handler (android.os.Handler)15 NonNull (android.support.annotation.NonNull)12 TranslateAnimation (android.view.animation.TranslateAnimation)12 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)11 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)10 AlphaAnimation (android.view.animation.AlphaAnimation)10 ImageView (android.widget.ImageView)10 TextView (android.widget.TextView)10 Paint (android.graphics.Paint)9 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)9 LinearInterpolator (android.view.animation.LinearInterpolator)9 ScaleAnimation (android.view.animation.ScaleAnimation)9 PropertyValuesHolder (android.animation.PropertyValuesHolder)8