java.lang.Object | |
↳ | com.google.android.gms.ads.AdSize |
The size of a banner ad.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | AUTO_HEIGHT | Constant that will cause the height of the ad to scale based on the height of the device in the current orientation. | |||||||||
int | FULL_WIDTH | Constant that will cause the width of the ad to match the width of the device in the current orientation. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BANNER | Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels). | ||||||||||
FLUID | A dynamically sized banner that matches its parent's width and expands/contracts its height to match the ad's content after loading completes. | ||||||||||
FULL_BANNER | Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels). | ||||||||||
LARGE_BANNER | Large banner ad size (320x100 density-independent pixels). | ||||||||||
LEADERBOARD | Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels). | ||||||||||
MEDIUM_RECTANGLE | Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels). | ||||||||||
SEARCH | A special variant of FLUID to be set on SearchAdView
when loading a DynamicHeightSearchAdRequest . |
||||||||||
SMART_BANNER | A dynamically sized banner that is full-width and auto-height. | ||||||||||
WIDE_SKYSCRAPER | IAB wide skyscraper ad size (160x600 density-independent pixels). |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new
AdSize . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compares this
AdSize with the specified object and indicates if they are equal. | |||||||||||
Returns the height of this
AdSize in density-independent pixels. | |||||||||||
Returns the height of this
AdSize in physical pixels. | |||||||||||
Returns the width of this
AdSize in density-independent pixels. | |||||||||||
Returns the width of this
AdSize in physical pixels. | |||||||||||
Returns whether this
AdSize is auto-height. | |||||||||||
Returns whether this
AdSize is of fluid size or not. | |||||||||||
Returns whether this
AdSize is full-width. | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constant that will cause the height of the ad to scale based on the height of the device in the
current orientation. An AUTO_HEIGHT
ad determines its height during initialization of
the AdView
and never changes after that.
Constant that will cause the width of the ad to match the width of the device in the current
orientation. A FULL_WIDTH
ad determines its width during initialization of the AdView
and never changes after that.
Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels).
A dynamically sized banner that matches its parent's width and expands/contracts its height to match the ad's content after loading completes.
Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).
Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).
Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).
A special variant of FLUID to be set on SearchAdView
when loading a DynamicHeightSearchAdRequest
.
A dynamically sized banner that is full-width and auto-height.
IAB wide skyscraper ad size (160x600 density-independent pixels). This size is currently not supported by the Google Mobile Ads network; this is intended for mediation ad networks only.
Create a new AdSize
.
Parameters | |
---|---|
width |
int :
The width of the ad in density-independent pixels. |
height |
int :
The height of the ad in density-independent pixels. |
Throws | |
---|---|
IllegalArgumentException |
If the width or height is negative. |
Compares this AdSize
with the specified object and indicates if they are equal.
Parameters | |
---|---|
other |
Object
|
Returns | |
---|---|
boolean |
Returns the height of this AdSize
in density-independent pixels.
Returns | |
---|---|
int |
Returns the height of this AdSize
in physical pixels. For fluid size, it returns -1.
Parameters | |
---|---|
context |
Context
|
Returns | |
---|---|
int |
Returns the width of this AdSize
in physical pixels. For fluid size, it returns -1.
Parameters | |
---|---|
context |
Context
|
Returns | |
---|---|
int |
Returns | |
---|---|
int |
Returns | |
---|---|
String |