Package com.yandex.mobile.ads.banner
Class AdSize
- java.lang.Object
-
- com.yandex.mobile.ads.banner.BaseAdSize
-
- com.yandex.mobile.ads.banner.AdSize
-
- All Implemented Interfaces:
java.io.Serializable
public final class AdSize extends com.yandex.mobile.ads.banner.BaseAdSizeThe size of a banner ad.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static AdSizeBANNER_240x400Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.static AdSizeBANNER_300x250Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.static AdSizeBANNER_300x300Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.static AdSizeBANNER_320x100Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.static AdSizeBANNER_320x50Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.static AdSizeBANNER_400x240Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.static AdSizeBANNER_728x90Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.static AdSizeFULL_SCREENFull screen ad size.
-
Constructor Summary
Constructors Constructor Description AdSize(int width, int height)Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static AdSizeflexibleSize(int width, int height)Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content.intgetHeight()Returns the height of thisAdSizein density-independent pixels (dp).intgetHeight(android.content.Context context)Returns the actual height of thisAdSizein density-independent pixels (dp).intgetHeightInPixels(android.content.Context context)Returns the actual height of thisAdSizein physical pixels.intgetWidth()Returns the width of thisAdSizein density-independent pixels (dp).intgetWidth(android.content.Context context)Returns the actual width of thisAdSizein density-independent pixels (dp).intgetWidthInPixels(android.content.Context context)Returns the actual width of thisAdSizein physical pixels.static AdSizeinlineSize(int width, int maxHeight)Returns inline adaptive banner size.static AdSizestickySize(int width)Deprecated.static AdSizestickySize(android.content.Context context, int width)Returns sticky banner size with the given width.
-
-
-
Field Detail
-
BANNER_240x400
@Deprecated public static final AdSize BANNER_240x400
Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseBanner ad size (240x400density-independent pixels).
-
BANNER_300x250
@Deprecated public static final AdSize BANNER_300x250
Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseBanner ad size (300x250density-independent pixels).
-
BANNER_300x300
@Deprecated public static final AdSize BANNER_300x300
Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseBanner ad size (300x300density-independent pixels).
-
BANNER_320x50
@Deprecated public static final AdSize BANNER_320x50
Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseBanner ad size (320x50density-independent pixels).
-
BANNER_320x100
@Deprecated public static final AdSize BANNER_320x100
Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseBanner ad size (320x100density-independent pixels).
-
BANNER_400x240
@Deprecated public static final AdSize BANNER_400x240
Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseBanner ad size (400x240density-independent pixels).
-
BANNER_728x90
@Deprecated public static final AdSize BANNER_728x90
Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseBanner ad size (728x90density-independent pixels).
-
FULL_SCREEN
public static final AdSize FULL_SCREEN
Full screen ad size.
-
-
Constructor Detail
-
AdSize
@Deprecated public AdSize(int width, int height)Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseCreate a new fixedAdSize.- Parameters:
width- The width of the ad in density-independent pixels (dp).height- The height of the ad in density-independent pixels (dp).
-
-
Method Detail
-
flexibleSize
@Deprecated @NonNull public static AdSize flexibleSize(int width, int height)
Deprecated.UsestickySize(Context, int)for small automatically updated banner attached to the the top or bottom of the screen, or useinlineSize(int, int)for adaptive banner placed in scrolling content. Fixed AdSize API will be removed in the directly following major SDK releaseReturns flexible banner size. Banners with flexible sizes stretch to container width and height when possible.- Parameters:
width- The width of the ad container in density-independent pixels (dp).height- The height of the ad container in density-independent pixels (dp).- Returns:
- Flexible banner size.
-
stickySize
@NonNull public static AdSize stickySize(int width)
Deprecated.Returns sticky banner size with the given width.- Parameters:
width- The width of the ad container in density-independent pixels (dp).- Returns:
- Sticky banner AdSize.
-
stickySize
@NonNull public static AdSize stickySize(@NonNull android.content.Context context, int width)
Returns sticky banner size with the given width.- Parameters:
context- TheContext.width- The width of the ad container in density-independent pixels (dp).- Returns:
- Sticky banner AdSize.
-
inlineSize
@NonNull public static AdSize inlineSize(int width, int maxHeight)
Returns inline adaptive banner size. Banners with inline sizes stretch to container width and height when possible.- Parameters:
width- The width of the ad container in density-independent pixels (dp).maxHeight- The maximum height of the ad container in density-independent pixels (dp).- Returns:
- Inline banner size.
-
getHeight
public int getHeight()
Returns the height of thisAdSizein density-independent pixels (dp).- Overrides:
getHeightin classcom.yandex.mobile.ads.banner.BaseAdSize- Returns:
- Height in density-independent pixels (dp).
-
getHeightInPixels
public int getHeightInPixels(@NonNull android.content.Context context)Returns the actual height of thisAdSizein physical pixels. AdSize created with FULL_HEIGHT will return height of the screen.- Overrides:
getHeightInPixelsin classcom.yandex.mobile.ads.banner.BaseAdSize- Parameters:
context- AnyContext.- Returns:
- Height in physical pixels.
-
getWidth
public int getWidth()
Returns the width of thisAdSizein density-independent pixels (dp).- Overrides:
getWidthin classcom.yandex.mobile.ads.banner.BaseAdSize- Returns:
- Width in density-independent pixels (dp).
-
getWidthInPixels
public int getWidthInPixels(@NonNull android.content.Context context)Returns the actual width of thisAdSizein physical pixels. AdSize created with FULL_WIDTH will return width of the screen.- Overrides:
getWidthInPixelsin classcom.yandex.mobile.ads.banner.BaseAdSize- Parameters:
context- AnyContext.- Returns:
- Width in physical pixels.
-
getHeight
public int getHeight(@NonNull android.content.Context context)Returns the actual height of thisAdSizein density-independent pixels (dp). AdSize created with FULL_HEIGHT will return height of the screen.- Overrides:
getHeightin classcom.yandex.mobile.ads.banner.BaseAdSize- Parameters:
context- AnyContext.- Returns:
- Weight in density-independent pixels (dp).
-
getWidth
public int getWidth(@NonNull android.content.Context context)Returns the actual width of thisAdSizein density-independent pixels (dp). AdSize created with FULL_WIDTH will return width of the screen.- Overrides:
getWidthin classcom.yandex.mobile.ads.banner.BaseAdSize- Parameters:
context- AnyContext.- Returns:
- Width in density-independent pixels (dp).
-
-