当前位置: 首页>>代码示例>>Java>>正文


Java ObjectAnimator.setEvaluator方法代码示例

本文整理汇总了Java中android.animation.ObjectAnimator.setEvaluator方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectAnimator.setEvaluator方法的具体用法?Java ObjectAnimator.setEvaluator怎么用?Java ObjectAnimator.setEvaluator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.animation.ObjectAnimator的用法示例。


在下文中一共展示了ObjectAnimator.setEvaluator方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sunsetAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void sunsetAnimator() {
    float sunYStart = mSunView.getTop();
    float sunYEnd = mSkyView.getHeight();

    ObjectAnimator heightAnimator = ObjectAnimator.ofFloat(mSunView, "y", sunYStart, sunYEnd)
            .setDuration(3000);

    ObjectAnimator sunsetSkyAnimator = ObjectAnimator.ofInt(mSkyView, "backgroundColor",
            mBlueSkyColor, mSunsetSkyColor)
            .setDuration(3000);
    ObjectAnimator nightSkyAnimator = ObjectAnimator.ofInt(mSkyView, "backgroundColor",
            mSunsetSkyColor, mNightSkyColor)
            .setDuration(1500);

    heightAnimator.setInterpolator(new AccelerateInterpolator());
    sunsetSkyAnimator.setEvaluator(new ArgbEvaluator());
    nightSkyAnimator.setEvaluator(new ArgbEvaluator());

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(heightAnimator).with(sunsetSkyAnimator).before(nightSkyAnimator);
    animatorSet.start();
}
 
开发者ID:ivicel,项目名称:Android-Programming-BigNerd,代码行数:23,代码来源:SunsetFragment.java

示例2: sunriseAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void sunriseAnimator() {
    float sunriseYStart = mSkyView.getHeight();
    float sunriseYEnd = mSunView.getTop();
    
    ObjectAnimator heightAnimator = ObjectAnimator.ofFloat(mSunView, "y",
            sunriseYStart, sunriseYEnd)
            .setDuration(3000);
    ObjectAnimator sunriseSkyAnimator = ObjectAnimator.ofInt(mSkyView, "backgroundColor",
            mSunsetSkyColor, mBlueSkyColor)
            .setDuration(3000);
    ObjectAnimator daySkyAnimator = ObjectAnimator.ofInt(mSkyView, "backgroundColor",
            mNightSkyColor, mSunsetSkyColor)
            .setDuration(3000);
    
    heightAnimator.setInterpolator(new AccelerateInterpolator());
    sunriseSkyAnimator.setEvaluator(new ArgbEvaluator());
    daySkyAnimator.setEvaluator(new ArgbEvaluator());

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(daySkyAnimator).before(sunriseSkyAnimator).before(heightAnimator)
            ;
    animatorSet.start();
}
 
开发者ID:ivicel,项目名称:Android-Programming-BigNerd,代码行数:24,代码来源:SunsetFragment.java

示例3: setColorTitles

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
void setColorTitles(boolean animated) {
    int index = 0;
    for (TextView textView : this.textViews) {
        int color = index == this.currentIndex ? -1 : backTextColor;
        if (getWidth() == 0 || !animated) {
            textView.setTextColor(color);
        } else {
            ObjectAnimator colorAnim = ObjectAnimator.ofInt(textView
                    , "textColor", textView.getCurrentTextColor(), color);
            colorAnim.setEvaluator(new ArgbEvaluator());
            colorAnim.start();
        }
        index++;
    }
}
 
开发者ID:amspayam,项目名称:PDialogs-Android,代码行数:16,代码来源:SegmentController.java

示例4: select

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void select(@Nullable String selectTitle) {
    ObjectAnimator colorAnim = ObjectAnimator.ofInt(binding.textViewDialogSelector
            , "textColor", binding.textViewDialogSelector.getCurrentTextColor(), ContextCompat.getColor(context, R.color.accentColor));
    colorAnim.setEvaluator(new ArgbEvaluator());
    colorAnim.start();
    binding.iconImgv.setImageResource(selectedIcon);

    binding.textViewDialogSelector.setText(selectTitle);
    binding.selectorImgv.setImageResource(R.drawable.ic_previous_selected_p_dialog);
    binding.selectorRly.setBackgroundResource(R.drawable.border_radius_20_selected_p_dialog);

    isSelected = true;
}
 
开发者ID:amspayam,项目名称:PDialogs-Android,代码行数:14,代码来源:Selector.java

示例5: setError

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void setError() {
    ObjectAnimator colorAnim = ObjectAnimator.ofInt(binding.textViewDialogSelector
            , "textColor", binding.textViewDialogSelector.getCurrentTextColor(), ContextCompat.getColor(context, R.color.redDialog));
    colorAnim.setEvaluator(new ArgbEvaluator());
    colorAnim.start();
    binding.iconImgv.setImageResource(imageViewResource);

    binding.textViewDialogSelector.setText(textViewInput);
    binding.selectorImgv.setImageResource(R.drawable.ic_previous_error_p_dialog);
    binding.selectorRly.setBackgroundResource(R.drawable.border_radius_20_error_p_dialog);

    isSelected = false;
}
 
开发者ID:amspayam,项目名称:PDialogs-Android,代码行数:14,代码来源:Selector.java

