public class RectanglePromptFocal extends PromptFocal
mBaseRippleAlpha, mDrawRipple
Constructor and Description |
---|
RectanglePromptFocal()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(float x,
float y) |
void |
draw(android.graphics.Canvas canvas) |
android.graphics.RectF |
getBounds()
Get the focal bounds at scale 1.
|
void |
prepare(PromptOptions options,
float targetX,
float targetY)
Setup the focal ready for rendering when targeting a point on the screen, called prior to first render.
|
void |
prepare(PromptOptions options,
android.view.View target,
int[] promptViewPosition)
Setup the focal ready for rendering when targeting a view, called prior to first render.
|
void |
setColour(int colour)
Set the focal colour.
|
RectanglePromptFocal |
setCornerRadius(float rx,
float ry)
Set the radius for the rectangle corners.
|
RectanglePromptFocal |
setSize(android.graphics.PointF size)
Sets the focal to a fixed size.
|
RectanglePromptFocal |
setTargetPadding(float padding)
Set the padding between the target bounds and the rectangle edge.
|
void |
update(PromptOptions options,
float revealModifier,
float alphaModifier) |
void |
updateRipple(float revealModifier,
float alphaModifier)
Update the ripple around the focal.
|
setDrawRipple, setRippleAlpha
public RectanglePromptFocal setCornerRadius(float rx, float ry)
rx
- The x-radius of the oval used to round the cornersry
- The y-radius of the oval used to round the cornerspublic RectanglePromptFocal setTargetPadding(float padding)
padding
- The distance from the target edge to the rectangle edge.public RectanglePromptFocal setSize(@Nullable android.graphics.PointF size)
size
- The fixed focal size or null to change back to the default dynamic size.public android.graphics.RectF getBounds()
PromptFocal
getBounds
in class PromptFocal
public void setColour(int colour)
PromptFocal
setColour
in class PromptFocal
colour
- Int colour.public void prepare(PromptOptions options, android.view.View target, int[] promptViewPosition)
PromptFocal
prepare
in class PromptFocal
options
- The option that the prompt was built from.target
- The prompt target view.promptViewPosition
- The prompt views screen position.public void prepare(PromptOptions options, float targetX, float targetY)
PromptFocal
prepare
in class PromptFocal
options
- The option that the prompt was built from.targetX
- The target screen x position.targetY
- The target screen y position.public void update(PromptOptions options, float revealModifier, float alphaModifier)
public void updateRipple(float revealModifier, float alphaModifier)
PromptFocal
updateRipple
in class PromptFocal
revealModifier
- The amount to scale the ripple by where a 1 value is the same size as the focal.alphaModifier
- The amount to modify the ripple alpha by.public void draw(android.graphics.Canvas canvas)
public boolean contains(float x, float y)