Class StaticCompanionLoader

  • All Implemented Interfaces:

    
    public final class StaticCompanionLoader
    extends CompanionLoader
                        

    A loader implementation for static companion ads.

    This class is responsible for loading and displaying static image companion ads. It handles image loading, memory management, and cleanup of resources.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      View inflate(Resource resource) Inflates a static companion ad view and loads the image content.
      Unit destroy() Cleans up resources by canceling any pending image loads.
      final Bitmap.Config getImageBitMapConfig() Determines the appropriate bitmap configuration based on device memory state.
      • Methods inherited from class java.lang.Object

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

      • StaticCompanionLoader

        StaticCompanionLoader(Context context, InMobiLogger logger)
        Parameters:
        context - The application context.
        logger - An optional logger for debugging and error reporting.
    • Method Detail

      • inflate

         View inflate(Resource resource)

        Inflates a static companion ad view and loads the image content.

        Parameters:
        resource - The Resource containing the companion ad content.
        Returns:

        A View containing the loaded companion ad.

      • destroy

         Unit destroy()

        Cleans up resources by canceling any pending image loads.

      • getImageBitMapConfig

         final Bitmap.Config getImageBitMapConfig()

        Determines the appropriate bitmap configuration based on device memory state. Uses RGB_565 for low memory devices and ARGB_8888 for devices with sufficient memory.

        Returns:

        The appropriate Bitmap.Config for the current device state.