.class Lcom/moji/emotion/EmotionFragment$GridAdapter;
.super Landroid/widget/BaseAdapter;
.source "EmotionFragment.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/moji/emotion/EmotionFragment;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "GridAdapter"
.end annotation


# instance fields
.field final synthetic a:Lcom/moji/emotion/EmotionFragment;

.field private final b:[Ljava/lang/String;


# direct methods
.method public constructor <init>(Lcom/moji/emotion/EmotionFragment;[Ljava/lang/String;)V
    .locals 0

    .line 144
    iput-object p1, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 145
    iput-object p2, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->b:[Ljava/lang/String;

    return-void
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .line 151
    iget-object v0, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->b:[Ljava/lang/String;

    array-length v0, v0

    add-int/lit8 v0, v0, 0x1

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 0

    .line 157
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    return-object p1
.end method

.method public getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

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

    .line 168
    iget-object v0, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->b:[Ljava/lang/String;

    array-length v0, v0

    if-ne p1, v0, :cond_0

    .line 169
    new-instance p1, Landroid/widget/ImageView;

    invoke-virtual {p3}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;

    move-result-object p2

    invoke-direct {p1, p2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 170
    move-object p2, p1

    check-cast p2, Landroid/widget/ImageView;

    .line 171
    sget-object p3, Landroid/widget/ImageView$ScaleType;->FIT_CENTER:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {p2, p3}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 172
    iget-object p3, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-static {p3}, Lcom/moji/emotion/EmotionFragment;->c(Lcom/moji/emotion/EmotionFragment;)F

    move-result p3

    const/high16 v0, 0x40000000    # 2.0f

    mul-float p3, p3, v0

    invoke-static {p3}, Ljava/lang/Math;->round(F)I

    move-result p3

    iget-object v1, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-static {v1}, Lcom/moji/emotion/EmotionFragment;->c(Lcom/moji/emotion/EmotionFragment;)F

    move-result v1

    mul-float v1, v1, v0

    invoke-static {v1}, Ljava/lang/Math;->round(F)I

    move-result v1

    iget-object v2, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-static {v2}, Lcom/moji/emotion/EmotionFragment;->c(Lcom/moji/emotion/EmotionFragment;)F

    move-result v2

    mul-float v2, v2, v0

    invoke-static {v2}, Ljava/lang/Math;->round(F)I

    move-result v2

    iget-object v3, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-static {v3}, Lcom/moji/emotion/EmotionFragment;->c(Lcom/moji/emotion/EmotionFragment;)F

    move-result v3

    mul-float v3, v3, v0

    invoke-static {v3}, Ljava/lang/Math;->round(F)I

    move-result v0

    invoke-virtual {p2, p3, v1, v2, v0}, Landroid/widget/ImageView;->setPadding(IIII)V

    .line 173
    new-instance p3, Landroid/widget/AbsListView$LayoutParams;

    iget-object v0, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-static {v0}, Lcom/moji/emotion/EmotionFragment;->d(Lcom/moji/emotion/EmotionFragment;)I

    move-result v0

    iget-object v1, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-static {v1}, Lcom/moji/emotion/EmotionFragment;->d(Lcom/moji/emotion/EmotionFragment;)I

    move-result v1

    invoke-direct {p3, v0, v1}, Landroid/widget/AbsListView$LayoutParams;-><init>(II)V

    invoke-virtual {p2, p3}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 174
    sget p3, Lcom/moji/widget/R$drawable;->emotion_delete_selector:I

    invoke-virtual {p2, p3}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 175
    new-instance p3, Lcom/moji/emotion/EmotionFragment$GridAdapter$1;

    invoke-direct {p3, p0}, Lcom/moji/emotion/EmotionFragment$GridAdapter$1;-><init>(Lcom/moji/emotion/EmotionFragment$GridAdapter;)V

    invoke-virtual {p2, p3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    return-object p1

    .line 186
    :cond_0
    iget-object v0, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->b:[Ljava/lang/String;

    aget-object p1, v0, p1

    if-nez p2, :cond_1

    .line 188
    new-instance p2, Landroid/widget/ImageView;

    invoke-virtual {p3}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;

    move-result-object p3

    invoke-direct {p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 189
    move-object p3, p2

    check-cast p3, Landroid/widget/ImageView;

    .line 191
    invoke-static {}, Lcom/moji/tool/SnsMgr;->a()Lcom/moji/tool/SnsMgr;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/moji/tool/SnsMgr;->a(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-virtual {p3, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 192
    sget-object v0, Landroid/widget/ImageView$ScaleType;->FIT_XY:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {p3, v0}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 193
    new-instance v0, Landroid/widget/AbsListView$LayoutParams;

    iget-object v1, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-static {v1}, Lcom/moji/emotion/EmotionFragment;->d(Lcom/moji/emotion/EmotionFragment;)I

    move-result v1

    iget-object v2, p0, Lcom/moji/emotion/EmotionFragment$GridAdapter;->a:Lcom/moji/emotion/EmotionFragment;

    invoke-static {v2}, Lcom/moji/emotion/EmotionFragment;->d(Lcom/moji/emotion/EmotionFragment;)I

    move-result v2

    invoke-direct {v0, v1, v2}, Landroid/widget/AbsListView$LayoutParams;-><init>(II)V

    invoke-virtual {p3, v0}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    goto :goto_0

    .line 195
    :cond_1
    move-object p3, p2

    check-cast p3, Landroid/widget/ImageView;

    .line 197
    invoke-static {}, Lcom/moji/tool/SnsMgr;->a()Lcom/moji/tool/SnsMgr;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/moji/tool/SnsMgr;->a(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-virtual {p3, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 200
    :goto_0
    invoke-virtual {p2, p1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    if-nez p1, :cond_2

    const/4 p1, 0x0

    .line 202
    invoke-virtual {p2, p1}, Landroid/view/View;->setClickable(Z)V

    return-object p2

    .line 205
    :cond_2
    new-instance p3, Lcom/moji/emotion/EmotionFragment$GridAdapter$2;

    invoke-direct {p3, p0, p1}, Lcom/moji/emotion/EmotionFragment$GridAdapter$2;-><init>(Lcom/moji/emotion/EmotionFragment$GridAdapter;Ljava/lang/String;)V

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

    return-object p2
.end method
