# CEAdSize

CEAdSize defines three different ad size for the layout of ad.

| Public constructors                                                                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="#CEAdSize">CEAdSize(Context context, int width, int height)</a> <br> Create specific width and height size for the ad.</p> |

| Constants |                                                                                                                            |
| --------- | -------------------------------------------------------------------------------------------------------------------------- |
| int       | <p><a href="#FULL">FULL</a> <br> Constant that will cause the width/height of the ad to match the width of the device.</p> |
| int       | <p><a href="#AUTO">AUTO</a> <br> SDK determine the width/height of the ad. example: new CEAdSize(300, AUTO).</p>           |

| Public static methods |                                                                                                                                                              |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CEAdSize              | <p><a href="#getSmartAuto">getSmartAuto(Context context)</a> <br> Method that will match the height and width value of ad creative.</p>                      |
| CEAdSize              | <p><a href="#getSmartFullWidth">getSmartFullWidth(Context context)</a> <br> Method that will cause the width of the ad to match the width of the device.</p> |

| Public methods |                                                                                                          |
| -------------- | -------------------------------------------------------------------------------------------------------- |
| int            | <p><a href="#getHeight">getHeight()</a> <br> Returns the height of this CEAdSize in physical pixels.</p> |
| int            | <p><a href="#getHeight">getWidth()</a> <br> Returns the width of this CEAdSize in physical pixels.</p>   |

## Public constructors

### CEAdSize <a href="#ceadsize" id="ceadsize"></a>

CEAdSize(Context context, int width, int height)

Create specific width and height size for the ad.

| Parameters |                           |
| ---------- | ------------------------- |
| context    | Context: the context.     |
| width      | int: the specific width.  |
| height     | int: the specific height. |

## Constants

### FULL <a href="#full" id="full"></a>

int FULL

Constant that will cause the width/height of the ad to match the width of the device.

Constant Value: -1

### AUTO <a href="#auto" id="auto"></a>

int AUTO

SDK determine the width/height of the ad. example: new CEAdSize(context, 300, AUTO).

Constant Value: -2

## Public static methods

### getSmartAuto <a href="#getsmartauto" id="getsmartauto"></a>

CEAdSize getSmartAuto()

Gets the ad view. **You should call this method after onAdLoaded().**

| Parameters |                       |
| ---------- | --------------------- |
| context    | Context: the context. |

| Returns                                                                                                     |               |
| ----------------------------------------------------------------------------------------------------------- | ------------- |
| [CEAdSize](https://intowow.gitbook.io/crystalexpress-documentation-v3-x/android-sdk/api-reference/ceadsize) | the CEAdSize. |

### getSmartFullWidth <a href="#getsmartfullwidth" id="getsmartfullwidth"></a>

CEAdSize getSmartFullWidth()

Method that will cause the width of the ad to match the width of the device.

| Parameters |                       |
| ---------- | --------------------- |
| context    | Context: the context. |

| Returns                                                                                                     |               |
| ----------------------------------------------------------------------------------------------------------- | ------------- |
| [CEAdSize](https://intowow.gitbook.io/crystalexpress-documentation-v3-x/android-sdk/api-reference/ceadsize) | the CEAdSize. |

## Public methods

### getHeight <a href="#getheight" id="getheight"></a>

int getHeight()

Returns the height of this CEAdSize in physical pixels.

| Parameters |                       |
| ---------- | --------------------- |
| context    | Context: the context. |

| Returns |                  |
| ------- | ---------------- |
| int     | int: the height. |

### getWidth <a href="#getwidth" id="getwidth"></a>

int getWidth()

Returns the width of this CEAdSize in physical pixels.

| Parameters |                       |
| ---------- | --------------------- |
| context    | Context: the context. |

| Returns |                 |
| ------- | --------------- |
| int     | int: the width. |
