Class MyTargetView.AdSize

  • Enclosing class:
    MyTargetView

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

      • 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