Skip to content

Commit

Permalink
Merge pull request #85 from iavian/master
Browse files Browse the repository at this point in the history
Set icon image for native app install ads.
  • Loading branch information
ericleich committed Aug 14, 2017
2 parents f0c5c6d + 765009d commit df444f6
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -128,6 +128,14 @@ public void onVideoEnd() {
((TextView) adView.getBodyView()).setText(nativeAppInstallAd.getBody());
((Button) adView.getCallToActionView()).setText(nativeAppInstallAd.getCallToAction());

NativeAd.Image logoImage = nativeAppInstallAd.getIcon();
if (logoImage == null) {
adView.getIconView().setVisibility(View.INVISIBLE);
} else {
((ImageView) adView.getIconView()).setImageDrawable(logoImage.getDrawable());
adView.getIconView().setVisibility(View.VISIBLE);
}

// Apps can check the VideoController's hasVideoContent property to determine if the
// NativeAppInstallAd has a video asset.
if (vc.hasVideoContent()) {
Expand All @@ -147,7 +155,7 @@ public void onVideoEnd() {
adView.getPriceView().setVisibility(View.VISIBLE);
((TextView) adView.getPriceView()).setText(nativeAppInstallAd.getPrice());
}

if (nativeAppInstallAd.getStore() == null) {
adView.getStoreView().setVisibility(View.INVISIBLE);
} else {
Expand Down

0 comments on commit df444f6

Please sign in to comment.