Package 

Class GifDrawableInit

    • Method Detail

      • build

         GifDrawable build()

        Appropriate constructor wrapper. Must be preceded by on of {@code from()} calls.

      • with

         T with(GifDrawable drawable)

        Sets drawable to be reused when creating new one.

        Parameters:
        drawable - drawable to be reused
      • threadPoolSize

         T threadPoolSize(int threadPoolSize)

        Sets thread pool size for rendering tasks.Warning: custom executor set by taskExecutor will be overwritten after setting pool size

        Parameters:
        threadPoolSize - size of the pool
      • taskExecutor

         T taskExecutor(ScheduledThreadPoolExecutor executor)

        Sets or resets executor for rendering tasks.Warning: value set by threadPoolSize will not be taken into account after setting executor

        Parameters:
        executor - executor to be used or null for default (each drawable instance has its own executor)
      • renderingTriggeredOnDraw

         T renderingTriggeredOnDraw(boolean isRenderingTriggeredOnDraw)

        Sets whether rendering of the next frame is scheduled after drawing current one (so animationwill be paused if drawing does not happen) or just after rendering frame (no matter if it isdrawn or not). However animation will never run if drawable is set to not visible. See isVisible for more information about drawable visibility.By default this option is enabled. Note that drawing does not happen if view containingdrawable is obscured. Disabling this option will prevent that however battery draining will behigher.

        Parameters:
        isRenderingTriggeredOnDraw - whether rendering of the next frame is scheduled after drawing (default)current one or just after it is rendered
      • setRenderingTriggeredOnDraw

         T setRenderingTriggeredOnDraw(boolean isRenderingTriggeredOnDraw)

        Equivalent to renderingTriggeredOnDraw. This method does not follow naming conventionand is preserved for backwards compatibility only.

        Parameters:
        isRenderingTriggeredOnDraw - whether rendering of the next frame is scheduled after drawing (default)current one or just after it is rendered
      • options

        @Beta() T options(@Nullable() GifOptions options)

        Indicates whether the content of this source is opaque. GIF that is known to be opaque cantake a faster drawing case than non-opaque one. See setOpaque for more information.Currently it is used only by GifTextureView, not by GifDrawable.

        Note that this call will overwrite sample size set previously by sampleSize

        Parameters:
        options - null-ok; options controlling parameters like subsampling and opacity
      • from

         T from(Resources resources, int resourceId)

        Wrapper of GifDrawable

        Parameters:
        resources - Resources to read from
        resourceId - resource id (data source)