-
- All Implemented Interfaces:
-
java.io.Serializable
public final class BannerAdSize implements Serializable
The size of a banner ad.
-
-
Method Summary
Modifier and Type Method Description static BannerAdSizefixedSize(@NonNull() Context context, int width, int height)Returns fixed banner size. static BannerAdSizestickySize(@NonNull() Context context, int width)Returns sticky banner size with the given width. static BannerAdSizeinlineSize(@NonNull() Context context, int width, int maxHeight)Returns inline adaptive banner size. intgetHeight()Returns the height of this BannerAdSize in density-independent pixels (dp). intgetHeightInPixels(@NonNull() Context context)Returns the actual height of this BannerAdSize in physical pixels. intgetWidth()Returns the width of this BannerAdSize in density-independent pixels (dp). intgetWidthInPixels(@NonNull() Context context)Returns the actual width of this BannerAdSize in physical pixels. intgetHeight(@NonNull() Context context)Returns the actual height of this BannerAdSize in density-independent pixels (dp). intgetWidth(@NonNull() Context context)Returns the actual width of this BannerAdSize in density-independent pixels (dp). booleanequals(Object o)inthashCode()StringtoString()-
-
Method Detail
-
fixedSize
@NonNull() static BannerAdSize fixedSize(@NonNull() Context context, int width, int height)
Returns fixed banner size.
- Parameters:
context- The Context.width- The width of the ad container in density-independent pixels (dp).height- The height of the ad container in density-independent pixels (dp).
-
stickySize
@NonNull() static BannerAdSize stickySize(@NonNull() Context context, int width)
Returns sticky banner size with the given width.
- Parameters:
context- The Context.width- The width of the ad container in density-independent pixels (dp).
-
inlineSize
@NonNull() static BannerAdSize inlineSize(@NonNull() Context context, 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).
-
getHeight
int getHeight()
Returns the height of this BannerAdSize in density-independent pixels (dp).
-
getHeightInPixels
int getHeightInPixels(@NonNull() Context context)
Returns the actual height of this BannerAdSize in physical pixels. AdSize created with FULL_HEIGHT will return height of the screen.
- Parameters:
context- Any android.content.Context.
-
getWidth
int getWidth()
Returns the width of this BannerAdSize in density-independent pixels (dp).
-
getWidthInPixels
int getWidthInPixels(@NonNull() Context context)
Returns the actual width of this BannerAdSize in physical pixels. AdSize created with FULL_WIDTH will return width of the screen.
- Parameters:
context- Any android.content.Context.
-
getHeight
int getHeight(@NonNull() Context context)
Returns the actual height of this BannerAdSize in density-independent pixels (dp). AdSize created with FULL_HEIGHT will return height of the screen.
- Parameters:
context- Any android.content.Context.
-
getWidth
int getWidth(@NonNull() Context context)
Returns the actual width of this BannerAdSize in density-independent pixels (dp). AdSize created with FULL_WIDTH will return width of the screen.
- Parameters:
context- Any android.content.Context.
-
hashCode
int hashCode()
-
-
-
-