.class public Lcom/moji/index/CommerceListAdapter;
.super Lcom/moji/recyclerview/RecyclerAdapter;
.source "CommerceListAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/index/CommerceListAdapter$VideoHolder;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/recyclerview/RecyclerAdapter<",
        "Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;",
        "Lcom/moji/index/CommerceListAdapter$VideoHolder;",
        ">;"
    }
.end annotation


# direct methods
.method public constructor <init>(Lcom/moji/http/index/IndexCommerceListResp;)V
    .locals 0

    .line 24
    iget-object p1, p1, Lcom/moji/http/index/IndexCommerceListResp;->indexGoods:Ljava/util/List;

    invoke-direct {p0, p1}, Lcom/moji/recyclerview/RecyclerAdapter;-><init>(Ljava/util/List;)V

    return-void
.end method


# virtual methods
.method protected a(Landroid/view/View;I)Lcom/moji/index/CommerceListAdapter$VideoHolder;
    .locals 0

    .line 29
    new-instance p2, Lcom/moji/index/CommerceListAdapter$VideoHolder;

    invoke-direct {p2, p1, p0}, Lcom/moji/index/CommerceListAdapter$VideoHolder;-><init>(Landroid/view/View;Lcom/moji/recyclerview/RecyclerAdapter;)V

    return-object p2
.end method

