Java Code Examples for com.google.android.gms.ads.AdSize#LARGE_BANNER

The following examples show how to use com.google.android.gms.ads.AdSize#LARGE_BANNER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RNPublisherBannerViewManager.java    From react-native-admob with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private AdSize getAdSizeFromString(String adSize) {
    switch (adSize) {
        case "banner":
            return AdSize.BANNER;
        case "largeBanner":
            return AdSize.LARGE_BANNER;
        case "mediumRectangle":
            return AdSize.MEDIUM_RECTANGLE;
        case "fullBanner":
            return AdSize.FULL_BANNER;
        case "leaderBoard":
            return AdSize.LEADERBOARD;
        case "smartBannerPortrait":
            return AdSize.SMART_BANNER;
        case "smartBannerLandscape":
            return AdSize.SMART_BANNER;
        case "smartBanner":
            return AdSize.SMART_BANNER;
        default:
            return AdSize.BANNER;
    }
}
 
Example 2
Source File: RNAdMobBannerViewManager.java    From react-native-admob with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private AdSize getAdSizeFromString(String adSize) {
    switch (adSize) {
        case "banner":
            return AdSize.BANNER;
        case "largeBanner":
            return AdSize.LARGE_BANNER;
        case "mediumRectangle":
            return AdSize.MEDIUM_RECTANGLE;
        case "fullBanner":
            return AdSize.FULL_BANNER;
        case "leaderBoard":
            return AdSize.LEADERBOARD;
        case "smartBannerPortrait":
            return AdSize.SMART_BANNER;
        case "smartBannerLandscape":
            return AdSize.SMART_BANNER;
        case "smartBanner":
            return AdSize.SMART_BANNER;
        default:
            return AdSize.BANNER;
    }
}
 
Example 3
Source File: AdMobPlugin.java    From cordova-admob-pro with MIT License 6 votes vote down vote up
/**
 * Gets an AdSize object from the string size passed in from JavaScript.
 * Returns null if an improper string is provided.
 *
 * @param size The string size representing an ad format constant.
 * @return An AdSize object used to create a banner.
 */
public static AdSize adSizeFromString(String size) {
  if ("BANNER".equals(size)) {
    return AdSize.BANNER;
  } else if ("SMART_BANNER".equals(size)) {
    return AdSize.SMART_BANNER;
  } else if ("MEDIUM_RECTANGLE".equals(size)) {
    return AdSize.MEDIUM_RECTANGLE;
  } else if ("FULL_BANNER".equals(size)) {
    return AdSize.FULL_BANNER;
  } else if ("LEADERBOARD".equals(size)) {
    return AdSize.LEADERBOARD;
  } else if ("SKYSCRAPER".equals(size)) {
    return AdSize.WIDE_SKYSCRAPER;
  } else if ("LARGE_BANNER".equals(size)) {
    return AdSize.LARGE_BANNER;
  } else {
    return null;
  }
}
 
Example 4
Source File: AdMobConfig.java    From cordova-plugin-admob-free with MIT License 5 votes vote down vote up
/**
 * Gets an AdSize object from the string size passed in from JavaScript.
 * Returns null if an improper string is provided.
 *
 * @param size The string size representing an ad format constant.
 * @return An AdSize object used to create a banner.
 */
private static AdSize adSizeFromString(String size) {
    if ("BANNER".equals(size)) {
        return AdSize.BANNER;
    } else if ("FULL_BANNER".equals(size)) {
        return AdSize.FULL_BANNER;
    } else if ("LARGE_BANNER".equals(size)) {
        return AdSize.LARGE_BANNER;
    } else if ("LEADERBOARD".equals(size)) {
        return AdSize.LEADERBOARD;
    } else if ("MEDIUM_RECTANGLE".equals(size)) {
        return AdSize.MEDIUM_RECTANGLE;
    } else if ("WIDE_SKYSCRAPER".equals(size)) {
        return AdSize.WIDE_SKYSCRAPER;
    } else if ("SMART_BANNER".equals(size)) {
        return AdSize.SMART_BANNER;
    } else if ("FLUID".equals(size)) {
        return AdSize.FLUID;
    } else if ("SEARCH".equals(size)) {
        return AdSize.SEARCH;
    } else if ("IAB_BANNER".equals(size)) {
        return AdSize.FULL_BANNER;
    } else if ("IAB_MRECT".equals(size)) {
        return AdSize.MEDIUM_RECTANGLE;
    } else if ("IAB_LEADERBOARD".equals(size)) {
        return AdSize.LEADERBOARD;
    }
    return null;
}
 
Example 5
Source File: AndroidAdMobBanner.java    From QtAndroidTools with MIT License 4 votes vote down vote up
public void setType(final int type)
{
    if(mBannerView == null)
    {
        return;
    }

    SyncRunOnUiThread UiThread = new SyncRunOnUiThread(mActivityInstance, new SyncRunOnUiThread.SyncRunOnUiThreadListener()
    {
        public void runOnUIThread()
        {
            AdSize BannerSize = AdSize.BANNER;

            switch(type)
            {
                case TYPE_BANNER:
                    BannerSize = AdSize.BANNER;
                    break;
                case TYPE_FULL_BANNER:
                    BannerSize = AdSize.FULL_BANNER;
                    break;
                case TYPE_LARGE_BANNER:
                    BannerSize = AdSize.LARGE_BANNER;
                    break;
                case TYPE_MEDIUM_RECTANGLE:
                    BannerSize = AdSize.MEDIUM_RECTANGLE;
                    break;
                case TYPE_SMART_BANNER:
                    BannerSize = AdSize.SMART_BANNER;
                    break;
                case TYPE_WIDE_SKYSCRAPER:
                    BannerSize = AdSize.WIDE_SKYSCRAPER;
                    break;
            }
            mBannerView.setAdSize(BannerSize);

            mBannerPixelsSize.width  = BannerSize.getWidthInPixels(mActivityInstance);
            mBannerPixelsSize.height = BannerSize.getHeightInPixels(mActivityInstance);
        }
    });
    UiThread.exec();
}