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
-
zdfgzgsd
6 min ago
-
Punk'd Parody - MYLF
10 min ago
-
Valdez vs. Wilson Live Streams Free
21 min ago
-
fdssd dsdf dfsdsf dfs dfsdfsfds
35 min ago
-
Adult Telegram Channels
41 min ago
-
No Deposit Bonus
42 min ago
-
Makers CBD Gummies Reviews
43 min ago
-
MOFOS - Amy Amor Tells Jordi El His Idea Of What She Should Do On Her First Blind Date
50 min ago
-
Untitled
1 hour ago
-
AllHerLuv - Videos
1 hour ago