public static float centerX(View view){ return ViewHelper.getX(view) + view.getWidth()/2; }
@Override public void run() { View v = layoutRipple.getChildAt(0); layoutRipple.setxRippleOrigin(ViewHelper.getX(v)+v.getWidth()/2); layoutRipple.setyRippleOrigin(ViewHelper.getY(v)+v.getHeight()/2); layoutRipple.setRippleColor(Color.parseColor("#1E88E5")); layoutRipple.setRippleSpeed(30); } });
transparentPaint.setXfermode(new PorterDuffXfermode( PorterDuff.Mode.CLEAR)); temp.drawCircle(ViewHelper.getX(ball) + ball.getWidth() / 2, ViewHelper.getY(ball) + ball.getHeight() / 2, ball.getWidth() / 2, transparentPaint); paint.setColor((check) ? makePressColor() : Color .parseColor("#446D6D6D")); canvas.drawCircle(ViewHelper.getX(ball) + ball.getWidth() / 2, getHeight() / 2, getHeight() / 2, paint);
transparentPaint.setXfermode(new PorterDuffXfermode( PorterDuff.Mode.CLEAR)); temp.drawCircle(ViewHelper.getX(ball) + ball.getWidth() / 2, ViewHelper.getY(ball) + ball.getHeight() / 2, ball.getWidth() / 2, transparentPaint); paint.setColor(backgroundColor); paint.setAntiAlias(true); canvas.drawCircle(ViewHelper.getX(ball) + ball.getWidth() / 2, getHeight() / 2, getHeight() / 3, paint);
private void placeBall() { ViewHelper.setX(ball, getHeight() / 2 - ball.getWidth() / 2); ball.xIni = ViewHelper.getX(ball); ball.xFin = getWidth() - getHeight() / 2 - ball.getWidth() / 2; ball.xCen = getWidth() / 2 - ball.getWidth() / 2; placedBall = true; }
private void placeBall() { ViewHelper.setX(ball, getHeight() / 2 - ball.getWidth() / 2); ball.xIni = ViewHelper.getX(ball); ball.xFin = getWidth() - getHeight() / 2 - ball.getWidth() / 2; ball.xCen = getWidth() / 2 - ball.getWidth() / 2; placedBall = true; ball.animateCheck(); }
public static float centerX(View view){ return ViewHelper.getX(view) + view.getWidth()/2; }
@Override public void run() { float origin = ViewHelper.getX(containerTop); ViewHelper.setX(containerTop, origin-containerTop.getWidth()); } });
float posX = ViewHelper.getX(frontView); if (opened.get(downPosition)) { posX += openedRight.get(downPosition) ? -viewWidth + rightOffset : viewWidth - leftOffset;
@Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if (!placedBall) { placeBall(); } Paint paint = new Paint(); paint.setColor(backgroundColorLine); paint.setStrokeWidth(dpToPx(3, getResources())); canvas.drawLine(getHeight() / 2, getHeight() / 2, getWidth() - getHeight() / 2, getHeight() / 2, paint); paint.setColor(backgroundColor); float division = (ball.xFin - ball.xIni) / (max - min); int value = this.value - min; canvas.drawLine(getHeight() / 2, getHeight() / 2, value * division + getHeight() / 2, getHeight() / 2, paint); if (press) { paint.setColor(backgroundColor); paint.setAntiAlias(true); canvas.drawCircle(ViewHelper.getX(ball) + ball.getWidth() / 2, getHeight() / 2, getHeight() / 4, paint); } invalidate(); }
private void placeBall() { ViewHelper.setX(ball, getHeight() / 2 - ball.getWidth() / 2); ball.xIni = ViewHelper.getX(ball); ball.xFin = getWidth() - getHeight() / 2 - ball.getWidth() / 2; ball.xCen = getWidth() / 2 - ball.getWidth() / 2; placedBall = true; }
float origin = ViewHelper.getX(containerTop); ObjectAnimator.ofFloat(containerTop, "x", -containerTop.getWidth()) .setDuration(ANIMATIONDURATION).start();
float origin = ViewHelper.getX(containerTop); ObjectAnimator.ofFloat(containerTop, "x", 0) .setDuration(ANIMATIONDURATION).start();