Class MyTargetView.AdSize

java.lang.Object
com.my.target.ads.MyTargetView.AdSize
Enclosing class:
MyTargetView

public static final class MyTargetView.AdSize extends Object
Class for specify desired height and width of an ad. Used as adaptive or predefined sizes
  • Field Details

  • Method Details

    • getAdSizeForCurrentOrientation

      @NonNull public static MyTargetView.AdSize getAdSizeForCurrentOrientation(int width, int maxHeight, @NonNull android.content.Context context)
      Used to return adaptive ad size. Adaptive banner will be with fixed width. Height will be according ad proportion
      Parameters:
      width - fixed width of a banner
      maxHeight - maximum height of a banner
      context - app context
      Returns:
      adSize object
    • getAdSizeForCurrentOrientation

      @NonNull public static MyTargetView.AdSize getAdSizeForCurrentOrientation(int width, @NonNull android.content.Context context)
      Used to return adaptive ad size. Adaptive banner will be with fixed width. Height will be according ad proportion
      Parameters:
      width - fixed width of a banner
      context - app context
      Returns:
      adSize object
    • getAdSizeForCurrentOrientation

      @NonNull public static MyTargetView.AdSize getAdSizeForCurrentOrientation(@NonNull android.content.Context context)
      Used to return adaptive ad size. Adaptive banner will fill all available horizontal space Height will be according ad proportion
      Parameters:
      context - app context
      Returns:
      adSize object
    • getWidth

      public int getWidth()
      Returns:
      width of banner in dips
    • getHeight

      public int getHeight()
      Returns:
      height of banner in dips
    • getWidthPixels

      public int getWidthPixels()
      Returns:
      width of banner in pixels
    • getHeightPixels

      public int getHeightPixels()
      Returns:
      height of banner in pixels
    • getType

      public int getType()
      Returns:
      Type of banner. Possible values: BANNER_320x50, BANNER_300x250,BANNER_728x90,BANNER_ADAPTIVE