@Override public void draw(Canvas canvas, Paint paint) { if (!mPath.isEmpty()) { paint.setColor(mCurColor); canvas.drawPath(mPath, paint); } }
private static void drawBorder( Canvas canvas, RectF bounds, Path path, float[] radii, Paint paint) { float maxRadii = Math.min(bounds.width(), bounds.height()) / 2f; if (path == null) { // All radii are the same float radius = Math.min(maxRadii, radii[0]); canvas.drawRoundRect(bounds, radius, radius, paint); } else { if (path.isEmpty()) { path.addRoundRect(bounds, radii, Path.Direction.CW); } canvas.drawPath(path, paint); } }
public PathAssert isNotEmpty() { isNotNull(); assertThat(actual.isEmpty()) // .overridingErrorMessage("Expected to not be empty but was.") // .isFalse(); return this; } }
public PathAssert isEmpty() { isNotNull(); assertThat(actual.isEmpty()) // .overridingErrorMessage("Expected to be empty but was not.") // .isTrue(); return this; }
@Test public void close() { Path path = new Path(); assertThat(path.isEmpty()).isTrue(); path.close(); } }
if (mWaitPath.isEmpty()) { mWaitPath.set(createWaitPath(mCurrentBounds)); mWaitPathMeasure.setPath(mWaitPath, false);
@Override protected void computeRender(float renderProgress) { if (mCurrentBounds.isEmpty()) { return; } if (mMotherMovePath.isEmpty()) { mMotherMovePath.set(createMotherMovePath()); mMotherMovePathMeasure.setPath(mMotherMovePath, false); mChildMovePath.set(createChildMovePath()); mChildMovePathMeasure.setPath(mChildMovePath, false); } //mother oval float motherMoveProgress = MOTHER_MOVE_INTERPOLATOR.getInterpolation(renderProgress); mMotherMovePathMeasure.getPosTan(getCurrentMotherMoveLength(motherMoveProgress), mMotherPosition, null); mMotherOvalHalfWidth = mMaxMotherOvalSize; mMotherOvalHalfHeight = mMaxMotherOvalSize * getMotherShapeFactor(motherMoveProgress); //child Oval float childMoveProgress = CHILD_MOVE_INTERPOLATOR.getInterpolation(renderProgress); mChildMovePathMeasure.getPosTan(getCurrentChildMoveLength(childMoveProgress), mChildPosition, null); setupChildParams(childMoveProgress); mRotateDegrees = (int) (Math.toDegrees(Math.atan((mMotherPosition[1] - mChildPosition[1]) / (mMotherPosition[0] - mChildPosition[0])))); mRevealCircleRadius = getCurrentRevealCircleRadius(renderProgress); mCurrentOvalColor = getCurrentOvalColor(renderProgress); mCurrentBackgroundColor = getCurrentBackgroundColor(renderProgress); }
@Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); if (!mPath.isEmpty()) { canvas.save(); canvas.translate(getWidth() / 2, getHeight() / 2); canvas.drawPath(mPath, mPaint); canvas.restore(); } }
if (!item.drawPath.isEmpty()) {
public PathKeyframeSet(Path path) { if (path.isEmpty()) { throw new IllegalArgumentException("The path must not be empty"); } keyframeData = approximate(path, 0.5f); }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void getOutline(@SuppressWarnings("NullableProblems") Outline outline) { if (mProvider == null || mOutlinePath.isEmpty() || !mOutlinePath.isConvex()) { super.getOutline(outline); return; } outline.setConvexPath(mOutlinePath); outline.setAlpha(1); }