GooglePlayServicesAdRenderer.smali
.class public Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;
.super Ljava/lang/Object;
.source "GooglePlayServicesAdRenderer.java"
# interfaces
.implements Lcom/tradplus/ads/nativeads/MoPubAdRenderer;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;",
"Lcom/tradplus/ads/nativeads/MoPubAdRenderer<",
"Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;",
">;"
}
.end annotation
# static fields
.field private static final ADAPTER_NAME:Ljava/lang/String; = "GooglePlayServicesAdRenderer"
.field private static final ID_GOOGLE_NATIVE_VIEW:I = 0x3ea
.field private static final ID_WRAPPING_FRAME:I = 0x3e9
.field public static final VIEW_BINDER_KEY_ADVERTISER:Ljava/lang/String; = "key_advertiser"
.field public static final VIEW_BINDER_KEY_AD_CHOICES_ICON_CONTAINER:Ljava/lang/String; = "ad_choices_container"
.field public static final VIEW_BINDER_KEY_PRICE:Ljava/lang/String; = "key_price"
.field public static final VIEW_BINDER_KEY_STAR_RATING:Ljava/lang/String; = "key_star_rating"
.field public static final VIEW_BINDER_KEY_STORE:Ljava/lang/String; = "key_store"
# instance fields
.field private final mViewBinder:Lcom/tradplus/ads/nativeads/MediaViewBinder;
.field private final mViewHolderMap:Ljava/util/WeakHashMap;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/WeakHashMap<",
"Landroid/view/View;",
"Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;",
">;"
}
.end annotation
.end field
# direct methods
.method static constructor <clinit>()V
.registers 0
return-void
.end method
.method public constructor <init>(Lcom/tradplus/ads/nativeads/MediaViewBinder;)V
.registers 2
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
iput-object p1, p0, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->mViewBinder:Lcom/tradplus/ads/nativeads/MediaViewBinder;
.line 3
new-instance p1, Ljava/util/WeakHashMap;
invoke-direct {p1}, Ljava/util/WeakHashMap;-><init>()V
iput-object p1, p0, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->mViewHolderMap:Ljava/util/WeakHashMap;
return-void
.end method
.method private insertGoogleUnifiedAdView(Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;Landroid/view/View;Z)V
.registers 11
.line 1
sget-object v0, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->ADAPTER_NAME:Ljava/lang/String;
invoke-static {v0}, Lcom/tradplus/ads/common/util/LogUtil;->show(Ljava/lang/String;)V
.line 2
instance-of v0, p2, Landroid/widget/FrameLayout;
if-eqz v0, :cond_4f
.line 3
invoke-virtual {p2}, Landroid/view/View;->getId()I
move-result v0
const/16 v1, 0x3e9
if-ne v0, v1, :cond_4f
const/16 v0, 0x3ea
.line 4
invoke-virtual {p1, v0}, Landroid/widget/FrameLayout;->setId(I)V
.line 5
check-cast p2, Landroid/widget/FrameLayout;
const/4 v0, 0x0
.line 6
invoke-virtual {p2, v0}, Landroid/widget/FrameLayout;->getChildAt(I)Landroid/view/View;
move-result-object v1
const/4 v2, -0x1
if-eqz p3, :cond_3d
.line 7
new-instance p3, Landroid/widget/FrameLayout$LayoutParams;
invoke-direct {p3, v2, v2}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V
.line 8
invoke-virtual {v1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
move-result-object v2
check-cast v2, Landroid/widget/FrameLayout$LayoutParams;
.line 9
iget v3, v2, Landroid/widget/FrameLayout$LayoutParams;->leftMargin:I
iget v4, v2, Landroid/widget/FrameLayout$LayoutParams;->topMargin:I
iget v5, v2, Landroid/widget/FrameLayout$LayoutParams;->rightMargin:I
iget v6, v2, Landroid/widget/FrameLayout$LayoutParams;->bottomMargin:I
invoke-virtual {p3, v3, v4, v5, v6}, Landroid/widget/FrameLayout$LayoutParams;->setMargins(IIII)V
.line 10
invoke-virtual {p1, p3}, Landroid/widget/FrameLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
.line 11
invoke-virtual {v2, v0, v0, v0, v0}, Landroid/widget/FrameLayout$LayoutParams;->setMargins(IIII)V
goto :goto_45
.line 12
:cond_3d
new-instance p3, Landroid/view/ViewGroup$LayoutParams;
invoke-direct {p3, v2, v2}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V
invoke-virtual {p1, p3}, Landroid/widget/FrameLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
.line 13
:goto_45
invoke-virtual {p2}, Landroid/widget/FrameLayout;->removeAllViews()V
.line 14
invoke-virtual {p1, v1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V
.line 15
invoke-virtual {p2, p1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V
goto :goto_56
.line 16
:cond_4f
sget-object p1, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->ADAPTER_NAME:Ljava/lang/String;
const-string p2, "Couldn\'t add Google native ad view. Wrapping view not found."
invoke-static {p1, p2}, Lcom/tradplus/ads/common/util/LogUtil;->show(Ljava/lang/String;Ljava/lang/String;)V
:goto_56
return-void
.end method
.method private updateUnifiedAdview(Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;)V
.registers 6
.line 1
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mTitleView:Landroid/widget/TextView;
.line 2
invoke-virtual {p1}, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;->getTitle()Ljava/lang/String;
move-result-object v1
.line 3
invoke-static {v0, v1}, Lcom/tradplus/ads/nativeads/NativeRendererHelper;->addTextView(Landroid/widget/TextView;Ljava/lang/String;)V
.line 4
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mTitleView:Landroid/widget/TextView;
invoke-virtual {p3, v0}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;->setHeadlineView(Landroid/view/View;)V
.line 5
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mTextView:Landroid/widget/TextView;
.line 6
invoke-virtual {p1}, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;->getText()Ljava/lang/String;
move-result-object v1
.line 7
invoke-static {v0, v1}, Lcom/tradplus/ads/nativeads/NativeRendererHelper;->addTextView(Landroid/widget/TextView;Ljava/lang/String;)V
.line 8
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mTextView:Landroid/widget/TextView;
invoke-virtual {p3, v0}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;->setBodyView(Landroid/view/View;)V
.line 9
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mMediaView:Lcom/tradplus/ads/nativeads/MediaLayout;
if-eqz v0, :cond_36
.line 10
new-instance v0, Lcom/google/android/gms/ads/formats/MediaView;
invoke-virtual {p3}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
move-result-object v1
invoke-direct {v0, v1}, Lcom/google/android/gms/ads/formats/MediaView;-><init>(Landroid/content/Context;)V
.line 11
iget-object v1, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mMediaView:Lcom/tradplus/ads/nativeads/MediaLayout;
invoke-virtual {v1}, Landroid/widget/RelativeLayout;->removeAllViews()V
.line 12
iget-object v1, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mMediaView:Lcom/tradplus/ads/nativeads/MediaLayout;
invoke-virtual {v1, v0}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;)V
.line 13
invoke-virtual {p3, v0}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;->setMediaView(Lcom/google/android/gms/ads/formats/MediaView;)V
.line 14
:cond_36
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mCallToActionView:Landroid/widget/TextView;
.line 15
invoke-virtual {p1}, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;->getCallToAction()Ljava/lang/String;
move-result-object v1
.line 16
invoke-static {v0, v1}, Lcom/tradplus/ads/nativeads/NativeRendererHelper;->addTextView(Landroid/widget/TextView;Ljava/lang/String;)V
.line 17
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mCallToActionView:Landroid/widget/TextView;
invoke-virtual {p3, v0}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;->setCallToActionView(Landroid/view/View;)V
.line 18
invoke-virtual {p1}, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;->getIconImageUrl()Ljava/lang/String;
move-result-object v0
iget-object v1, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mIconImageView:Landroid/widget/ImageView;
invoke-static {v0, v1}, Lcom/tradplus/ads/common/NativeImageHelper;->loadImageView(Ljava/lang/String;Landroid/widget/ImageView;)V
.line 19
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mIconImageView:Landroid/widget/ImageView;
invoke-virtual {p3, v0}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;->setImageView(Landroid/view/View;)V
.line 20
invoke-virtual {p1}, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;->getAdvertiser()Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_66
.line 21
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mAdvertiserTextView:Landroid/widget/TextView;
.line 22
invoke-virtual {p1}, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;->getAdvertiser()Ljava/lang/String;
move-result-object v1
.line 23
invoke-static {v0, v1}, Lcom/tradplus/ads/nativeads/NativeRendererHelper;->addTextView(Landroid/widget/TextView;Ljava/lang/String;)V
.line 24
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mAdvertiserTextView:Landroid/widget/TextView;
invoke-virtual {p3, v0}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;->setAdvertiserView(Landroid/view/View;)V
.line 25
:cond_66
iget-object v0, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mAdChoicesIconContainer:Landroid/widget/FrameLayout;
if-eqz v0, :cond_80
.line 26
new-instance v0, Lcom/google/android/gms/ads/formats/AdChoicesView;
invoke-virtual {p3}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
move-result-object v1
invoke-direct {v0, v1}, Lcom/google/android/gms/ads/formats/AdChoicesView;-><init>(Landroid/content/Context;)V
.line 27
iget-object v1, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mAdChoicesIconContainer:Landroid/widget/FrameLayout;
invoke-virtual {v1}, Landroid/widget/FrameLayout;->removeAllViews()V
.line 28
iget-object v1, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mAdChoicesIconContainer:Landroid/widget/FrameLayout;
invoke-virtual {v1, v0}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V
.line 29
invoke-virtual {p3, v0}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;->setAdChoicesView(Lcom/google/android/gms/ads/formats/AdChoicesView;)V
.line 30
:cond_80
iget-object p2, p2, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->mPrivacyInformationIconImageView:Landroid/widget/ImageView;
const/4 v0, 0x0
invoke-static {p2, v0, v0}, Lcom/tradplus/ads/nativeads/NativeRendererHelper;->addPrivacyInformationIcon(Landroid/widget/ImageView;Ljava/lang/String;Ljava/lang/String;)V
.line 31
invoke-virtual {p1}, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;->getUnifiedNativeAd()Lcom/google/android/gms/ads/formats/UnifiedNativeAd;
move-result-object p1
invoke-virtual {p3, p1}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;->setNativeAd(Lcom/google/android/gms/ads/formats/UnifiedNativeAd;)V
return-void
.end method
# virtual methods
.method public createAdView(Landroid/content/Context;Landroid/view/ViewGroup;)Landroid/view/View;
.registers 6
.line 1
invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
move-result-object v0
iget-object v1, p0, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->mViewBinder:Lcom/tradplus/ads/nativeads/MediaViewBinder;
iget v1, v1, Lcom/tradplus/ads/nativeads/MediaViewBinder;->layoutId:I
const/4 v2, 0x0
invoke-virtual {v0, v1, p2, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object p2
.line 2
new-instance v0, Landroid/widget/FrameLayout;
invoke-direct {v0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
const/16 p1, 0x3e9
.line 3
invoke-virtual {v0, p1}, Landroid/widget/FrameLayout;->setId(I)V
.line 4
invoke-virtual {v0, p2}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V
.line 5
sget-object p1, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->ADAPTER_NAME:Ljava/lang/String;
const-string p2, "Ad view created."
invoke-static {p1, p2}, Lcom/tradplus/ads/common/util/LogUtil;->show(Ljava/lang/String;Ljava/lang/String;)V
return-object v0
.end method
.method public renderAdView(Landroid/view/View;Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;)V
.registers 5
.line 2
iget-object v0, p0, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->mViewHolderMap:Ljava/util/WeakHashMap;
invoke-virtual {v0, p1}, Ljava/util/WeakHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;
if-nez v0, :cond_15
.line 3
iget-object v0, p0, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->mViewBinder:Lcom/tradplus/ads/nativeads/MediaViewBinder;
invoke-static {p1, v0}, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;->fromViewBinder(Landroid/view/View;Lcom/tradplus/ads/nativeads/MediaViewBinder;)Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;
move-result-object v0
.line 4
iget-object v1, p0, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->mViewHolderMap:Ljava/util/WeakHashMap;
invoke-virtual {v1, p1, v0}, Ljava/util/WeakHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 5
:cond_15
new-instance v1, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object p1
invoke-direct {v1, p1}, Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;-><init>(Landroid/content/Context;)V
.line 6
invoke-direct {p0, p2, v0, v1}, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->updateUnifiedAdview(Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer$GoogleStaticNativeViewHolder;Lcom/google/android/gms/ads/formats/UnifiedNativeAdView;)V
return-void
.end method
.method public bridge synthetic renderAdView(Landroid/view/View;Lcom/tradplus/ads/nativeads/BaseNativeAd;)V
.registers 3
.line 1
check-cast p2, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;
invoke-virtual {p0, p1, p2}, Lcom/tradplus/ads/google/GooglePlayServicesAdRenderer;->renderAdView(Landroid/view/View;Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;)V
return-void
.end method
.method public supports(Lcom/tradplus/ads/nativeads/BaseNativeAd;)Z
.registers 2
.line 1
instance-of p1, p1, Lcom/tradplus/ads/google/GooglePlayServicesListNative$GooglePlayServicesNativeAd;
return p1
.end method