public abstract class PromptFocal
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
mBaseRippleAlpha
The alpha value for the ripple.
|
protected boolean |
mDrawRipple
Should the ripple be drawn.
|
Constructor and Description |
---|
PromptFocal() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(float x,
float y)
Does the element contain the point.
|
void |
draw(android.graphics.Canvas canvas)
Draw the element.
|
abstract android.graphics.RectF |
getBounds()
Get the focal bounds at scale 1.
|
abstract 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.
|
abstract 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.
|
abstract void |
setColour(int colour)
Set the focal colour.
|
void |
setDrawRipple(boolean drawRipple)
Sets whether the ripple is drawn around the focal.
|
void |
setRippleAlpha(int rippleAlpha)
Sets the alpha value to use for the ripple colour.
|
void |
update(PromptOptions options,
float revealModifier,
float alphaModifier)
Update the current prompt rendering state based on the prompt options and current reveal & alpha scales.
|
abstract void |
updateRipple(float revealModifier,
float alphaModifier)
Update the ripple around the focal.
|
protected boolean mDrawRipple
protected int mBaseRippleAlpha
public void setDrawRipple(boolean drawRipple)
drawRipple
- True to draw the ripple.public void setRippleAlpha(int rippleAlpha)
rippleAlpha
- The ripple alpha value between 0 - 255public abstract void setColour(int colour)
colour
- Int colour.@NonNull public abstract android.graphics.RectF getBounds()
public abstract void prepare(@NonNull PromptOptions options, @NonNull android.view.View target, int[] promptViewPosition)
options
- The option that the prompt was built from.target
- The prompt target view.promptViewPosition
- The prompt views screen position.public abstract void prepare(@NonNull PromptOptions options, float targetX, float targetY)
options
- The option that the prompt was built from.targetX
- The target screen x position.targetY
- The target screen y position.public abstract void updateRipple(float revealModifier, float alphaModifier)
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 update(@NonNull PromptOptions options, float revealModifier, float alphaModifier)
options
- The options used to create the prompt.revealModifier
- The current size/revealed scale from 0 - 1.alphaModifier
- The current colour alpha scale from 0 - 1.public void draw(@NonNull android.graphics.Canvas canvas)
canvas
- The canvas to draw to.public boolean contains(float x, float y)
x
- x coordinate.y
- y coordinate.