Android ArgbEvaluator - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ArgbEvaluator class.

This code example shows how to use the following methods: ofObject
        final float alpha = a; 
        ValueAnimator anim = null; 
        if (v.getBackground() instanceof BackgroundAlphaColorDrawable) { 
            final BackgroundAlphaColorDrawable bg = (BackgroundAlphaColorDrawable) v 
                    .getBackground(); 
            anim = ValueAnimator.ofObject(new ArgbEvaluator(), info.color, 
                    BackgroundAlphaColorDrawable.applyAlphaToColor(bg.getBgColor(), alpha)); 
            anim.addUpdateListener(new AnimatorUpdateListener() { 
                @Override 
                public void onAnimationUpdate(ValueAnimator animation) { 
                    info.color = (Integer) animation.getAnimatedValue(); 
                    bg.setColor(info.color); 
                } 
            }); 
        } else { 
            // custom image is set by the theme, let's just apply the alpha if we can. 
            v.getBackground().setAlpha(BackgroundAlphaColorDrawable.floatAlphaToInt(alpha)); 
            return null; 
        } 
        anim.addListener(new AnimatorListener() { 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: ofObject
		return super.onTouchEvent(ev);
	} 
 
	void blingView(final View view) {
		if (view != null && mCurrentBling != view) {
			ValueAnimator animator = ObjectAnimator.ofObject(view,
					"backgroundColor", new ArgbEvaluator(), mOnHoverColorStart,
					mOnHoverColorEnd);
			animator.setDuration(mOnHoverDuration);
			animator.start();
			mCurrentBling = view;
		} 
	} 
 
	private void startDrag(MotionEvent ev) {
		WindowManager wm;
		View view = getChildByIndex(mFrom);
 
		final Bitmap.Config c = Bitmap.Config.ARGB_8888;
		mDragBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), c);
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: ofObject
        final float alpha = a; 
        ValueAnimator anim = null; 
        if (v.getBackground() instanceof BackgroundAlphaColorDrawable) { 
            final BackgroundAlphaColorDrawable bg = (BackgroundAlphaColorDrawable) v 
                    .getBackground(); 
            anim = ValueAnimator.ofObject(new ArgbEvaluator(), info.color, 
                    BackgroundAlphaColorDrawable.applyAlphaToColor(bg.getBgColor(), alpha)); 
            anim.addUpdateListener(new AnimatorUpdateListener() { 
                @Override 
                public void onAnimationUpdate(ValueAnimator animation) { 
                    info.color = (Integer) animation.getAnimatedValue(); 
                    bg.setColor(info.color); 
                } 
            }); 
        } else { 
            // custom image is set by the theme, let's just apply the alpha if we can. 
            v.getBackground().setAlpha(BackgroundAlphaColorDrawable.floatAlphaToInt(alpha)); 
            return null; 
        } 
        anim.addListener(new AnimatorListener() { 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 
import com.monyetmabuk.rajawali.tutorials.R; 
 
public class GithubLogoView extends View {
 
	protected static final ArgbEvaluator ARGB_EVAL = new ArgbEvaluator();
 
	protected Canvas mBackgroundCanvas;
	protected Bitmap mBackground;
	protected Bitmap mMask;
	protected Paint mPaint;
	protected Rect mDrawingRect;
	protected Shader mShader;
	protected boolean mDirection;
	protected long mLastChange;
	protected int mDuration;
 
	public GithubLogoView(Context context) {
		super(context);
		init(); 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: ofObject
		txtHolded.setText("Holded:" + holded + "V");
		// do a animation from red to blue gradiently 
		Integer colorFrom = Color.RED;
		Integer colorTo = Color.BLUE;
		// register and init listener 
		ValueAnimator colorAnimation = ValueAnimator.ofObject(
				new ArgbEvaluator(), colorFrom, colorTo);
		colorAnimation.addUpdateListener(new AnimatorUpdateListener() {
			@Override 
			public void onAnimationUpdate(ValueAnimator animation) {
				txtHolded.setTextColor((Integer) animation.getAnimatedValue());
 
			} 
		}); 
		// animation duration 
		colorAnimation.setDuration(5000);
		// play the animation 
		colorAnimation.start();
	} 
 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ArgbEvaluator Questions & Answers:

See Code Examples for Android ArgbEvaluator Methods: