ThirdPartyAdapters/vungle/vungle/src/main/java/com/vungle/mediation/VungleInterstitialAdapter.java
/**
   * Find the closest supported AdSize from the list of potentials to the provided size. Returns
   * null if none are within given threshold size range.
   */
Find the closest supported AdSize from the list of potentials to the provided size. Returns
null if none are within given threshold size range.
Find the closest supported AdSize from the list of potentials to the provided size . Returns null if none are within given threshold size range .
private AdConfig.AdSize findClosestSize(
      Context context, AdSize original, ArrayList<AdConfig.AdSize> potentials) {
    if (potentials == null || original == null) {
      return null;
    }
    float density = context.getResources().getDisplayMetrics().density;
    int actualWidth = Math.round(original.getWidthInPixels(context) / density);
    int actualHeight = Math.round(original.getHeightInPixels(context) / density);
    original = new AdSize(actualWidth, actualHeight);
    AdConfig.AdSize largestPotential = null;
    for (AdConfig.AdSize potential : potentials) {
      if (isSizeInRange(original, potential)) {
        if (largestPotential == null) {
          largestPotential = potential;
        } else {
          largestPotential = getLargerByArea(largestPotential, potential);
        }
      }
    }
    return largestPotential;
  }
private AdConfig . AdSize findClosestSize ( Context context , AdSize original , ArrayList < AdConfig . AdSize > potentials ) { if ( potentials == null || original == null ) { return null ; } float density = context . getResources ( ) . getDisplayMetrics ( ) . density ; int actualWidth = Math . round ( original . getWidthInPixels ( context ) / density ) ; int actualHeight = Math . round ( original . getHeightInPixels ( context ) / density ) ; original = new AdSize ( actualWidth , actualHeight ) ; AdConfig . AdSize largestPotential = null ; for ( AdConfig . AdSize potential : potentials ) { if ( isSizeInRange ( original , potential ) ) { if ( largestPotential == null ) { largestPotential = potential ; } else { largestPotential = getLargerByArea ( largestPotential , potential ) ; } } } return largestPotential ; }
Find the closest supported AdSize from the list of potentials to the provided size.
Find the closest supported AdSize from the list of potentials to the provided size .