.class public Lcom/moji/mjad/view/AdTagView;
.super Landroid/widget/LinearLayout;
.source "AdTagView.java"


# instance fields
.field private a:Landroid/widget/TextView;

.field private b:Landroid/widget/ImageView;

.field private c:I

.field private d:I

.field private e:I

.field private f:Z

.field private g:Lcom/moji/mjad/common/data/AdCommon;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    .line 33
    invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    const/4 v0, 0x1

    .line 25
    iput v0, p0, Lcom/moji/mjad/view/AdTagView;->c:I

    const/4 v0, 0x6

    .line 26
    iput v0, p0, Lcom/moji/mjad/view/AdTagView;->d:I

    const/16 v0, 0x8

    .line 27
    iput v0, p0, Lcom/moji/mjad/view/AdTagView;->e:I

    const/4 v0, 0x0

    .line 29
    iput-boolean v0, p0, Lcom/moji/mjad/view/AdTagView;->f:Z

    .line 34
    invoke-direct {p0, p1}, Lcom/moji/mjad/view/AdTagView;->a(Landroid/content/Context;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0

    .line 38
    invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/4 p2, 0x1

    .line 25
    iput p2, p0, Lcom/moji/mjad/view/AdTagView;->c:I

    const/4 p2, 0x6

    .line 26
    iput p2, p0, Lcom/moji/mjad/view/AdTagView;->d:I

    const/16 p2, 0x8

    .line 27
    iput p2, p0, Lcom/moji/mjad/view/AdTagView;->e:I

    const/4 p2, 0x0

    .line 29
    iput-boolean p2, p0, Lcom/moji/mjad/view/AdTagView;->f:Z

    .line 39
    invoke-direct {p0, p1}, Lcom/moji/mjad/view/AdTagView;->a(Landroid/content/Context;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0

    .line 43
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    const/4 p2, 0x1

    .line 25
    iput p2, p0, Lcom/moji/mjad/view/AdTagView;->c:I

    const/4 p2, 0x6

    .line 26
    iput p2, p0, Lcom/moji/mjad/view/AdTagView;->d:I

    const/16 p2, 0x8

    .line 27
    iput p2, p0, Lcom/moji/mjad/view/AdTagView;->e:I

    const/4 p2, 0x0

    .line 29
    iput-boolean p2, p0, Lcom/moji/mjad/view/AdTagView;->f:Z

    .line 44
    invoke-direct {p0, p1}, Lcom/moji/mjad/view/AdTagView;->a(Landroid/content/Context;)V

    return-void
.end method

.method static synthetic a(Lcom/moji/mjad/view/AdTagView;)Landroid/widget/ImageView;
    .locals 0

    .line 22
    iget-object p0, p0, Lcom/moji/mjad/view/AdTagView;->b:Landroid/widget/ImageView;

    return-object p0
.end method

.method private a(Landroid/content/Context;)V
    .locals 1

    .line 48
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object p1

    sget v0, Lcom/moji/mjad/R$layout;->ad_tag_layout:I

    invoke-virtual {p1, v0, p0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p1

    .line 49
    sget v0, Lcom/moji/mjad/R$id;->tv_tag:I

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/moji/mjad/view/AdTagView;->a:Landroid/widget/TextView;

    .line 50
    sget v0, Lcom/moji/mjad/R$id;->img_logo:I

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/ImageView;

    iput-object p1, p0, Lcom/moji/mjad/view/AdTagView;->b:Landroid/widget/ImageView;

    return-void
.end method

.method static synthetic b(Lcom/moji/mjad/view/AdTagView;)Lcom/moji/mjad/common/data/AdCommon;
    .locals 0

    .line 22
    iget-object p0, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    return-object p0
.end method


# virtual methods
.method public a(I)Lcom/moji/mjad/view/AdTagView;
    .locals 0

    .line 54
    iput p1, p0, Lcom/moji/mjad/view/AdTagView;->c:I

    return-object p0
.end method

.method public a(II)Lcom/moji/mjad/view/AdTagView;
    .locals 0

    .line 74
    iput p1, p0, Lcom/moji/mjad/view/AdTagView;->e:I

    .line 75
    iput p2, p0, Lcom/moji/mjad/view/AdTagView;->d:I

    return-object p0
.end method

.method public a(Lcom/moji/mjad/common/data/AdCommon;)Lcom/moji/mjad/view/AdTagView;
    .locals 0

    .line 59
    iput-object p1, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    return-object p0
.end method

.method public a(Z)Lcom/moji/mjad/view/AdTagView;
    .locals 0

    .line 63
    iput-boolean p1, p0, Lcom/moji/mjad/view/AdTagView;->f:Z

    return-object p0
.end method

.method public a()V
    .locals 7

    .line 80
    iget-object v0, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    if-eqz v0, :cond_0

    const-string v0, "zdxtaglogo"

    .line 81
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, " checkLogoAndTag ---showAdSign-- "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-boolean v2, v2, Lcom/moji/mjad/common/data/AdCommon;->showAdSign:Z

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    const-string v2, "     isShowLogo--"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget v2, v2, Lcom/moji/mjad/common/data/AdCommon;->isShowLogo:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v2, "    logoStyle-- "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget v2, v2, Lcom/moji/mjad/common/data/AdCommon;->logoStyle:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v2, "   pos----"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-object v2, v2, Lcom/moji/mjad/common/data/AdCommon;->position:Lcom/moji/mjad/enumdata/MojiAdPosition;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 83
    :cond_0
    iget-object v0, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    const/16 v1, 0x8

    if-eqz v0, :cond_8

    iget-object v0, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-boolean v0, v0, Lcom/moji/mjad/common/data/AdCommon;->showAdSign:Z

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget v0, v0, Lcom/moji/mjad/common/data/AdCommon;->isShowLogo:I

    if-nez v0, :cond_1

    goto/16 :goto_5

    :cond_1
    const/4 v0, 0x0

    .line 88
    invoke-virtual {p0, v0}, Lcom/moji/mjad/view/AdTagView;->setVisibility(I)V

    .line 90
    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-object v2, v2, Lcom/moji/mjad/common/data/AdCommon;->logo:Lcom/moji/mjad/base/data/AdImageInfo;

    const/4 v3, 0x2

    if-eqz v2, :cond_3

    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-object v2, v2, Lcom/moji/mjad/common/data/AdCommon;->logo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget-object v2, v2, Lcom/moji/mjad/base/data/AdImageInfo;->imageUrl:Ljava/lang/String;

    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_3

    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget v2, v2, Lcom/moji/mjad/common/data/AdCommon;->isShowLogo:I

    const/4 v4, 0x1

    if-ne v2, v4, :cond_3

    .line 91
    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->b:Landroid/widget/ImageView;

    invoke-virtual {v2, v0}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 92
    iget v2, p0, Lcom/moji/mjad/view/AdTagView;->d:I

    int-to-float v2, v2

    invoke-static {v2}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result v2

    .line 95
    iget-object v4, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-object v4, v4, Lcom/moji/mjad/common/data/AdCommon;->logo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget v4, v4, Lcom/moji/mjad/base/data/AdImageInfo;->width:I

    if-lez v4, :cond_2

    iget-object v4, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-object v4, v4, Lcom/moji/mjad/common/data/AdCommon;->logo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget v4, v4, Lcom/moji/mjad/base/data/AdImageInfo;->height:I

    if-lez v4, :cond_2

    .line 96
    iget-object v4, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-object v4, v4, Lcom/moji/mjad/common/data/AdCommon;->logo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget v4, v4, Lcom/moji/mjad/base/data/AdImageInfo;->width:I

    div-int/2addr v4, v3

    int-to-float v4, v4

    invoke-static {v4}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result v4

    int-to-float v4, v4

    iget-object v5, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-object v5, v5, Lcom/moji/mjad/common/data/AdCommon;->logo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget v5, v5, Lcom/moji/mjad/base/data/AdImageInfo;->height:I

    div-int/2addr v5, v3

    int-to-float v5, v5

    invoke-static {v5}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result v5

    int-to-float v5, v5

    div-float/2addr v4, v5

    int-to-float v5, v2

    mul-float v5, v5, v4

    float-to-int v4, v5

    goto :goto_0

    :cond_2
    move v4, v2

    .line 99
    :goto_0
    invoke-virtual {p0}, Lcom/moji/mjad/view/AdTagView;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v5}, Lcom/squareup/picasso/Picasso;->a(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;

    move-result-object v5

    iget-object v6, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-object v6, v6, Lcom/moji/mjad/common/data/AdCommon;->logo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget-object v6, v6, Lcom/moji/mjad/base/data/AdImageInfo;->imageUrl:Ljava/lang/String;

    invoke-virtual {v5, v6}, Lcom/squareup/picasso/Picasso;->a(Ljava/lang/String;)Lcom/squareup/picasso/RequestCreator;

    move-result-object v5

    invoke-virtual {v5, v4, v2}, Lcom/squareup/picasso/RequestCreator;->a(II)Lcom/squareup/picasso/RequestCreator;

    move-result-object v2

    iget-object v4, p0, Lcom/moji/mjad/view/AdTagView;->b:Landroid/widget/ImageView;

    new-instance v5, Lcom/moji/mjad/view/AdTagView$1;

    invoke-direct {v5, p0}, Lcom/moji/mjad/view/AdTagView$1;-><init>(Lcom/moji/mjad/view/AdTagView;)V

    invoke-virtual {v2, v4, v5}, Lcom/squareup/picasso/RequestCreator;->a(Landroid/widget/ImageView;Lcom/squareup/picasso/Callback;)V

    goto :goto_1

    .line 113
    :cond_3
    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->b:Landroid/widget/ImageView;

    invoke-virtual {v2, v1}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 114
    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget v4, p0, Lcom/moji/mjad/view/AdTagView;->c:I

    iput v4, v2, Lcom/moji/mjad/common/data/AdCommon;->logoStyle:I

    .line 119
    :goto_1
    sget v2, Lcom/moji/mjad/R$drawable;->ad_tag_bg_normal:I

    .line 120
    sget v4, Lcom/moji/mjad/R$color;->c_999999:I

    .line 121
    iget-object v5, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget v5, v5, Lcom/moji/mjad/common/data/AdCommon;->logoStyle:I

    if-ne v5, v3, :cond_5

    .line 122
    iget-boolean v2, p0, Lcom/moji/mjad/view/AdTagView;->f:Z

    if-eqz v2, :cond_4

    .line 123
    sget v2, Lcom/moji/mjad/R$drawable;->ad_tag_bg_dark_half_corner:I

    goto :goto_2

    .line 125
    :cond_4
    sget v2, Lcom/moji/mjad/R$drawable;->ad_tag_bg_dark:I

    .line 127
    :goto_2
    sget v4, Lcom/moji/mjad/R$color;->white:I

    goto :goto_3

    .line 129
    :cond_5
    iget-boolean v3, p0, Lcom/moji/mjad/view/AdTagView;->f:Z

    if-eqz v3, :cond_6

    .line 130
    sget v2, Lcom/moji/mjad/R$drawable;->ad_tag_bg_normal_half_corner:I

    .line 134
    :cond_6
    :goto_3
    invoke-virtual {p0, v2}, Lcom/moji/mjad/view/AdTagView;->setBackgroundResource(I)V

    const-string v2, "zdxtaglogo"

    .line 135
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "  ----    sp---"

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v5, p0, Lcom/moji/mjad/view/AdTagView;->e:I

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v5, "   "

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget v5, p0, Lcom/moji/mjad/view/AdTagView;->e:I

    int-to-float v5, v5

    invoke-static {v5}, Lcom/moji/tool/DeviceTool;->b(F)I

    move-result v5

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 136
    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->a:Landroid/widget/TextView;

    iget v3, p0, Lcom/moji/mjad/view/AdTagView;->e:I

    int-to-float v3, v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextSize(F)V

    .line 137
    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->a:Landroid/widget/TextView;

    invoke-virtual {p0}, Lcom/moji/mjad/view/AdTagView;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I

    move-result v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 138
    iget-object v2, p0, Lcom/moji/mjad/view/AdTagView;->a:Landroid/widget/TextView;

    iget-object v3, p0, Lcom/moji/mjad/view/AdTagView;->g:Lcom/moji/mjad/common/data/AdCommon;

    iget-boolean v3, v3, Lcom/moji/mjad/common/data/AdCommon;->showAdSign:Z

    if-eqz v3, :cond_7

    goto :goto_4

    :cond_7
    const/16 v0, 0x8

    :goto_4
    invoke-virtual {v2, v0}, Landroid/widget/TextView;->setVisibility(I)V

    return-void

    .line 84
    :cond_8
    :goto_5
    invoke-virtual {p0, v1}, Lcom/moji/mjad/view/AdTagView;->setVisibility(I)V

    const-string v0, "zdxtaglogo"

    const-string v1, "  ---  \u6807\u7b7e logo\u5747\u9690\u85cf "

    .line 85
    invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method
