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); }
@Override public void run() { showPosition = ViewHelper.getY(ButtonFloat.this) - Utils.dpToPx(24, getResources()); hidePosition = ViewHelper.getY(ButtonFloat.this) + getHeight() * 3; if(animate){ ViewHelper.setY(ButtonFloat.this, hidePosition); show(); } } });
.getParent()) + ball.getWidth() / 2) - size); ViewHelper.setY(numberIndicator.numberIndicator, y - size); numberIndicator.numberIndicator.setText(value + "");
private void startAni() { ViewHelper.setY(bt1, 100); }
@Override public void run() { float origin = ViewHelper.getY(containerLeft); ViewHelper.setY(containerLeft, origin-containerLeft.getHeight()); } });
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); }
@Override public void onClick(View view) { switch (view.getId()) { case R.id.offleftandRight: vp.getChildAt(0).findViewById(R.id.tv).offsetLeftAndRight(100); break; case R.id.offtopandBottom: vp.getChildAt(0).findViewById(R.id.tv).offsetTopAndBottom(100); break; case R.id.setMarginToP: ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) vp.getChildAt(0).findViewById(R.id.tv).getLayoutParams(); params.setMargins(0, 100, 0, 0); tv.setLayoutParams(params); break; case R.id.setViewHelperX: ViewHelper.setY(tv, 200); break; case R.id.requestLayout: ((ViewGroup.MarginLayoutParams)tv.getLayoutParams()).height=100; tv.requestLayout(); tv.scrollTo(100, 100); tv.scrollBy(100,50); break; } Property p = new Property(tv); } class Property{
.setDuration(ANIMATIONDURATION).start(); ViewHelper.setY(containerLeft, -containerLeft.getHeight()+Utils.dpToPx(56, getResources())); origin = ViewHelper.getY(containerLeft); ObjectAnimator.ofFloat(containerLeft, "y", 0)