public final class AdSize
extends com.yandex.mobile.ads.banner.BaseAdSize
| Modifier and Type | Field and Description |
|---|---|
static AdSize |
BANNER_240x400
Banner ad size (240x400 density-independent pixels).
|
static AdSize |
BANNER_300x250
Banner ad size (300x250 density-independent pixels).
|
static AdSize |
BANNER_300x300
Banner ad size (300x300 density-independent pixels).
|
static AdSize |
BANNER_320x100
Banner ad size (320x100 density-independent pixels).
|
static AdSize |
BANNER_320x50
Banner ad size (320x50 density-independent pixels).
|
static AdSize |
BANNER_400x240
Banner ad size (400x240 density-independent pixels).
|
static AdSize |
BANNER_728x90
Banner ad size (728x90 density-independent pixels).
|
static int |
FULL_HEIGHT
The height of an ad to match the height of the device in the current orientation.
|
static AdSize |
FULL_SCREEN
Full screen ad size.
|
static int |
FULL_WIDTH
The width of an ad to match the width of the device in the current orientation.
|
| Constructor and Description |
|---|
AdSize(int width,
int height)
Create a new
AdSize. |
| Modifier and Type | Method and Description |
|---|---|
static AdSize |
flexibleSize()
Returns ad size suitable for any banner fitting screen.
|
static AdSize |
flexibleSize(int width)
Returns flexible banner size, with flexible width always fit maximum width passed as method argument.
|
static AdSize |
flexibleSize(int width,
int height)
Returns flexible banner size.
|
int |
getHeight()
Returns the height of this
AdSize in density-independent pixels (dp). |
int |
getHeight(android.content.Context context)
Returns the actual height of this
AdSize in density-independent pixels (dp). |
int |
getHeightInPixels(android.content.Context context)
Returns the actual height of this
AdSize in physical pixels. |
int |
getWidth()
Returns the width of this
AdSize in density-independent pixels (dp). |
int |
getWidth(android.content.Context context)
Returns the actual width of this
AdSize in density-independent pixels (dp). |
int |
getWidthInPixels(android.content.Context context)
Returns the actual width of this
AdSize in physical pixels. |
static AdSize |
stickySize(int width)
Returns sticky banner size with the given width.
|
public static final int FULL_HEIGHT
public static final int FULL_WIDTH
public static final AdSize BANNER_240x400
public static final AdSize BANNER_300x250
public static final AdSize BANNER_300x300
public static final AdSize BANNER_320x50
public static final AdSize BANNER_320x100
public static final AdSize BANNER_400x240
public static final AdSize BANNER_728x90
public static final AdSize FULL_SCREEN
public AdSize(int width,
int height)
AdSize.width - The width of the ad in density-independent pixels (dp).height - The height of the ad in density-independent pixels (dp).@NonNull public static AdSize flexibleSize()
@NonNull public static AdSize flexibleSize(int width)
width - The width of the ad container in density-independent pixels (dp).@NonNull public static AdSize flexibleSize(int width, int height)
width - The width of the ad container in density-independent pixels (dp).height - The height of the ad container in density-independent pixels (dp).@NonNull public static AdSize stickySize(int width)
width - The width of the ad container in density-independent pixels (dp).public int getHeight()
AdSize in density-independent pixels (dp).getHeight in class com.yandex.mobile.ads.banner.BaseAdSizepublic int getHeightInPixels(@NonNull
android.content.Context context)
AdSize in physical pixels.
AdSize created with FULL_HEIGHT will return height of the screen.getHeightInPixels in class com.yandex.mobile.ads.banner.BaseAdSizecontext - Any Context.public int getWidth()
AdSize in density-independent pixels (dp).getWidth in class com.yandex.mobile.ads.banner.BaseAdSizepublic int getWidthInPixels(@NonNull
android.content.Context context)
AdSize in physical pixels.
AdSize created with FULL_WIDTH will return width of the screen.getWidthInPixels in class com.yandex.mobile.ads.banner.BaseAdSizecontext - Any Context.public int getHeight(@NonNull
android.content.Context context)
AdSize in density-independent pixels (dp).
AdSize created with FULL_HEIGHT will return height of the screen.getHeight in class com.yandex.mobile.ads.banner.BaseAdSizecontext - Any Context.public int getWidth(@NonNull
android.content.Context context)
AdSize in density-independent pixels (dp).
AdSize created with FULL_WIDTH will return width of the screen.getWidth in class com.yandex.mobile.ads.banner.BaseAdSizecontext - Any Context.