use of android.graphics.PathMeasure in project LoadingDrawable by dinuscxj.
the class CircleBroodLoadingRenderer method getRestLength.
private float getRestLength(Path path, float startD) {
Path tempPath = new Path();
PathMeasure pathMeasure = new PathMeasure(path, false);
pathMeasure.getSegment(startD, pathMeasure.getLength(), tempPath, true);
pathMeasure.setPath(tempPath, false);
return pathMeasure.getLength();
}
use of android.graphics.PathMeasure in project FloatingView by UFreedom.
the class FloatingPath method create.
public static FloatingPath create(Path path, boolean forceClose) {
FloatingPath floatingPath = new FloatingPath(path);
floatingPath.mPathMeasure = new PathMeasure(path, forceClose);
return floatingPath;
}
use of android.graphics.PathMeasure in project Transitions-Everywhere by andkulikov.
the class PathAnimatorCompat method ofPointF.
@Nullable
public static <T> PathAnimatorCompat ofPointF(@Nullable T target, @Nullable PointFProperty<T> property, @Nullable Path path) {
PathAnimatorCompat animator = null;
if (target != null && property != null && path != null) {
animator = new PathAnimatorCompat(target, property);
animator.mPathMeasure = new PathMeasure(path, false);
animator.mPathLength = animator.mPathMeasure.getLength();
}
return animator;
}
use of android.graphics.PathMeasure in project MaterialCalendar by Haoxiqiang.
the class WeatherTemplateView method getPoints.
protected PathPoints[] getPoints(Path path, int size) {
// Size of 100 indicates that, 100 points
// would be extracted from the path
PathPoints[] pointArray = new PathPoints[size];
PathMeasure pm = new PathMeasure(path, false);
float length = pm.getLength();
float distance = 0f;
float speed = length / size;
int counter = 0;
float[] aCoordinates = new float[2];
while ((distance < length) && (counter < size)) {
pm.getPosTan(distance, aCoordinates, null);
pointArray[counter] = new PathPoints(aCoordinates[0], aCoordinates[1]);
counter++;
distance = distance + speed;
}
return pointArray;
}
use of android.graphics.PathMeasure in project YhLibraryForAndroid by android-coco.
the class LineChartView method setAnim.
// 设置动画
private void setAnim(Canvas canvas) {
PathMeasure measure = new PathMeasure(mPath, false);
float pathLength = measure.getLength();
PathEffect effect = new DashPathEffect(new float[] { pathLength, pathLength }, pathLength - pathLength * mProgress);
mPaintLine.setPathEffect(effect);
canvas.drawPath(mPath, mPaintLine);
}
Aggregations