MediationUtils

public class MediationUtils


Utility methods for mediation adapters.

Summary

Constants

static final double
static final double

Public constructors

Public methods

static @Nullable AdSize
findClosestSize(
    Context context,
    AdSize original,
    List<AdSize> potentials
)

Finds the closest supported AdSize from the list of potentials to the provided size.

Constants

MIN_HEIGHT_RATIO

protected static final double MIN_HEIGHT_RATIO = 0.7

MIN_WIDTH_RATIO

protected static final double MIN_WIDTH_RATIO = 0.5

Public constructors

MediationUtils

public MediationUtils()

Public methods

findClosestSize

public static @Nullable AdSize findClosestSize(
    Context context,
    AdSize original,
    List<AdSize> potentials
)

Finds the closest supported AdSize from the list of potentials to the provided size. Returns null if none are within given threshold size range.