private void separateLines() { if (getDescription().length() != 0) { appendDescription("\n"); } }
@Implementation protected void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) { describeBitmap(bitmap, paint); int x = (int) (left + translateX); int y = (int) (top + translateY); if (x != 0 || y != 0) { appendDescription(" at (" + x + "," + y + ")"); } if (scaleX != 1 && scaleY != 1) { appendDescription(" scaled by (" + scaleX + "," + scaleY + ")"); } }
@Implementation protected void drawColor(int color) { appendDescription("draw color " + color); }
@Implementation protected void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint) { describeBitmap(bitmap, paint); StringBuilder descriptionBuilder = new StringBuilder(); if (dst != null) { descriptionBuilder.append(" at (").append(dst.left).append(",").append(dst.top) .append(") with height=").append(dst.height()).append(" and width=").append(dst.width()); } if (src != null) { descriptionBuilder.append( " taken from ").append(src.toString()); } appendDescription(descriptionBuilder.toString()); }
@Implementation protected void drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint) { describeBitmap(bitmap, paint); StringBuilder descriptionBuilder = new StringBuilder(); if (dst != null) { descriptionBuilder.append(" at (").append(dst.left).append(",").append(dst.top) .append(") with height=").append(dst.height()).append(" and width=").append(dst.width()); } if (src != null) { descriptionBuilder.append( " taken from ").append(src.toString()); } appendDescription(descriptionBuilder.toString()); }
@Implementation protected void draw(android.graphics.Canvas canvas) { Drawable background = realView.getBackground(); if (background != null) { ShadowCanvas shadowCanvas = Shadow.extract(canvas); shadowCanvas.appendDescription("background:"); background.draw(canvas); } }
@Implementation protected void drawPath(Path path, Paint paint) { pathPaintEvents.add(new PathPaintHistoryEvent(new Path(path), new Paint(paint))); separateLines(); ShadowPath shadowPath = Shadow.extract(path); appendDescription("Path " + shadowPath.getPoints().toString()); }
private void describeBitmap(Bitmap bitmap, Paint paint) { separateLines(); ShadowBitmap shadowBitmap = Shadow.extract(bitmap); appendDescription(shadowBitmap.getDescription()); if (paint != null) { ColorFilter colorFilter = paint.getColorFilter(); if (colorFilter != null) { if (colorFilter instanceof ColorMatrixColorFilter) { ColorMatrixColorFilter colorMatrixColorFilter = (ColorMatrixColorFilter) colorFilter; ShadowColorMatrixColorFilter shadowColorMatrixColorFilter = Shadow.extract(colorMatrixColorFilter); ColorMatrix colorMatrix = shadowColorMatrixColorFilter.getMatrix(); appendDescription(" with ColorMatrixColorFilter<" + formatColorMatric(colorMatrix) + ">"); } else { appendDescription(" with " + colorFilter); } } } }
@Implementation protected void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) { describeBitmap(bitmap, paint); ShadowMatrix shadowMatrix = Shadow.extract(matrix); appendDescription(" transformed by " + shadowMatrix.getDescription()); }
@Implementation public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) { describeBitmap(bitmap, paint); int x = (int) (left + translateX); int y = (int) (top + translateY); if (x != 0 || y != 0) { appendDescription(" at (" + x + "," + y + ")"); } if (scaleX != 1 && scaleY != 1) { appendDescription(" scaled by (" + scaleX + "," + scaleY + ")"); } }
@Implementation public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) { describeBitmap(bitmap, paint); int x = (int) (left + translateX); int y = (int) (top + translateY); if (x != 0 || y != 0) { appendDescription(" at (" + x + "," + y + ")"); } if (scaleX != 1 && scaleY != 1) { appendDescription(" scaled by (" + scaleX + "," + scaleY + ")"); } }
@Implementation protected void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) { describeBitmap(bitmap, paint); int x = (int) (left + translateX); int y = (int) (top + translateY); if (x != 0 || y != 0) { appendDescription(" at (" + x + "," + y + ")"); } if (scaleX != 1 && scaleY != 1) { appendDescription(" scaled by (" + scaleX + "," + scaleY + ")"); } }
private void separateLines() { if (getDescription().length() != 0) { appendDescription("\n"); } }
@Implementation public void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint) { describeBitmap(bitmap, paint); StringBuilder descriptionBuilder = new StringBuilder(); if (dst != null) { descriptionBuilder.append(" at (").append(dst.left).append(",").append(dst.top) .append(") with height=").append(dst.height()).append(" and width=").append(dst.width()); } if (src != null) { descriptionBuilder.append( " taken from ").append(src.toString()); } appendDescription(descriptionBuilder.toString()); }
@Implementation public void drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint) { describeBitmap(bitmap, paint); StringBuilder descriptionBuilder = new StringBuilder(); if (dst != null) { descriptionBuilder.append(" at (").append(dst.left).append(",").append(dst.top) .append(") with height=").append(dst.height()).append(" and width=").append(dst.width()); } if (src != null) { descriptionBuilder.append( " taken from ").append(src.toString()); } appendDescription(descriptionBuilder.toString()); }
@Implementation public void draw(android.graphics.Canvas canvas) { Drawable background = realView.getBackground(); if (background != null) { shadowOf(canvas).appendDescription("background:"); background.draw(canvas); } }
@Implementation public void drawPath(Path path, Paint paint) { pathPaintEvents.add(new PathPaintHistoryEvent(new Path(path), new Paint(paint))); separateLines(); appendDescription("Path " + shadowOf(path).getPoints().toString()); }
@Implementation protected void drawPath(Path path, Paint paint) { pathPaintEvents.add(new PathPaintHistoryEvent(new Path(path), new Paint(paint))); separateLines(); ShadowPath shadowPath = Shadow.extract(path); appendDescription("Path " + shadowPath.getPoints().toString()); }
@Implementation protected void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) { describeBitmap(bitmap, paint); ShadowMatrix shadowMatrix = Shadow.extract(matrix); appendDescription(" transformed by " + shadowMatrix.getDescription()); }
@Implementation public void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) { describeBitmap(bitmap, paint); appendDescription(" transformed by " + shadowOf(matrix).getDescription()); }