public class CirclePromptFocal extends PromptFocal
mBaseRippleAlpha, mDrawRipple| Constructor and Description |
|---|
CirclePromptFocal()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
android.graphics.PointF |
calculateAngleEdgePoint(float angle,
float padding)
Calculate the point on the focal edge based on the angle.
|
boolean |
contains(float x,
float y) |
void |
draw(android.graphics.Canvas canvas) |
android.graphics.RectF |
getBounds()
Get the focal bounds at scale 1.
|
android.graphics.Path |
getPath()
Get the focal path to be drawn.
|
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.
|
CirclePromptFocal |
setRadius(float radius)
Set the focal radius.
|
void |
update(PromptOptions options,
float revealModifier,
float alphaModifier) |
void |
updateRipple(float revealModifier,
float alphaModifier)
Update the ripple around the focal.
|
setDrawRipple, setRippleAlpha@NonNull public CirclePromptFocal setRadius(float radius)
radius - The radius for the circle to be drawn.@NonNull public android.graphics.RectF getBounds()
PromptFocalgetBounds in class PromptFocal@NonNull public android.graphics.Path getPath()
PromptFocalgetPath in class PromptFocal@NonNull
public android.graphics.PointF calculateAngleEdgePoint(float angle,
float padding)
PromptFocalPromptFocal.prepare(PromptOptions, float, float) or
PromptFocal.prepare(PromptOptions, View, int[]).
Base implementation assumes that focal is a rectangle.calculateAngleEdgePoint in class PromptFocalangle - The angle with 0 based on the right.padding - The padding added to the focal bounds.public void setColour(int colour)
PromptFocalsetColour in class PromptFocalcolour - Int colour.public void prepare(@NonNull
PromptOptions options,
@NonNull
android.view.View target,
int[] promptViewPosition)
PromptFocalprepare in class PromptFocaloptions - The option that the prompt was built from.target - The prompt target view.promptViewPosition - The prompt views screen position.public void prepare(@NonNull
PromptOptions options,
float targetX,
float targetY)
PromptFocalprepare in class PromptFocaloptions - The option that the prompt was built from.targetX - The target screen x position.targetY - The target screen y position.public void update(@NonNull
PromptOptions options,
float revealModifier,
float alphaModifier)
public void updateRipple(float revealModifier,
float alphaModifier)
PromptFocalupdateRipple in class PromptFocalrevealModifier - 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(@NonNull
android.graphics.Canvas canvas)
public boolean contains(float x,
float y)