Package 

Class AnimatedDrawableBackendImpl

    • Method Detail

      • getDurationMs

         int getDurationMs()

        Gets the duration of the animation.

      • getFrameCount

         int getFrameCount()

        Gets the number of frames in the animation.

      • getLoopCount

         int getLoopCount()

        Gets the number of loops to run the animation for.

      • getWidth

         int getWidth()

        Gets the width of the image.

      • getHeight

         int getHeight()

        Gets the height of the image.

      • getRenderedWidth

         int getRenderedWidth()

        Gets the rendered width of the image. This may be smaller than the underlying image width ifthe image is being rendered to a small bounds or to reduce memory requirements.

      • getRenderedHeight

         int getRenderedHeight()

        Gets the rendered height of the image. This may be smaller than the underlying image height ifthe image is being rendered to a small bounds or to reduce memory requirements.

      • getFrameForTimestampMs

         int getFrameForTimestampMs(int timestampMs)

        Gets the frame index for specified timestamp.

        Parameters:
        timestampMs - the timestamp
      • getTimestampMsForFrame

         int getTimestampMsForFrame(int frameNumber)

        Gets the timestamp relative to the first frame that this frame number starts at.

        Parameters:
        frameNumber - the frame number
      • getDurationMsForFrame

         int getDurationMsForFrame(int frameNumber)

        Gets the duration of the specified frame.

        Parameters:
        frameNumber - the frame number
      • getFrameForPreview

         int getFrameForPreview()

        Gets the frame number to use for the preview frame.

      • getMemoryUsage

         synchronized int getMemoryUsage()

        Gets the number of bytes currently used by the backend for caching (for debugging)

      • getPreDecodedFrame

        @Nullable() CloseableReference<Bitmap> getPreDecodedFrame(int frameNumber)

        Gets a pre-decoded frame. This will only return non-null if the {@code ImageDecodeOptions} wereconfigured to decode all frames at decode time.

        Parameters:
        frameNumber - the index of the frame to get
      • hasPreDecodedFrame

         boolean hasPreDecodedFrame(int index)

        Gets whether it has the decoded frame. This will only return true if the {@code * ImageDecodeOptions} were configured to decode all frames at decode time.

      • renderFrame

         void renderFrame(int frameNumber, Canvas canvas)

        Renders the specified frame onto the canvas.

        Parameters:
        frameNumber - the frame number (0-based)
        canvas - the canvas to render onto
      • renderDeltas

         void renderDeltas(int frameNumber, Canvas canvas)

        Renders the specified frame onto the canvas. The idea is the same than renderFrame(...) withthis differences: 1) Creates a new bitmap on each call. This allows to not block threads. 2)Blend is applied here

        Parameters:
        frameNumber - the frame number (0-based)
        canvas - the canvas to render onto
      • dropCaches

         synchronized void dropCaches()

        Instructs the backend to drop its caches.