Android SDK Version
  • java.lang.Object
    • com.facebook.ads.AdSize
All Implemented Interfaces:
java.io.Serializable

public class AdSize
extends java.lang.Object
implements java.io.Serializable
AdSize is the dimension of the ad control. All units are in density-independent pixel (dp).
Since:
4.6
See Also:
Field Summary
Modifier and TypeField and Description
static AdSizeBANNER_320_50
Deprecated. 
static AdSizeBANNER_HEIGHT_50
Represents a flexible banner ad size, where banner width depends on its container width, and banner height is fixed as 50dp.
static AdSizeBANNER_HEIGHT_90
Represents a flexible banner ad size, where banner width depends on its container width, and banner height is fixed as 90dp.
static AdSizeINTERSTITIAL
A full screen interstitial size.
static AdSizeRECTANGLE_HEIGHT_250
Represents a flexible rectangle ad size, where width depends on its container width, and height is fixed as 250dp.
Constructor Summary
Constructor and Description
AdSize(int width, int height) 
Method Summary
Modifier and TypeMethod and Description
booleanequals(java.lang.Object o) 
static AdSizefromWidthAndHeight(int width, int height) 
intgetHeight()
Gets the height of the ad control.
intgetWidth()
Gets the width of the ad control.
inthashCode() 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Field Detail

BANNER_320_50

@Deprecated
public static final AdSize BANNER_320_50
Deprecated. 
A banner size of 320 x 50 dp.

INTERSTITIAL

public static final AdSize INTERSTITIAL
A full screen interstitial size.

BANNER_HEIGHT_50

public static final AdSize BANNER_HEIGHT_50
Represents a flexible banner ad size, where banner width depends on its container width, and banner height is fixed as 50dp.

BANNER_HEIGHT_90

public static final AdSize BANNER_HEIGHT_90
Represents a flexible banner ad size, where banner width depends on its container width, and banner height is fixed as 90dp.

RECTANGLE_HEIGHT_250

public static final AdSize RECTANGLE_HEIGHT_250
Represents a flexible rectangle ad size, where width depends on its container width, and height is fixed as 250dp.
Constructor Detail

AdSize

public AdSize(int width,
              int height)
Since:
4.6
Method Detail

getWidth

public int getWidth()
Gets the width of the ad control.
Returns:
width of the ad control in DP
Since:
4.6

getHeight

public int getHeight()
Gets the height of the ad control.
Returns:
height of the ad control in DP
Since:
4.6

fromWidthAndHeight

public static AdSize fromWidthAndHeight(int width,
                                        int height)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object