Package com.my.target.ads
Class MyTargetView.AdSize
java.lang.Object
com.my.target.ads.MyTargetView.AdSize
- Enclosing class:
- MyTargetView
Class for specify desired height and width of an ad. Used as adaptive or predefined sizes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MyTargetView.AdSizestatic final MyTargetView.AdSizestatic final MyTargetView.AdSizestatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.intintintgetType()intgetWidth()int
-
Field Details
-
BANNER_320x50
public static final int BANNER_320x50- See Also:
-
BANNER_300x250
public static final int BANNER_300x250- See Also:
-
BANNER_728x90
public static final int BANNER_728x90- See Also:
-
BANNER_ADAPTIVE
public static final int BANNER_ADAPTIVE- See Also:
-
ADSIZE_320x50
-
ADSIZE_300x250
-
ADSIZE_728x90
-
-
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 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
-