Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

CanvasCompat

public class CanvasCompat
extends Object

java.lang.Object
   ↳ com.google.android.material.canvas.CanvasCompat


Compat methods for Canvas.

Summary

Public methods

static int saveLayerAlpha(Canvas canvas, float left, float top, float right, float bottom, int alpha)

Convenience for saveLayerAlpha(Canvas, RectF, int) that takes the four float coordinates of the bounds rectangle.

static int saveLayerAlpha(Canvas canvas, RectF bounds, int alpha)

Convenience for ERROR(/Canvas#saveLayer(RectF, Paint)) but instead of taking a entire Paint object it takes only the alpha parameter.

Inherited methods

From class java.lang.Object

Public methods

saveLayerAlpha

int saveLayerAlpha (Canvas canvas, 
                float left, 
                float top, 
                float right, 
                float bottom, 
                int alpha)

Convenience for saveLayerAlpha(Canvas, RectF, int) that takes the four float coordinates of the bounds rectangle.

Parameters
canvas Canvas

left float

top float

right float

bottom float

alpha int

Returns
int

saveLayerAlpha

int saveLayerAlpha (Canvas canvas, 
                RectF bounds, 
                int alpha)

Convenience for ERROR(/Canvas#saveLayer(RectF, Paint)) but instead of taking a entire Paint object it takes only the alpha parameter.

Parameters
canvas Canvas

bounds RectF

alpha int

Returns
int