/** * Stop indeterminate animation to convert view in determinate progress bar */ private void stopIndeterminate(){ animation.cancel(); ViewHelper.setX(progressView,0); runAnimation = false; }
void setDegree(float degree){ mValue = degree; View clipView = mTarget.get(); float x = mArcMetric.getAxisPoint().x + mArcMetric.mRadius * Utils.cos(degree); float y = mArcMetric.getAxisPoint().y - mArcMetric.mRadius * Utils.sin(degree); ViewHelper.setX(clipView,x - clipView.getWidth() / 2); ViewHelper.setY(clipView,y - clipView.getHeight() / 2); }
eventCheck = false; ViewHelper.setX(ball, x); ball.changeBackground(); if ((event.getX() <= getWidth() && event.getX() >= 0)) {
public void setValue(final int value) { if (placedBall == false) post(new Runnable() { @Override public void run() { setValue(value); } }); else { this.value = value; float division = (ball.xFin - ball.xIni) / max; ViewHelper.setX(ball, value * division + getHeight() / 2 - ball.getWidth() / 2); ball.changeBackground(); } }
x = (x < ball.xIni) ? ball.xIni : x; x = (x > ball.xFin) ? ball.xFin : x; ViewHelper.setX(ball, x); ball.changeBackground();
ViewHelper.setX(progressView,getWidth()+progressView.getWidth()/2); animation = ObjectAnimator.ofFloat(progressView, "x", -progressView.getWidth()/2); animation.setDuration(1200);
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; }
if (animate == false) { ViewHelper .setX(numberIndicator.numberIndicator, (ViewHelper.getX(ball) + Utils.getRelativeLeft((View) ball
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(); }
@Override public void run() { float origin = ViewHelper.getX(containerTop); ViewHelper.setX(containerTop, origin-containerTop.getWidth()); } });
void setDegree(float degree){ mValue = degree; View clipView = mTarget.get(); float x = mArcMetric.getAxisPoint().x + mArcMetric.mRadius * Utils.cos(degree); float y = mArcMetric.getAxisPoint().y - mArcMetric.mRadius * Utils.sin(degree); ViewHelper.setX(clipView,x - clipView.getWidth() / 2); ViewHelper.setY(clipView,y - clipView.getHeight() / 2); }
x = (x < ball.xIni) ? ball.xIni : x; x = (x > ball.xFin) ? ball.xFin : x; ViewHelper.setX(ball, x); ball.changeBackground();
public void setValue(final int value) { if (placedBall == false) post(new Runnable() { @Override public void run() { setValue(value); } }); else { this.value = value; float division = (ball.xFin - ball.xIni) / max; ViewHelper.setX(ball, value * division + getHeight() / 2 - ball.getWidth() / 2); ball.changeBackground(); } }
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; }
ViewHelper.setX(containerTop, -containerTop.getWidth()+Utils.dpToPx(56, getResources())); float origin = ViewHelper.getX(containerTop); ObjectAnimator.ofFloat(containerTop, "x", 0)