示例6: resetView

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void resetView() {
    if (isSelected) {
        ObjectAnimator colorAnim = ObjectAnimator.ofInt(binding.textViewDialogSelector
                , "textColor", binding.textViewDialogSelector.getCurrentTextColor(), textColor);
        colorAnim.setEvaluator(new ArgbEvaluator());
        colorAnim.start();
        binding.iconImgv.setImageResource(imageViewResource);

        binding.textViewDialogSelector.setText(textViewInput);
        binding.selectorImgv.setImageResource(R.drawable.ic_previous_normal_p_dialog);
        binding.selectorRly.setBackgroundResource(R.drawable.border_radius_20_normal_p_dialog);
        idSelector = "";
        isSelected = false;
    }
}
 
开发者ID:amspayam,项目名称:PDialogs-Android,代码行数:16,代码来源:Selector.java

示例7: createColorAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private static Animator createColorAnimator(Object target, String propertyName, @ColorInt int startColor, @ColorInt int endColor) {
    ObjectAnimator animator;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        animator = ObjectAnimator.ofArgb(target, propertyName, startColor, endColor);
    } else {
        animator = ObjectAnimator.ofInt(target, propertyName, startColor, endColor);
        animator.setEvaluator(new ArgbEvaluator());
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        animator.setInterpolator(new PathInterpolator(0.4f, 0f, 1f, 1f));
    }
    animator.setDuration(PHONOGRAPH_ANIM_TIME);
    return animator;
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:16,代码来源:ViewUtil.java

示例8: showText

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void showText(TextView textView, String text, int fromColor, int toColor) {
    textView.setText(text);
    ObjectAnimator objectAnimator = ObjectAnimator.ofInt(textView, "textColor", fromColor, toColor);
    objectAnimator.setEvaluator(new ArgbEvaluator());
    objectAnimator.setDuration(300);
    objectAnimator.setRepeatCount(0);
    objectAnimator.start();
}
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:9,代码来源:ShareCard.java

示例9: getAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public Animator getAnimator(View viewToMove) {
    if (viewToMove instanceof TextView) {
        final ObjectAnimator objectAnimator = ObjectAnimator.ofInt(viewToMove, "textColor", ((TextView) viewToMove).getCurrentTextColor(), textColor);
        objectAnimator.setEvaluator(new ArgbEvaluator());
        return objectAnimator;
    } else {
        return null;
    }
}
 
开发者ID:florent37,项目名称:ExpectAnim,代码行数:11,代码来源:TextColorAnimExpectation.java

示例10: setupColorAnimator

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void setupColorAnimator(Animator animator) {
    if (animator instanceof AnimatorSet) {
        List<Animator> childAnimators = ((AnimatorSet) animator).getChildAnimations();
        if (childAnimators != null) {
            for (int i = 0; i < childAnimators.size(); i++) {
                setupColorAnimator((Animator) childAnimators.get(i));
            }
        }
    }
    if (animator instanceof ObjectAnimator) {
        ObjectAnimator objectAnim = (ObjectAnimator) animator;
        String propertyName = objectAnim.getPropertyName();
        if ("fillColor".equals(propertyName) || "strokeColor".equals(propertyName)) {
            if (this.mArgbEvaluator == null) {
                this.mArgbEvaluator = new ArgbEvaluator();
            }
            objectAnim.setEvaluator(this.mArgbEvaluator);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:AnimatedVectorDrawableCompat.java

示例11: startAnimation

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void startAnimation() {
    float sunYStart = mSunView.getTop();
    float sunYEnd = mSkyView.getHeight();

    ObjectAnimator heightAnimator = ObjectAnimator
            .ofFloat(mSunView, "y", sunYStart, sunYEnd)
            .setDuration(3000);
    heightAnimator.setInterpolator(new AccelerateInterpolator());

    ObjectAnimator sunsetSkyAnimator = ObjectAnimator
            .ofInt(mSkyView, "backgroundColor", mBlueSkyColor, mSunsetSkyColor)
            .setDuration(3000);
    sunsetSkyAnimator.setEvaluator(new ArgbEvaluator());

    ObjectAnimator nightSkyAnimator = ObjectAnimator
            .ofInt(mSkyView, "backgroundColor", mSunsetSkyColor, mNightSkyColor)
            .setDuration(1500);
    nightSkyAnimator.setEvaluator(new ArgbEvaluator());

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet
            .play(heightAnimator)
            .with(sunsetSkyAnimator)
            .before(nightSkyAnimator);
    animatorSet.start();
}
 
开发者ID:rsippl,项目名称:AndroidProgramming3e,代码行数:27,代码来源:SunsetFragment.java

示例12: backgroundColor

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * Background color animation builder.
 *
 * @param colors the colors
 * @return the animation builder
 */
public AnimationBuilder backgroundColor(int... colors) {
    for (View view : views) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "backgroundColor", colors);
        objectAnimator.setEvaluator(new ArgbEvaluator());
        this.animatorList.add(objectAnimator);
    }
    return this;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:15,代码来源:AnimationBuilder.java

示例13: textColor

import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
 * Text color animation builder.
 *
 * @param colors the colors
 * @return the animation builder
 */
public AnimationBuilder textColor(int... colors) {
    for (View view : views) {
        if (view instanceof TextView) {
            ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "textColor", colors);
            objectAnimator.setEvaluator(new ArgbEvaluator());
            this.animatorList.add(objectAnimator);
        }
    }
    return this;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:17,代码来源:AnimationBuilder.java


注:本文中的android.animation.ObjectAnimator.setEvaluator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。