Package 

Class AnimatedDrawableUtil

    • Method Summary

      Modifier and Type Method Description
      void fixFrameDurations(Array<int> frameDurationMs) Adjusts the frame duration array to respect logic for minimum frame duration time.
      int getTotalDurationFromFrameDurations(Array<int> frameDurationMs) Gets the total duration of an image by summing up the duration of the frames.
      Array<int> getFrameTimeStampsFromDurations(Array<int> frameDurationsMs) Given an array of frame durations, generate an array of timestamps corresponding to when eachframe beings.
      int getFrameForTimestampMs(Array<int> frameTimestampsMs, int timestampMs) Gets the frame index for specified timestamp.
      int getSizeOfBitmap(Bitmap bitmap)
      static boolean isOutsideRange(int startFrame, int endFrame, int frameNumber) Checks whether the specified frame number is outside the range inclusive of both start and end.If start <= end, start is within, end is within, and everything in between is within.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fixFrameDurations

         void fixFrameDurations(Array<int> frameDurationMs)

        Adjusts the frame duration array to respect logic for minimum frame duration time.

        Parameters:
        frameDurationMs - the frame duration array
      • getTotalDurationFromFrameDurations

         int getTotalDurationFromFrameDurations(Array<int> frameDurationMs)

        Gets the total duration of an image by summing up the duration of the frames.

        Parameters:
        frameDurationMs - the frame duration array
      • getFrameTimeStampsFromDurations

         Array<int> getFrameTimeStampsFromDurations(Array<int> frameDurationsMs)

        Given an array of frame durations, generate an array of timestamps corresponding to when eachframe beings.

        Parameters:
        frameDurationsMs - an array of frame durations
      • getFrameForTimestampMs

         int getFrameForTimestampMs(Array<int> frameTimestampsMs, int timestampMs)

        Gets the frame index for specified timestamp.

        Parameters:
        frameTimestampsMs - an array of timestamps generated by )
        timestampMs - the timestamp
      • isOutsideRange

         static boolean isOutsideRange(int startFrame, int endFrame, int frameNumber)

        Checks whether the specified frame number is outside the range inclusive of both start and end.If start <= end, start is within, end is within, and everything in between is within. If start> end, start is within, end is within, everything less than start is within and everythinggreater than end is within. This behavior is useful for handling the wrapping case.

        Parameters:
        startFrame - the start frame
        endFrame - the end frame
        frameNumber - the frame number