Back to Fresco

AnimatedDrawableUtil

docs/javadoc/reference/com/facebook/imagepipeline/animated/util/AnimatedDrawableUtil.html

3.6.013.7 KB
Original Source

Fresco

|

|

Packages | Classes

Classes

Packages | Classes

Summary: Ctors | Methods | Inherited Methods | [Expand All]

public class

AnimatedDrawableUtil

extends Object

| java.lang.Object | | ↳ | com.facebook.imagepipeline.animated.util.AnimatedDrawableUtil |

Class Overview

Utility methods for AnimatedDrawable.

Summary

Public Constructors
Public Methods
void
Adjusts the frame duration array to respect logic for minimum frame duration time.
int
Gets the frame index for specified timestamp.
int[]
Given an array of frame durations, generate an array of timestamps corresponding to when each frame beings.
int
int
Gets the total duration of an image by summing up the duration of the frames.
static boolean
Checks whether the specified frame number is outside the range inclusive of both start and end.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

Public Constructors

public AnimatedDrawableUtil()

Public Methods

public void fixFrameDurations(int[] frameDurationMs)

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

Parameters

| frameDurationMs | the frame duration array |

public int getFrameForTimestampMs(int[] frameTimestampsMs, int timestampMs)

Gets the frame index for specified timestamp.

Parameters

| frameTimestampsMs | an array of timestamps generated by `` | | timestampMs | the timestamp |

Returns
  • the frame index for the timestamp or the last frame number if the timestamp is outside the duration of the entire animation

public int[] getFrameTimeStampsFromDurations(int[] frameDurationsMs)

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

Parameters

| frameDurationsMs | an array of frame durations |

Returns
  • an array of timestamps

public int getSizeOfBitmap(Bitmap bitmap)

public int getTotalDurationFromFrameDurations(int[] frameDurationMs)

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

Parameters

| frameDurationMs | the frame duration array |

Returns
  • the total duration in milliseconds

public 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 everything greater 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 |

Returns
  • whether the frame is outside the range of [start, end]

+Generated by Doclava. +