Class RectanglePromptBackground
- java.lang.Object
-
- uk.co.samuelwall.materialtaptargetprompt.extras.PromptBackground
-
- uk.co.samuelwall.materialtaptargetprompt.extras.backgrounds.RectanglePromptBackground
-
public class RectanglePromptBackground extends PromptBackground
PromptBackground
implementation that renders the prompt background as a rectangle.
-
-
Constructor Summary
Constructors Constructor Description RectanglePromptBackground()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(float x, float y)
void
draw(android.graphics.Canvas canvas)
android.graphics.Path
getPath()
void
prepare(PromptOptions options, boolean clipToBounds, android.graphics.Rect clipBounds)
Prepares the background for drawing.void
setColour(int colour)
Sets the colour to use for the background.RectanglePromptBackground
setCornerRadius(float rx, float ry)
Set the radius for the rectangle corners.void
update(PromptOptions prompt, float revealModifier, float alphaModifier)
-
-
-
Method Detail
-
setCornerRadius
@NonNull public RectanglePromptBackground setCornerRadius(float rx, float ry)
Set the radius for the rectangle corners.- Parameters:
rx
- The x-radius of the oval used to round the cornersry
- The y-radius of the oval used to round the corners- Returns:
- This prompt background
-
setColour
public void setColour(int colour)
Description copied from class:PromptBackground
Sets the colour to use for the background.- Specified by:
setColour
in classPromptBackground
- Parameters:
colour
- Colour integer representing the colour.
-
prepare
public void prepare(@NonNull PromptOptions options, boolean clipToBounds, @NonNull android.graphics.Rect clipBounds)
Description copied from class:PromptBackground
Prepares the background for drawing.- Specified by:
prepare
in classPromptBackground
- Parameters:
options
- The options from which the prompt was created.clipToBounds
- Should the prompt be clipped to the supplied clipBounds.clipBounds
- The bounds to clip the drawing to.
-
update
public void update(@NonNull PromptOptions prompt, float revealModifier, float alphaModifier)
-
draw
public void draw(@NonNull android.graphics.Canvas canvas)
-
contains
public boolean contains(float x, float y)
-
getPath
public android.graphics.Path getPath()
- Overrides:
getPath
in classPromptBackground
- Returns:
- The path of the current background, useful for clipping content
-
-