本文整理了Java中com.zone.lib.utils.view.graphics.basic.ZPointF.<init>()
方法的一些代码示例,展示了ZPointF.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZPointF.<init>()
方法的具体详情如下:
包路径:com.zone.lib.utils.view.graphics.basic.ZPointF
类名称:ZPointF
方法名:<init>
暂无
代码示例来源:origin: luhaoaimama1/zone-sdk
private void initControlPoint() {
float controlLength = r * c;
topLeftContrl = new ZPointF(-controlLength, 0, top);
topRightContrl = new ZPointF(controlLength, 0, top);
bottomLeftContrl = new ZPointF(-controlLength, 0, bottom);
bottomRightContrl = new ZPointF(controlLength, 0, bottom);
leftTopContrl = new ZPointF(0, controlLength, left);
leftBottomContrl = new ZPointF(0, -controlLength, left);
rightTopContrl = new ZPointF(0, controlLength, right);
rightBottomContrl = new ZPointF(0, -controlLength, right);
}
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void initContrlPoint(Circle circle1) {
topLeftContrl = new ZPointF(-controlLength, 0, circle1.top);
topRightContrl = new ZPointF(controlLength, 0, circle1.top);
bottomLeftContrl = new ZPointF(-controlLength, 0, circle1.bottom);
bottomRightContrl = new ZPointF(controlLength, 0, circle1.bottom);
leftTopContrl = new ZPointF(0, controlLength, circle1.left);
leftBottomContrl = new ZPointF(0, -controlLength, circle1.left);
rightTopContrl = new ZPointF(0, controlLength, circle1.right);
rightBottomContrl = new ZPointF(0, -controlLength, circle1.right);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public static ZPointF getMidPoint(ZPointF p1, ZPointF p2) {
return new ZPointF((p1.x + p2.x) / 2, (p1.y + p2.y) / 2);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private ZPointF offset(float x, float y) {
return new ZPointF(center.x + x, center.y + y);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if(stop)
return;
//结尾的 左点修正
leftTopContrl = new ZPointF(0, controlLength, endCircle.left);
leftBottomContrl = new ZPointF(0, -controlLength, endCircle.left);
ZPath circlePath = buildPath(startAngel);
if (mListener != null)
mListener.update(circlePath);
}
});
代码示例来源:origin: luhaoaimama1/zone-sdk
public Circle(float centerX, float centerY, float r) {
center = new ZPointF(centerX, centerY);
init(r);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
paint.setColor(Color.RED);
//1静态图, 两个圆 一个path
center = mDrawBind.center();
canvas.drawCircle(center[0], center[1], sr, paint);
anotherCenter = new float[]{bCenter[0], bCenter[1]};
canvas.drawCircle(anotherCenter[0], anotherCenter[1], br, paint);
Circle c1 = new Circle(new ZPointF(center[0], center[1]), sr);
Circle c2 = new Circle(new ZPointF(anotherCenter[0], anotherCenter[1]), br);
paint.setColor(Color.YELLOW);
customCutLine(canvas,c1,c2);
// customSquare(canvas,c1,c2);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public void start(){
circle=new Circle(new ZPointF(getWidth()/2-100,getHeight()/2),50);
flexibleBallAnimation=new FlexibleBallAnimation(circle, new ZPointF(ex,ey),new FlexibleBallAnimation.Listener() {
@Override
public void update(ZPath path) {
mPath=path;
postInvalidate();
}
});
flexibleBallAnimation.start();
flexibleBallAnimationProgress=new FlexibleBallAnimation(circle, new ZPointF(ex,ey),new FlexibleBallAnimation.Listener() {
@Override
public void update(ZPath path) {
mPathProgress =path;
postInvalidate();
}
});
flexibleBallAnimationProgress.setProgress(0.5F);
}
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void animStatus5() {
float percent = (float) (mAnimPercent - 0.9) * 10;
if (!status4Commit) {
status4Commit = true;
commit();
leftStart5 = new ZPointF(circle.left);
}
circle.left.offsetReplace((endCircle.left.x - leftStart5.x) * percent, 0);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
pA = new ZPointF((float) Math.cos(Math.toRadians(expandAngel / 2)) * c1.r, -(float) Math.sin(Math.toRadians(expandAngel / 2)) * c1.r);
pA.offset(c1.center);
pD = new ZPointF((float) Math.cos(Math.toRadians(expandAngel / 2)) * c1.r, (float) Math.sin(Math.toRadians(expandAngel / 2)) * c1.r);
pD.offset(c1.center);
pB = new ZPointF(-(float) Math.cos(Math.toRadians(expandAngel / 2)) * c2.r, -(float) Math.sin(Math.toRadians(expandAngel / 2)) * c2.r);
pB.offset(dst[0], dst[1]);
pC = new ZPointF(-(float) Math.cos(Math.toRadians(expandAngel / 2)) * c2.r, (float) Math.sin(Math.toRadians(expandAngel / 2)) * c2.r);
pC.offset(dst[0], dst[1]);
pControl = GeometryUtils.getMidPoint(c1.center, new ZPointF(dst[0], dst[1]));
代码示例来源:origin: luhaoaimama1/zone-sdk
pA = new ZPointF((float) Math.cos(Math.toRadians(expandAngel / 2)) * c1.r, -(float) Math.sin(Math.toRadians(expandAngel / 2)) * c1.r);
pA.offset(c1.center);
pD = new ZPointF((float) Math.cos(Math.toRadians(expandAngel / 2)) * c1.r, (float) Math.sin(Math.toRadians(expandAngel / 2)) * c1.r);
pD.offset(c1.center);
pApDControl = new ZPointF((float) (c1.r / Math.cos(Math.toRadians(expandAngel / 2))), 0);
pApDControl.offset(c1.center);
pB = new ZPointF(-(float) Math.cos(Math.toRadians(expandAngel / 2)) * c2.r, -(float) Math.sin(Math.toRadians(expandAngel / 2)) * c2.r);
pB.offset(dst[0], dst[1]);
pC = new ZPointF(-(float) Math.cos(Math.toRadians(expandAngel / 2)) * c2.r, (float) Math.sin(Math.toRadians(expandAngel / 2)) * c2.r);
pC.offset(dst[0], dst[1]);
pBpCControl = new ZPointF(-(float) (c2.r / Math.cos(Math.toRadians(expandAngel / 2))), 0);
pBpCControl.offset(dst[0], dst[1]);
代码示例来源:origin: luhaoaimama1/zone-sdk
private void animStatus4() {
if (!status3Commit) {
status3Commit = true;
commit();
leftStart4 = new ZPointF(circle.left);
topRightBottomFix();
}
float percent = (float) (mAnimPercent - 0.8) * 10;
circle.left.offsetReplace((endCircle.left.x - leftStart4.x + mElasticDistance / 2) * percent, 0, "parent");
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void animStatus3() {
if (!status2Commit) {
status2Commit = true;
//动画状态1 把这个位置真正的记录下来;
commit();
rightStart3 = new ZPointF(circle.right);//必须新建对象来 记录值 不能用等于
centerStart3 = new ZPointF(circle.top);
}
float percent = (float) ((mAnimPercent - 0.5) * (10f / 3));
circle.right.offsetReplace((endCircle.right.x - rightStart3.x) * percent, 0);
circle.left.offsetReplace((endCircle.top.x - centerStart3.x) * percent, 0);
circle.top.offsetReplace((endCircle.top.x - centerStart3.x) * percent, 0);
circle.bottom.offsetReplace((endCircle.top.x - centerStart3.x) * percent, 0);
//控制点 在反向回去
topLeftContrl.offsetReplace((c2 - c) * percent, 0);
topRightContrl.offsetReplace(-(c2 - c) * percent, 0);
bottomLeftContrl.offsetReplace((c2 - c) * percent, 0);
bottomRightContrl.offsetReplace(-(c2 - c) * percent, 0);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public FlexibleBallAnimation(Circle circle_, ZPointF end, Listener listener){
this.mListener = listener;
this.circle = new Circle(circle_);
// this.circle = ReflectCloneUtils.clone(circle_,true);//clone 好使!!!
//初始化一些值
controlLength = circle.r * c;
mElasticDistance = circle.r * mElasticPercent;
mMoveDistance = GeometryUtils.getLength(circle.center, end);
ZPointF tempPonit = new ZPointF(mMoveDistance, 0);
tempPonit.offset(circle.center);
endCircle = new Circle(tempPonit, circle.r);
//仅仅考虑右边既可以了嘎嘎!先把end点 按照 start点旋转成右边 --->最后按照start点把画布反旋转过来 来适应所有角度
startAngel = GeometryUtils.getP2AngleByX(end, circle.center);
//计算 8个控制点 动画状态0 (初始状态:圆形)
initContrlPoint(circle);
}
public void setProgress(float percent){
内容来源于网络,如有侵权,请联系作者删除!