.class public Lcom/moji/forum/ui/IslandAdapter;
.super Lcom/moji/forum/base/WrapAdapter;
.source "IslandAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/forum/ui/IslandAdapter$ViewHolder;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/forum/base/WrapAdapter<",
        "Lcom/moji/http/mqn/entity/AllTopic$SingleTopic;",
        ">;"
    }
.end annotation


# instance fields
.field private c:I

.field private d:Landroid/graphics/drawable/ColorDrawable;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/ArrayList;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/ArrayList<",
            "Lcom/moji/http/mqn/entity/AllTopic$SingleTopic;",
            ">;)V"
        }
    .end annotation

    .line 30
    invoke-direct {p0, p1, p2}, Lcom/moji/forum/base/WrapAdapter;-><init>(Landroid/content/Context;Ljava/util/ArrayList;)V

    const/4 p1, 0x0

    .line 26
    iput p1, p0, Lcom/moji/forum/ui/IslandAdapter;->c:I

    .line 31
    invoke-static {}, Lcom/moji/tool/DeviceTool;->b()I

    move-result p1

    int-to-float p1, p1

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

    move-result p2

    const/high16 v0, 0x41f00000    # 30.0f

    mul-float p2, p2, v0

    sub-float/2addr p1, p2

    const/high16 p2, 0x40000000    # 2.0f

    div-float/2addr p1, p2

    float-to-int p1, p1

    iput p1, p0, Lcom/moji/forum/ui/IslandAdapter;->c:I

    return-void
.end method


# virtual methods
.method public a()Landroid/graphics/drawable/Drawable;
    .locals 2

    .line 35
    iget-object v0, p0, Lcom/moji/forum/ui/IslandAdapter;->d:Landroid/graphics/drawable/ColorDrawable;

    if-nez v0, :cond_0

    new-instance v0, Landroid/graphics/drawable/ColorDrawable;

    const v1, -0xf0f10

    invoke-direct {v0, v1}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V

    iput-object v0, p0, Lcom/moji/forum/ui/IslandAdapter;->d:Landroid/graphics/drawable/ColorDrawable;

    .line 36
    :cond_0
    iget-object v0, p0, Lcom/moji/forum/ui/IslandAdapter;->d:Landroid/graphics/drawable/ColorDrawable;

    return-object v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 6

    const/4 v0, 0x0

    if-nez p2, :cond_0

    .line 43
    iget-object p2, p0, Lcom/moji/forum/ui/IslandAdapter;->a:Landroid/content/Context;

    invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object p2

    sget v1, Lcom/moji/forum/R$layout;->item_island_gridview:I

    invoke-virtual {p2, v1, p3, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p2

    .line 44
    new-instance p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;

    invoke-direct {p3}, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;-><init>()V

    .line 45
    sget v1, Lcom/moji/forum/R$id;->iv_topic_icon:I

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

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    iput-object v1, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->b:Landroid/widget/ImageView;

    .line 46
    sget v1, Lcom/moji/forum/R$id;->ll_topic_square:I

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

    move-result-object v1

    check-cast v1, Landroid/widget/LinearLayout;

    iput-object v1, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->a:Landroid/widget/LinearLayout;

    .line 47
    sget v1, Lcom/moji/forum/R$id;->tv_topic_title:I

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

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->c:Landroid/widget/TextView;

    .line 48
    sget v1, Lcom/moji/forum/R$id;->tv_people_num:I

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

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->d:Landroid/widget/TextView;

    .line 49
    sget v1, Lcom/moji/forum/R$id;->iv_corner_cover:I

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

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    iput-object v1, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->e:Landroid/widget/ImageView;

    .line 50
    iget-object v1, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->a:Landroid/widget/LinearLayout;

    invoke-virtual {v1}, Landroid/widget/LinearLayout;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v1

    check-cast v1, Landroid/widget/FrameLayout$LayoutParams;

    .line 51
    iget-object v2, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->e:Landroid/widget/ImageView;

    invoke-virtual {v2}, Landroid/widget/ImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v2

    check-cast v2, Landroid/widget/FrameLayout$LayoutParams;

    .line 52
    iget v3, p0, Lcom/moji/forum/ui/IslandAdapter;->c:I

    iput v3, v1, Landroid/widget/FrameLayout$LayoutParams;->width:I

    .line 53
    iget v3, p0, Lcom/moji/forum/ui/IslandAdapter;->c:I

    iput v3, v1, Landroid/widget/FrameLayout$LayoutParams;->height:I

    .line 54
    iget v1, p0, Lcom/moji/forum/ui/IslandAdapter;->c:I

    iput v1, v2, Landroid/widget/FrameLayout$LayoutParams;->width:I

    .line 55
    iget v1, p0, Lcom/moji/forum/ui/IslandAdapter;->c:I

    iput v1, v2, Landroid/widget/FrameLayout$LayoutParams;->height:I

    .line 56
    invoke-virtual {p2, p3}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    goto :goto_0

    .line 58
    :cond_0
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;

    .line 61
    :goto_0
    iget-object v1, p0, Lcom/moji/forum/ui/IslandAdapter;->b:Ljava/util/ArrayList;

    invoke-virtual {v1, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/http/mqn/entity/AllTopic$SingleTopic;

    .line 62
    iget-object v1, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->c:Landroid/widget/TextView;

    iget-object v2, p1, Lcom/moji/http/mqn/entity/AllTopic$SingleTopic;->name:Ljava/lang/String;

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

    .line 63
    iget-object v1, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->d:Landroid/widget/TextView;

    iget-object v2, p0, Lcom/moji/forum/ui/IslandAdapter;->a:Landroid/content/Context;

    sget v3, Lcom/moji/forum/R$string;->island_join_num:I

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Object;

    iget v5, p1, Lcom/moji/http/mqn/entity/AllTopic$SingleTopic;->count:I

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v4, v0

    invoke-virtual {v2, v3, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

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

    .line 64
    iget-object p3, p3, Lcom/moji/forum/ui/IslandAdapter$ViewHolder;->b:Landroid/widget/ImageView;

    iget-object p1, p1, Lcom/moji/http/mqn/entity/AllTopic$SingleTopic;->path:Ljava/lang/String;

    invoke-virtual {p0}, Lcom/moji/forum/ui/IslandAdapter;->a()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    invoke-static {p3, p1, v0}, Lcom/moji/forum/common/ForumUtil;->a(Landroid/widget/ImageView;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)V

    return-object p2
.end method
