當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。