use of com.google.android.gms.ads.NativeExpressAdView in project Tapad by berict.
the class AdmobHelper method resumeNativeAdView.
public void resumeNativeAdView(int id, Activity activity) {
NativeExpressAdView adView = window.getNativeAdView(id, activity);
if (adView != null) {
adView.resume();
Log.d(TAG, "ad resumed");
}
}
use of com.google.android.gms.ads.NativeExpressAdView in project Tapad by berict.
the class AdmobHelper method destroyNativeAdView.
public void destroyNativeAdView(int id, Activity activity) {
NativeExpressAdView adView = window.getNativeAdView(id, activity);
if (adView != null) {
adView.destroy();
Log.d(TAG, "ad destroyed");
}
}
use of com.google.android.gms.ads.NativeExpressAdView in project Tapad by berict.
the class AdmobHelper method pauseNativeAdView.
public void pauseNativeAdView(int id, Activity activity) {
NativeExpressAdView adView = window.getNativeAdView(id, activity);
if (adView != null) {
adView.pause();
Log.d(TAG, "ad paused");
}
}
use of com.google.android.gms.ads.NativeExpressAdView in project Tapad by berict.
the class AdmobHelper method setNativeAdViewSize.
public void setNativeAdViewSize(int id, AdSize adSize, Activity activity) {
NativeExpressAdView adView = window.getNativeAdView(id, activity);
adView.setAdSize(adSize);
}
use of com.google.android.gms.ads.NativeExpressAdView in project LibreraReader by foobnix.
the class ADS method activateAdmobNativeBanner.
public static void activateAdmobNativeBanner(final Activity a, NativeExpressAdView adViewNative) {
try {
final FrameLayout frame = (FrameLayout) a.findViewById(R.id.adFrame);
frame.removeAllViews();
frame.setVisibility(View.VISIBLE);
if (adViewNative != null) {
adViewNative.destroy();
adViewNative = null;
}
adViewNative = new NativeExpressAdView(a);
adViewNative.setAdUnitId(AppsConfig.ADMOB_NATIVE_BANNER);
int adSizeHeight = Dips.screenHeightDP() / 9;
LOG.d("adSizeHeight", adSizeHeight);
adViewNative.setAdSize(new AdSize(AdSize.FULL_WIDTH, Math.max(82, adSizeHeight)));
adViewNative.loadAd(ADS.adRequest);
adViewNative.setAdListener(new AdListener() {
@Override
public void onAdFailedToLoad(int arg0) {
frame.removeAllViews();
// frame.setVisibility(View.GONE);
}
});
frame.addView(adViewNative);
} catch (Exception e) {
LOG.e(e);
}
}
Aggregations