Class PromptBackground

java.lang.Object
uk.co.samuelwall.materialtaptargetprompt.extras.PromptBackground
Direct Known Subclasses:
CirclePromptBackground, FullscreenPromptBackground, RectanglePromptBackground

public abstract class PromptBackground
extends java.lang.Object
Used to render the prompt background.
  • Constructor Summary

    Constructors
    Constructor Description
    PromptBackground()  
  • Method Summary

    Modifier and Type Method Description
    boolean contains​(float x, float y)
    Does the element contain the point.
    void draw​(android.graphics.Canvas canvas)
    Draw the element.
    abstract void prepare​(PromptOptions options, boolean clipToBounds, android.graphics.Rect clipBounds)
    Prepares the background for drawing.
    abstract void setColour​(int colour)
    Sets the colour to use for the background.
    void update​(PromptOptions options, float revealModifier, float alphaModifier)
    Update the current prompt rendering state based on the prompt options and current reveal & alpha scales.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PromptBackground

      public PromptBackground()
  • Method Details

    • setColour

      public abstract void setColour​(int colour)
      Sets the colour to use for the background.
      Parameters:
      colour - Colour integer representing the colour.
    • prepare

      public abstract void prepare​(@NonNull PromptOptions options, boolean clipToBounds, @NonNull android.graphics.Rect clipBounds)
      Prepares the background for drawing.
      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

      void update​(@NonNull PromptOptions options, float revealModifier, float alphaModifier)
      Update the current prompt rendering state based on the prompt options and current reveal & alpha scales.
      Parameters:
      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.
    • draw

      void draw​(@NonNull android.graphics.Canvas canvas)
      Draw the element.
      Parameters:
      canvas - The canvas to draw to.
    • contains

      boolean contains​(float x, float y)
      Does the element contain the point.
      Parameters:
      x - x coordinate.
      y - y coordinate.
      Returns:
      True if the element contains the point, false otherwise.