Package com.my.target.ads
Class MyTargetView.AdSize
- java.lang.Object
-
- com.my.target.ads.MyTargetView.AdSize
-
- Enclosing class:
- MyTargetView
public static final class MyTargetView.AdSize extends java.lang.ObjectClass for specify desired height and width of an ad. Used as adaptive or predefined sizes
-
-
Field Summary
Fields Modifier and Type Field Description static MyTargetView.AdSizeADSIZE_300x250static MyTargetView.AdSizeADSIZE_320x50static MyTargetView.AdSizeADSIZE_728x90static intBANNER_300x250static intBANNER_320x50static intBANNER_728x90static intBANNER_ADAPTIVE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MyTargetView.AdSizegetAdSizeForCurrentOrientation(int width, int maxHeight, android.content.Context context)Used to return adaptive ad size.static MyTargetView.AdSizegetAdSizeForCurrentOrientation(int width, android.content.Context context)Used to return adaptive ad size.static MyTargetView.AdSizegetAdSizeForCurrentOrientation(android.content.Context context)Used to return adaptive ad size.intgetHeight()intgetHeightPixels()intgetType()intgetWidth()intgetWidthPixels()
-
-
-
Field Detail
-
BANNER_320x50
public static final int BANNER_320x50
- See Also:
- Constant Field Values
-
BANNER_300x250
public static final int BANNER_300x250
- See Also:
- Constant Field Values
-
BANNER_728x90
public static final int BANNER_728x90
- See Also:
- Constant Field Values
-
BANNER_ADAPTIVE
public static final int BANNER_ADAPTIVE
- See Also:
- Constant Field Values
-
ADSIZE_320x50
public static final MyTargetView.AdSize ADSIZE_320x50
-
ADSIZE_300x250
public static final MyTargetView.AdSize ADSIZE_300x250
-
ADSIZE_728x90
public static final MyTargetView.AdSize ADSIZE_728x90
-
-
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 bannermaxHeight- maximum height of a bannercontext- 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 bannercontext- 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
-
-