Tabnine Logo
ShadowCanvas.getPathPaintHistoryCount
Code IndexAdd Tabnine to your IDE (free)

How to use
getPathPaintHistoryCount
method
in
org.robolectric.shadows.ShadowCanvas

Best Java code snippets using org.robolectric.shadows.ShadowCanvas.getPathPaintHistoryCount (Showing top 8 results out of 315)

origin: robolectric/robolectric

public boolean hasDrawnPath() {
 return getPathPaintHistoryCount() > 0;
}
origin: robolectric/robolectric

@Test
public void resetCanvasHistory_shouldClearTheHistoryAndDescription() throws Exception {
 Canvas canvas = new Canvas();
 canvas.drawPath(new Path(), new Paint());
 canvas.drawText("hi", 1, 2, new Paint());
 ShadowCanvas shadow = shadowOf(canvas);
 shadow.resetCanvasHistory();
 assertThat(shadow.getPathPaintHistoryCount()).isEqualTo(0);
 assertThat(shadow.getTextHistoryCount()).isEqualTo(0);
 assertEquals("", shadow.getDescription());
}
origin: robolectric/robolectric

@Test
public void drawPath_shouldRecordThePathAndThePaint() throws Exception {
 Canvas canvas = new Canvas(targetBitmap);
 Path path = new Path();
 path.lineTo(10, 10);
 Paint paint = new Paint();
 paint.setColor(Color.RED);
 paint.setAlpha(7);
 canvas.drawPath(path, paint);
 // changing the values on this Paint shouldn't affect recorded painted path
 paint.setColor(Color.BLUE);
 paint.setAlpha(8);
 ShadowCanvas shadow = shadowOf(canvas);
 assertThat(shadow.getPathPaintHistoryCount()).isEqualTo(1);
 ShadowPath drawnPath = shadowOf(shadow.getDrawnPath(0));
 assertEquals(drawnPath.getPoints().get(0), new ShadowPath.Point(10, 10, LINE_TO));
 Paint drawnPathPaint = shadow.getDrawnPathPaint(0);
 assertThat(drawnPathPaint.getColor()).isEqualTo(Color.RED);
 assertThat(drawnPathPaint.getAlpha()).isEqualTo(7);
}
origin: robolectric/robolectric

@Test
public void drawPath_shouldRecordThePointsOfEachPathEvenWhenItIsTheSameInstance() throws Exception {
 Canvas canvas = new Canvas(targetBitmap);
 Paint paint = new Paint();
 Path path = new Path();
 path.lineTo(10, 10);
 canvas.drawPath(path, paint);
 path.reset();
 path.lineTo(20, 20);
 canvas.drawPath(path, paint);
 ShadowCanvas shadow = shadowOf(canvas);
 assertThat(shadow.getPathPaintHistoryCount()).isEqualTo(2);
 assertEquals(shadowOf(shadow.getDrawnPath(0)).getPoints().get(0), new ShadowPath.Point(10, 10, LINE_TO));
 assertEquals(shadowOf(shadow.getDrawnPath(1)).getPoints().get(0), new ShadowPath.Point(20, 20, LINE_TO));
}
origin: org.robolectric/shadows-core

public boolean hasDrawnPath() {
 return getPathPaintHistoryCount() > 0;
}
origin: org.robolectric/shadows-framework

public boolean hasDrawnPath() {
 return getPathPaintHistoryCount() > 0;
}
origin: org.robolectric/shadows-core-v23

public boolean hasDrawnPath() {
 return getPathPaintHistoryCount() > 0;
}
origin: org.robolectric/framework

public boolean hasDrawnPath() {
 return getPathPaintHistoryCount() > 0;
}
org.robolectric.shadowsShadowCanvasgetPathPaintHistoryCount

Popular methods of ShadowCanvas

  • getDescription
  • appendDescription
  • describeBitmap
  • separateLines
  • formatColorMatric
  • getArcPaintHistoryCount
  • getDrawnArc
  • getDrawnCircle
  • getDrawnLine
  • getDrawnOval
  • getDrawnPath
  • getDrawnPathPaint
  • getDrawnPath,
  • getDrawnPathPaint,
  • getDrawnRect,
  • getDrawnTextEvent,
  • getLinePaintHistoryCount,
  • getOvalPaintHistoryCount,
  • getRectPaintHistoryCount,
  • getTextHistoryCount,
  • resetCanvasHistory

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSupportFragmentManager (FragmentActivity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now