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() { 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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);
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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() { 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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(); 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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();
	} 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
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() { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    private static final int ELEMENT_FILL_COLOR_FOUND = 0xff88ff88;
    private static final int ELEMENT_FILL_COLOR_NOT_FOUND = 0xffff8888;
 
    final static private TimeInterpolator linearInterpolator = new LinearInterpolator();
    final static private ArgbEvaluator argbEvaluator = new ArgbEvaluator();
 
    private final AnimatorUpdateListener viewInvalidator = new Common.ViewInvalidator(this);
 
    private ArrayList<ShapeHolder> inputElements = new ArrayList<ShapeHolder>();
    private ShapeHolder searchElement = null, lowElement = null, highElement = null;
 
    public BinarySearchExperiment(Context context) {
        super(context);
 
        int[] originalElementValues = Arrays.copyOf(Unit.INITIAL_VALUES_ARRAY, Unit.INITIAL_VALUES_ARRAY.length);
        int originalSearchElementValue = originalElementValues[originalElementValues.length * 3 / 4];
 
        Arrays.sort(originalElementValues);
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    private static final int ELEMENT_FILL_COLOR_FOUND = 0xff88ff88;
    private static final int ELEMENT_FILL_COLOR_NOT_FOUND = 0xffff8888;
 
    final static private TimeInterpolator linearInterpolator = new LinearInterpolator();
    final static private ArgbEvaluator argbEvaluator = new ArgbEvaluator();
 
    private final AnimatorUpdateListener viewInvalidator = new Common.ViewInvalidator(this);
 
    private ArrayList<ShapeHolder> inputElements = new ArrayList<ShapeHolder>();
    private ShapeHolder searchElement = null;
 
    public LinearSearchExperiment(Context context) {
        super(context);
 
        int[] originalElementValues = Arrays.copyOf(Unit.INITIAL_VALUES_ARRAY, Unit.INITIAL_VALUES_ARRAY.length);
        int originalSearchElementValue = originalElementValues[originalElementValues.length * 3 / 4];
 
        ShapeHolder inputElement;
        for (int i = 0; i < originalElementValues.length; i++) {
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android ArgbEvaluator Questions & Answers:

See Code Examples for Android ArgbEvaluator Methods: