Class ImageData

  • All Implemented Interfaces:

    
    public final class ImageData
    
                        

    Data class for image content

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • clearCache

        @AnyThread() static void clearCache()

        Clears in-memory cache

      • getBitmap

        @Nullable() Bitmap getBitmap()

        Image bitmap, null if not loaded yet

        Returns:

        image bitmap

      • getData

        @Nullable() Bitmap getData()
      • isUseCache

         boolean isUseCache()

        Memory cache is disabled by default, bitmaps saves with strong link, but it is possible to turn in on with ImageData.useCache(boolean) method

        Returns:

        is image using memory cache or not

      • setBitmap

         void setBitmap(@Nullable() Bitmap bitmap)
      • setCacheSize

        @AnyThread() static void setCacheSize(int sizeInBytes)

        Maximum in-memory cache size for images. Minimum size is 5 MiB, values less will be ignored. Default cache size is 30 MiB

        Parameters:
        sizeInBytes - cache size in bytes
      • setData

         void setData(@Nullable() Bitmap data)
      • useCache

         void useCache(boolean use)

        By default, memory cache for images is disabled and bitmaps keeps by strong link. It is possible to turn on memory cache for image, regulated by system. Size of cache can be defined with ImageData.setCacheSize(int)

        Parameters:
        use - should this ImageData use memory cache or not