Class PromptBackground

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      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.
      android.graphics.Path getPath()  
      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 Detail

      • PromptBackground

        public PromptBackground()
    • Method Detail

      • 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.
      • getPath

        public android.graphics.Path getPath()
        Returns:
        The path of the current background, useful for clipping content
      • update

        public abstract 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

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

        public abstract 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.