Class MyTargetView.AdSize

  • All Implemented Interfaces:

    
    public final class MyTargetView.AdSize
    
                        

    Class for specify desired height and width of an ad. Used as adaptive or predefined sizes

    • Constructor Detail

    • Method Detail

      • getAdSizeForCurrentOrientation

        @NonNull() static MyTargetView.AdSize getAdSizeForCurrentOrientation(@NonNull() 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

      • getAdSizeForCurrentOrientation

        @NonNull() static MyTargetView.AdSize getAdSizeForCurrentOrientation(int width, @NonNull() 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() static MyTargetView.AdSize getAdSizeForCurrentOrientation(int width, int maxHeight, @NonNull() 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

      • getHeight

         int getHeight()
        Returns:

        height of banner in dips

      • getHeightPixels

         int getHeightPixels()
        Returns:

        height of banner in pixels

      • getWidth

         int getWidth()
        Returns:

        width of banner in dips

      • getWidthPixels

         int getWidthPixels()
        Returns:

        width of banner in pixels