Package com.my.target.ads
Class MyTargetView.AdSize
-
- All Implemented Interfaces:
public final class MyTargetView.AdSizeClass for specify desired height and width of an ad. Used as adaptive or predefined sizes
-
-
Field Summary
Fields Modifier and Type Field Description public final static MyTargetView.AdSizeADSIZE_300x250public final static MyTargetView.AdSizeADSIZE_320x50public final static MyTargetView.AdSizeADSIZE_728x90public final static intBANNER_300x250public final static intBANNER_320x50public final static intBANNER_728x90public final static intBANNER_ADAPTIVE
-
Method Summary
Modifier and Type Method Description static MyTargetView.AdSizegetAdSizeForCurrentOrientation(@NonNull() Context context)Used to return adaptive ad size. static MyTargetView.AdSizegetAdSizeForCurrentOrientation(int width, @NonNull() Context context)Used to return adaptive ad size. static MyTargetView.AdSizegetAdSizeForCurrentOrientation(int width, int maxHeight, @NonNull() Context context)Used to return adaptive ad size. intgetHeight()intgetHeightPixels()intgetType()intgetWidth()intgetWidthPixels()-
-
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 bannercontext- 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 bannermaxHeight- maximum height of a bannercontext- app context- Returns:
adSize object
-
getHeight
int getHeight()
- Returns:
height of banner in dips
-
getHeightPixels
int getHeightPixels()
- Returns:
height of banner in pixels
-
getType
int getType()
- Returns:
Type of banner. Possible values: AdSize.BANNER_320x50, AdSize.BANNER_300x250,AdSize.BANNER_728x90,AdSize.BANNER_ADAPTIVE
-
getWidth
int getWidth()
- Returns:
width of banner in dips
-
getWidthPixels
int getWidthPixels()
- Returns:
width of banner in pixels
-
-
-
-