.class public Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;
.super Lcom/moji/mjad/common/view/creater/AbsAdIconViewCreater;
.source "AdIconTextViewCreater.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


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


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

    .line 23
    invoke-direct {p0, p1}, Lcom/moji/mjad/common/view/creater/AbsAdIconViewCreater;-><init>(Landroid/content/Context;)V

    return-void
.end method


# virtual methods
.method public synthetic a(Ljava/lang/Object;Ljava/lang/String;)Landroid/view/View;
    .locals 0

    .line 19
    check-cast p1, Lcom/moji/mjad/common/data/AdCommon;

    invoke-virtual {p0, p1, p2}, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->g(Lcom/moji/mjad/common/data/AdCommon;Ljava/lang/String;)Landroid/view/View;

    move-result-object p1

    return-object p1
.end method

.method protected a(Landroid/view/View;)V
    .locals 1

    .line 36
    iget-object p1, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->n:Landroid/view/View;

    sget v0, Lcom/moji/mjad/R$id;->gf_icon: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/common/view/creater/style/AdIconTextViewCreater;->b:Landroid/widget/ImageView;

    .line 37
    iget-object p1, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->n:Landroid/view/View;

    sget v0, Lcom/moji/mjad/R$id;->tv_icon_name:I

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

    move-result-object p1

    check-cast p1, Landroid/widget/TextView;

    iput-object p1, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->C:Landroid/widget/TextView;

    .line 38
    iget-object p1, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->n:Landroid/view/View;

    invoke-virtual {p1, p0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 39
    sget p1, Lcom/moji/mjad/R$dimen;->_25dp:I

    invoke-virtual {p0, p1}, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->c(I)F

    move-result p1

    float-to-int p1, p1

    sget v0, Lcom/moji/mjad/R$dimen;->_25dp:I

    invoke-virtual {p0, v0}, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->c(I)F

    move-result v0

    float-to-int v0, v0

    invoke-virtual {p0, p1, v0}, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->a(II)V

    const/high16 p1, 0x42480000    # 50.0f

    .line 40
    invoke-static {p1}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result p1

    iput p1, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->k:I

    return-void
.end method

.method public a(Lcom/moji/mjad/common/data/AdCommon;Ljava/lang/String;)V
    .locals 2

    .line 52
    invoke-super {p0, p1, p2}, Lcom/moji/mjad/common/view/creater/AbsAdIconViewCreater;->a(Lcom/moji/mjad/common/data/AdCommon;Ljava/lang/String;)V

    if-eqz p1, :cond_1

    .line 54
    iget-object p2, p1, Lcom/moji/mjad/common/data/AdCommon;->title:Ljava/lang/String;

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

    move-result p2

    if-nez p2, :cond_1

    .line 55
    iget-object p2, p1, Lcom/moji/mjad/common/data/AdCommon;->title:Ljava/lang/String;

    invoke-virtual {p2}, Ljava/lang/String;->length()I

    move-result p2

    const/4 v0, 0x2

    if-le p2, v0, :cond_0

    .line 56
    iget-object p2, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->C:Landroid/widget/TextView;

    iget-object p1, p1, Lcom/moji/mjad/common/data/AdCommon;->title:Ljava/lang/String;

    const/4 v1, 0x0

    invoke-virtual {p1, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p2, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 58
    :cond_0
    iget-object p2, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->C:Landroid/widget/TextView;

    iget-object p1, p1, Lcom/moji/mjad/common/data/AdCommon;->title:Ljava/lang/String;

    invoke-virtual {p2, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    :cond_1
    :goto_0
    return-void
.end method

.method public g(Lcom/moji/mjad/common/data/AdCommon;Ljava/lang/String;)Landroid/view/View;
    .locals 1

    .line 28
    sget v0, Lcom/moji/mjad/R$layout;->moji_ad_icon_text:I

    invoke-virtual {p0, v0}, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->a(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->n:Landroid/view/View;

    .line 29
    iget-object v0, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->n:Landroid/view/View;

    invoke-virtual {p0, v0}, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->a(Landroid/view/View;)V

    .line 30
    invoke-virtual {p0, p1, p2}, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->a(Lcom/moji/mjad/common/data/AdCommon;Ljava/lang/String;)V

    .line 31
    iget-object p1, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->n:Landroid/view/View;

    return-object p1
.end method

.method public onClick(Landroid/view/View;)V
    .locals 0

    .line 45
    iget-object p1, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->n:Landroid/view/View;

    if-eqz p1, :cond_0

    .line 46
    iget-object p1, p0, Lcom/moji/mjad/common/view/creater/style/AdIconTextViewCreater;->n:Landroid/view/View;

    invoke-virtual {p1}, Landroid/view/View;->performClick()Z

    :cond_0
    return-void
.end method
