android.graphics.Path.isEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中android.graphics.Path.isEmpty()方法的一些代码示例,展示了Path.isEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.isEmpty()方法的具体详情如下:
包路径:android.graphics.Path
类名称:Path
方法名:isEmpty

Path.isEmpty介绍

暂无

代码示例

代码示例来源:origin: qiujuer/Genius-Android

@Override
public void draw(Canvas canvas, Paint paint) {
  if (!mPath.isEmpty()) {
    paint.setColor(mCurColor);
    canvas.drawPath(mPath, paint);
  }
}

代码示例来源:origin: facebook/litho

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);
 }
}

代码示例来源:origin: square/assertj-android

public PathAssert isNotEmpty() {
  isNotNull();
  assertThat(actual.isEmpty()) //
    .overridingErrorMessage("Expected to not be empty but was.") //
    .isFalse();
  return this;
 }
}

代码示例来源:origin: square/assertj-android

public PathAssert isEmpty() {
 isNotNull();
 assertThat(actual.isEmpty()) //
   .overridingErrorMessage("Expected to be empty but was not.") //
   .isTrue();
 return this;
}

代码示例来源:origin: robolectric/robolectric

@Test
public void moveTo() {
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 path.moveTo(0, 0);
 assertThat(path.isEmpty()).isFalse();
}

代码示例来源:origin: robolectric/robolectric

@Test
public void lineTo() {
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 path.lineTo(XCOORD, YCOORD);
 assertThat(path.isEmpty()).isFalse();
}

代码示例来源:origin: robolectric/robolectric

@Test
public void quadTo() {
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 path.quadTo(20.0f, 20.0f, 40.0f, 40.0f);
 assertThat(path.isEmpty()).isFalse();
}

代码示例来源:origin: robolectric/robolectric

@Test
 public void close() {
  Path path = new Path();
  assertThat(path.isEmpty()).isTrue();
  path.close();
 }
}

代码示例来源:origin: robolectric/robolectric

@Test
public void arcTo2() {
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 RectF oval = new RectF(LEFT, TOP, RIGHT, BOTTOM);
 path.arcTo(oval, 0.0f, 30.0f);
 assertThat(path.isEmpty()).isFalse();
}

代码示例来源:origin: robolectric/robolectric

@Test
public void addRect1() {
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 RectF rect = new RectF(LEFT, TOP, RIGHT, BOTTOM);
 path.addRect(rect, Path.Direction.CW);
 assertThat(path.isEmpty()).isFalse();
}

代码示例来源:origin: robolectric/robolectric

@Test
public void arcTo1() {
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 RectF oval = new RectF(LEFT, TOP, RIGHT, BOTTOM);
 path.arcTo(oval, 0.0f, 30.0f, true);
 assertThat(path.isEmpty()).isFalse();
}

代码示例来源:origin: robolectric/robolectric

@Test
public void addRect2() {
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 path.addRect(LEFT, TOP, RIGHT, BOTTOM, Path.Direction.CW);
 assertThat(path.isEmpty()).isFalse();
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testAddCircle() {
 // new the Path instance
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 path.addCircle(XCOORD, YCOORD, 10.0f, Path.Direction.CW);
 assertThat(path.isEmpty()).isFalse();
}

代码示例来源:origin: robolectric/robolectric

@Test
public void transform() {
 Path path = new Path();
 assertThat(path.isEmpty()).isTrue();
 Path dst = new Path();
 path.addRect(new RectF(LEFT, TOP, RIGHT, BOTTOM), Path.Direction.CW);
 path.transform(new Matrix(), dst);
 assertThat(dst.isEmpty()).isFalse();
}

代码示例来源:origin: dinuscxj/LoadingDrawable

if (mWaitPath.isEmpty()) {
  mWaitPath.set(createWaitPath(mCurrentBounds));
  mWaitPathMeasure.setPath(mWaitPath, false);

代码示例来源:origin: dinuscxj/LoadingDrawable

@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);
}

代码示例来源:origin: Ramotion/circle-menu-android

@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();
  }
}

代码示例来源:origin: FabianTerhorst/Isometric

if (!item.drawPath.isEmpty()) {

代码示例来源:origin: alexjlockwood/kyrie

public PathKeyframeSet(Path path) {
 if (path.isEmpty()) {
  throw new IllegalArgumentException("The path must not be empty");
 }
 keyframeData = approximate(path, 0.5f);
}

代码示例来源:origin: AlexMofer/ProjectX

@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);
}

相关文章