Untitled
Never
private void LoadNativeAds(final ViewGroup adContainer) { final ShimmerLayout shrimmerView = (ShimmerLayout) LayoutInflater.from(GameApplication.this).inflate(R.layout.msc_native_ad_view, null, false); adContainer.removeAllViews(); adContainer.addView(shrimmerView); shrimmerView.startShimmerAnimation(); com.google.android.gms.ads.AdLoader adLoader = new com.google.android.gms.ads.AdLoader.Builder(this.getApplicationContext(), "ca-app-pub-3940256099942544/2247696110") .forUnifiedNativeAd(new UnifiedNativeAd.OnUnifiedNativeAdLoadedListener() { @Override public void onUnifiedNativeAdLoaded(UnifiedNativeAd unifiedNativeAd) { // Show the ad. TextView labelTitle = shrimmerView.findViewById(R.id.native_ad_title_view); labelTitle.setText(unifiedNativeAd.getHeadline()); } }) .withAdListener(new AdListener() { @Override public void onAdFailedToLoad(int errorCode) { // Handle the failure by logging, altering the UI, and so on. Log.d(TAG, "Native ad load fail with code: "+errorCode); } }) .withNativeAdOptions(new NativeAdOptions.Builder() // Methods in the NativeAdOptions.Builder class can be // used here to specify individual options settings. .build()) .build(); } private void displayUnifiedNativeAd(ViewGroup parent, UnifiedNativeAd ad) { // Inflate a layout and add it to the parent ViewGroup. LayoutInflater inflater = (LayoutInflater) parent.getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); UnifiedNativeAdView adView = (UnifiedNativeAdView) inflater .inflate(R.layout.my_ad_layout, parent); // Locate the view that will hold the headline, set its text, and call the // UnifiedNativeAdView's setHeadlineView method to register it. TextView headlineView = adView.findViewById<TextView>(R.id.ad_headline); headlineView.setText(ad.getHeadline()); adView.setHeadlineView(headlineView); ... // Repeat the above process for the other assets in the UnifiedNativeAd // using additional view objects (Buttons, ImageViews, etc). ... // If the app is using a MediaView, it should be // instantiated and passed to setMediaView. This view is a little different // in that the asset is populated automatically, so there's one less step. MediaView mediaView = (MediaView) adView.findViewById(R.id.ad_media); adView.setMediaView(mediaView); // Call the UnifiedNativeAdView's setNativeAd method to register the // NativeAdObject. adView.setNativeAd(ad); // Ensure that the parent view doesn't already contain an ad view. parent.removeAllViews(); // Place the AdView into the parent. parent.addView(adView); }
Raw Text
-
No Deposit Bonus
2 min ago
-
Johnny America Standing On Business!
10 min ago
-
Javy Coffee Reviews
11 min ago
-
Easy Outstation Cab Booking | Reliable Taxis Across India
38 min ago
-
Take my Virginity and I Let You CUM between my TITS - Innocent Step Sister Fucks For The First Time
47 min ago
-
Untitled
55 min ago
-
https://www.macombdaily.com/2024/03/27/the-growth-matrix-reviews-2024-legit-growth-matrix-or-hidden-
1 hour ago
-
The Power of Valves - Engineering Excellence Unleashed
1 hour ago
-
SHENHE 申鶴的特殊治療
1 hour ago
-
https://www.macombdaily.com/2024/03/27/the-growth-matrix-reviews-2024-legit-growth-matrix-or-hidden-
1 hour ago