本文整理了Java中android.graphics.Path.addPath()
方法的一些代码示例,展示了Path.addPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.addPath()
方法的具体详情如下:
包路径:android.graphics.Path
类名称:Path
方法名:addPath
暂无
代码示例来源:origin: airbnb/lottie-android
private void addPaths() {
for (int i = 0; i < pathContents.size(); i++) {
path.addPath(pathContents.get(i).getPath());
}
}
代码示例来源:origin: airbnb/lottie-android
@Override public void getBounds(RectF outBounds, Matrix parentMatrix, boolean applyParents) {
path.reset();
for (int i = 0; i < paths.size(); i++) {
path.addPath(paths.get(i).getPath(), parentMatrix);
}
path.computeBounds(outBounds, false);
// Add padding to account for rounding errors.
outBounds.set(
outBounds.left - 1,
outBounds.top - 1,
outBounds.right + 1,
outBounds.bottom + 1
);
}
代码示例来源:origin: airbnb/lottie-android
@Override public void getBounds(RectF outBounds, Matrix parentMatrix, boolean applyParents) {
path.reset();
for (int i = 0; i < paths.size(); i++) {
this.path.addPath(paths.get(i).getPath(), parentMatrix);
}
path.computeBounds(outBounds, false);
// Add padding to account for rounding errors.
outBounds.set(
outBounds.left - 1,
outBounds.top - 1,
outBounds.right + 1,
outBounds.bottom + 1
);
}
代码示例来源:origin: airbnb/lottie-android
@Override public Path getPath() {
// TODO: cache this somehow.
matrix.reset();
if (transformAnimation != null) {
matrix.set(transformAnimation.getMatrix());
}
path.reset();
if (hidden) {
return path;
}
for (int i = contents.size() - 1; i >= 0; i--) {
Content content = contents.get(i);
if (content instanceof PathContent) {
path.addPath(((PathContent) content).getPath(), matrix);
}
}
return path;
}
代码示例来源:origin: airbnb/lottie-android
@Override public Path getPath() {
Path contentPath = contentGroup.getPath();
path.reset();
float copies = this.copies.getValue();
float offset = this.offset.getValue();
for (int i = (int) copies - 1; i >= 0; i--) {
matrix.set(transform.getMatrixForRepeater(i + offset));
path.addPath(contentPath, matrix);
}
return path;
}
代码示例来源:origin: airbnb/lottie-android
@Override public void getBounds(RectF outBounds, Matrix parentMatrix, boolean applyParents) {
L.beginSection("StrokeContent#getBounds");
path.reset();
for (int i = 0; i < pathGroups.size(); i++) {
PathGroup pathGroup = pathGroups.get(i);
for (int j = 0; j < pathGroup.paths.size(); j++) {
path.addPath(pathGroup.paths.get(j).getPath(), parentMatrix);
}
}
path.computeBounds(rect, false);
float width = ((FloatKeyframeAnimation) widthAnimation).getFloatValue();
rect.set(rect.left - width / 2f, rect.top - width / 2f,
rect.right + width / 2f, rect.bottom + width / 2f);
outBounds.set(rect);
// Add padding to account for rounding errors.
outBounds.set(
outBounds.left - 1,
outBounds.top - 1,
outBounds.right + 1,
outBounds.bottom + 1
);
L.endSection("StrokeContent#getBounds");
}
代码示例来源:origin: TangoAgency/material-intro-screen
private void drawUnselected(Canvas canvas) {
combinedUnselectedPath.rewind();
for (int page = 0; page < pageCount; page++) {
int nextXIndex;
if (page == pageCount - 1) {
nextXIndex = page;
} else {
nextXIndex = page + 1;
}
Path unselectedPath = getUnselectedPath(page,
dotCenterX[page],
dotCenterX[nextXIndex],
page == pageCount - 1 ? INVALID_FRACTION : joiningFractions[page],
dotRevealFractions[page]);
unselectedPath.addPath(combinedUnselectedPath);
combinedUnselectedPath.addPath(unselectedPath);
}
if (retreatingJoinX1 != INVALID_FRACTION) {
Path retreatingJoinPath = getRetreatingJoinPath();
combinedUnselectedPath.addPath(retreatingJoinPath);
}
canvas.drawPath(combinedUnselectedPath, unselectedPaint);
}
代码示例来源:origin: airbnb/lottie-android
@Override public void draw(Canvas canvas, Matrix parentMatrix, int parentAlpha) {
if (hidden) {
return;
}
L.beginSection("FillContent#draw");
paint.setColor(((ColorKeyframeAnimation) colorAnimation).getIntValue());
int alpha = (int) ((parentAlpha / 255f * opacityAnimation.getValue() / 100f) * 255);
paint.setAlpha(clamp(alpha, 0, 255));
if (colorFilterAnimation != null) {
paint.setColorFilter(colorFilterAnimation.getValue());
}
path.reset();
for (int i = 0; i < paths.size(); i++) {
path.addPath(paths.get(i).getPath(), parentMatrix);
}
canvas.drawPath(path, paint);
L.endSection("FillContent#draw");
}
代码示例来源:origin: TeamNewPipe/NewPipe
Path marquee = new Path();
for (float i = -size; i < width; i += size) {
marquee.addPath(mMarqueeLine, i + mMarqueeProgress, 0);
代码示例来源:origin: airbnb/lottie-android
Path path = pathList.get(j).getPath();
path.transform(((ContentGroup) content).getTransformationMatrix());
this.remainderPath.addPath(path);
remainderPath.addPath(content.getPath());
Path path = pathList.get(j).getPath();
path.transform(((ContentGroup) lastContent).getTransformationMatrix());
this.firstPath.addPath(path);
代码示例来源:origin: airbnb/lottie-android
@Override public void draw(Canvas canvas, Matrix parentMatrix, int parentAlpha) {
if (hidden) {
return;
}
L.beginSection("GradientFillContent#draw");
path.reset();
for (int i = 0; i < paths.size(); i++) {
path.addPath(paths.get(i).getPath(), parentMatrix);
}
path.computeBounds(boundsRect, false);
Shader shader;
if (type == GradientType.Linear) {
shader = getLinearGradient();
} else {
shader = getRadialGradient();
}
shaderMatrix.set(parentMatrix);
shader.setLocalMatrix(shaderMatrix);
paint.setShader(shader);
if (colorFilterAnimation != null) {
paint.setColorFilter(colorFilterAnimation.getValue());
}
int alpha = (int) ((parentAlpha / 255f * opacityAnimation.getValue() / 100f) * 255);
paint.setAlpha(clamp(alpha, 0, 255));
canvas.drawPath(path, paint);
L.endSection("GradientFillContent#draw");
}
代码示例来源:origin: totond/TextPathView
Path path = new Path();
mTextPaint.getTextPath(text, 0, text.length(), 0, ascent, path);
mFontPath.addPath(path, 0, height * count);
mFontPath.addPath(path, 0, height * count);
代码示例来源:origin: airbnb/lottie-android
path.reset();
for (int j = pathGroup.paths.size() - 1; j >= 0; j--) {
path.addPath(pathGroup.paths.get(j).getPath(), parentMatrix);
代码示例来源:origin: airbnb/lottie-android
tempPath2,
true);
tempPath.addPath(tempPath2);
} else if (newStart < 0) {
tempPath2.reset();
tempPath2,
true);
tempPath.addPath(tempPath2);
代码示例来源:origin: siyamed/android-shape-imageview
void endElement() {
String localName = atts.getName();
if (inDefsElement) {
if (localName.equals("defs")) {
inDefsElement = false;
}
return;
}
if (localName.equals("svg")) {
Path p = popPath();
Matrix matrix = popTransform();
p.transform(matrix);
pathInfo = new PathInfo(p, width, height);
} else if (localName.equals("g")) {
// Break out of hidden mode
if (hidden) {
hiddenLevel--;
if (hiddenLevel == 0) {
hidden = false;
}
}
Path p = popPath();
Matrix matrix = popTransform();
p.transform(matrix);
path.addPath(p);
}
}
代码示例来源:origin: PhilJay/MPAndroidChart
cubicFillPath.addPath(cubicPath);
代码示例来源:origin: airbnb/lottie-android
path.addPath(pathGroup.paths.get(j).getPath(), parentMatrix);
代码示例来源:origin: siyamed/android-shape-imageview
Matrix matrix = popTransform();
p.transform(matrix);
path.addPath(p);
} else if (!hidden && localName.equals("line")) {
Float x1 = getFloatAttr("x1", atts);
Matrix matrix = popTransform();
p.transform(matrix);
path.addPath(p);
} else if (!hidden && localName.equals("circle")) {
Float centerX = getFloatAttr("cx", atts);
Matrix matrix = popTransform();
p.transform(matrix);
path.addPath(p);
Matrix matrix = popTransform();
p.transform(matrix);
path.addPath(p);
Matrix matrix = popTransform();
p.transform(matrix);
path.addPath(p);
Matrix matrix = popTransform();
p.transform(matrix);
path.addPath(p);
} else if (!hidden && localName.equals("metadata")) {
代码示例来源:origin: PhilJay/MPAndroidChart
cubicFillPath.addPath(cubicPath);
代码示例来源:origin: TangoAgency/material-intro-screen
endX2, endY2);
unselectedDotPath.addPath(unselectedDotLeftPath);
controlX2, controlY2,
endX2, endY2);
unselectedDotPath.addPath(unselectedDotRightPath);
内容来源于网络,如有侵权,请联系作者删除!