.method protected a(Lcom/moji/index/CommerceListAdapter$VideoHolder;ILcom/moji/http/index/IndexCommerceListResp$IndexGoods;)V
    .locals 5

    .line 39
    iget-object v0, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->n:Landroid/widget/ImageView;

    iget-object v1, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->picUrl:Ljava/lang/String;

    sget v2, Lcom/moji/index/R$drawable;->commerce_item_icon_default:I

    invoke-static {v0, v1, v2}, Lcom/moji/tool/ImageTool;->b(Landroid/widget/ImageView;Ljava/lang/String;I)V

    .line 41
    iget-object v0, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->goodsTitle:Ljava/lang/String;

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

    move-result v0

    if-eqz v0, :cond_0

    .line 42
    iget-object v0, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->o:Landroid/widget/TextView;

    const-string v1, "----"

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

    goto :goto_0

    .line 44
    :cond_0
    iget-object v0, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->o:Landroid/widget/TextView;

    iget-object v1, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->goodsTitle:Ljava/lang/String;

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

    .line 47
    :goto_0
    iget-object v0, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->tags:[Ljava/lang/String;

    const/4 v1, 0x0

    if-eqz v0, :cond_3

    iget-object v0, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->tags:[Ljava/lang/String;

    array-length v0, v0

    if-lez v0, :cond_3

    .line 48
    iget-object v0, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->tags:[Ljava/lang/String;

    aget-object v0, v0, v1

    .line 49
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 50
    iget-object v2, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->p:Landroid/widget/TextView;

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

    .line 51
    iget-object v2, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->p:Landroid/widget/TextView;

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

    .line 54
    :cond_1
    iget-object v0, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->tags:[Ljava/lang/String;

    array-length v0, v0

    const/4 v2, 0x1

    if-le v0, v2, :cond_2

    .line 55
    iget-object v0, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->tags:[Ljava/lang/String;

    aget-object v0, v0, v2

    .line 56
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_2

    .line 57
    iget-object v2, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->q:Landroid/widget/TextView;

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

    .line 58
    iget-object v2, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->q:Landroid/widget/TextView;

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

    .line 62
    :cond_2
    iget-object v0, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->o:Landroid/widget/TextView;

    new-instance v2, Lcom/moji/index/CommerceListAdapter$1;

    invoke-direct {v2, p0, p1}, Lcom/moji/index/CommerceListAdapter$1;-><init>(Lcom/moji/index/CommerceListAdapter;Lcom/moji/index/CommerceListAdapter$VideoHolder;)V

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->post(Ljava/lang/Runnable;)Z

    goto :goto_1

    .line 74
    :cond_3
    iget-object v0, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->p:Landroid/widget/TextView;

    const/16 v2, 0x8

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

    .line 75
    iget-object v0, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->q:Landroid/widget/TextView;

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

    .line 76
    iget-object v0, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->o:Landroid/widget/TextView;

    new-instance v2, Lcom/moji/index/CommerceListAdapter$2;

    invoke-direct {v2, p0, p1}, Lcom/moji/index/CommerceListAdapter$2;-><init>(Lcom/moji/index/CommerceListAdapter;Lcom/moji/index/CommerceListAdapter$VideoHolder;)V

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->post(Ljava/lang/Runnable;)Z

    :goto_1
    const/16 v0, 0xa5

    .line 90
    iget-object v2, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->goodsPrice:Ljava/lang/String;

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

    move-result v2

    if-eqz v2, :cond_4

    .line 91
    iget-object v2, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->r:Landroid/widget/TextView;

    new-instance v3, Ljava/lang/StringBuilder;

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

    invoke-static {v0}, Ljava/lang/String;->valueOf(C)Ljava/lang/String;

    move-result-object v4

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

    const-string v4, "--"

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

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

    move-result-object v3

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

    goto :goto_2

    .line 93
    :cond_4
    new-instance v2, Ljava/lang/StringBuilder;

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

    invoke-static {v0}, Ljava/lang/String;->valueOf(C)Ljava/lang/String;

    move-result-object v3

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

    iget-object v3, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->goodsPrice:Ljava/lang/String;

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

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

    move-result-object v2

    .line 94
    iget-object v3, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->r:Landroid/widget/TextView;

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

    .line 97
    :goto_2
    iget-object v2, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->originalPrice:Ljava/lang/String;

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

    move-result v2

    if-eqz v2, :cond_5

    .line 98
    iget-object p3, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->s:Landroid/widget/TextView;

    const/4 v0, 0x4

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

    goto :goto_3

    .line 100
    :cond_5
    iget-object v2, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->s:Landroid/widget/TextView;

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

    .line 101
    iget-object v1, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->s:Landroid/widget/TextView;

    invoke-virtual {v1}, Landroid/widget/TextView;->getPaint()Landroid/text/TextPaint;

    move-result-object v1

    const/16 v2, 0x10

    invoke-virtual {v1, v2}, Landroid/text/TextPaint;->setFlags(I)V

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

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

    invoke-static {v0}, Ljava/lang/String;->valueOf(C)Ljava/lang/String;

    move-result-object v0

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

    iget-object p3, p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;->originalPrice:Ljava/lang/String;

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

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

    move-result-object p3

    .line 103
    iget-object v0, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->s:Landroid/widget/TextView;

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

    :goto_3
    if-nez p2, :cond_6

    .line 106
    iget-object p2, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->a:Landroid/view/View;

    invoke-virtual {p2}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object p2

    check-cast p2, Landroid/support/v7/widget/RecyclerView$LayoutParams;

    const/high16 p3, 0x41700000    # 15.0f

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

    move-result p3

    iput p3, p2, Landroid/support/v7/widget/RecyclerView$LayoutParams;->leftMargin:I

    .line 108
    iget-object p1, p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;->a:Landroid/view/View;

    invoke-virtual {p1, p2}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    :cond_6
    return-void
.end method

.method protected bridge synthetic a(Lcom/moji/recyclerview/RecyclerHolder;ILjava/lang/Object;)V
    .locals 0

    .line 21
    check-cast p1, Lcom/moji/index/CommerceListAdapter$VideoHolder;

    check-cast p3, Lcom/moji/http/index/IndexCommerceListResp$IndexGoods;

    invoke-virtual {p0, p1, p2, p3}, Lcom/moji/index/CommerceListAdapter;->a(Lcom/moji/index/CommerceListAdapter$VideoHolder;ILcom/moji/http/index/IndexCommerceListResp$IndexGoods;)V

    return-void
.end method

.method protected synthetic b(Landroid/view/View;I)Lcom/moji/recyclerview/RecyclerHolder;
    .locals 0

    .line 21
    invoke-virtual {p0, p1, p2}, Lcom/moji/index/CommerceListAdapter;->a(Landroid/view/View;I)Lcom/moji/index/CommerceListAdapter$VideoHolder;

    move-result-object p1

    return-object p1
.end method

.method protected f(I)I
    .locals 0

    .line 34
    sget p1, Lcom/moji/index/R$layout;->item_commerce:I

    return p1
.end method
