.class public Lcom/moji/mjweather/setting/adapter/CityGridAdapter;
.super Landroid/widget/BaseAdapter;
.source "CityGridAdapter.java"


# instance fields
.field private final a:Landroid/view/LayoutInflater;

.field private b:I

.field private c:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/moji/areamanagement/entity/CityItemRecord;",
            ">;"
        }
    .end annotation
.end field


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

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

    const/4 v0, 0x3

    .line 20
    iput v0, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->b:I

    const-string v0, "layout_inflater"

    .line 28
    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Landroid/view/LayoutInflater;

    iput-object p1, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->a:Landroid/view/LayoutInflater;

    return-void
.end method


# virtual methods
.method public a(I)V
    .locals 0

    .line 51
    iput p1, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->b:I

    return-void
.end method

.method public a(Ljava/util/List;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/moji/areamanagement/entity/CityItemRecord;",
            ">;)V"
        }
    .end annotation

    .line 47
    iput-object p1, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->c:Ljava/util/List;

    return-void
.end method

.method public getCount()I
    .locals 1

    .line 33
    iget-object v0, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->c:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

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

    .line 38
    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 5

    .line 57
    iget-object p2, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->a:Landroid/view/LayoutInflater;

    const/4 v0, 0x0

    const v1, 0x7f0b014b

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

    move-result-object p2

    check-cast p2, Landroid/widget/LinearLayout;

    if-ltz p1, :cond_3

    .line 58
    iget-object p3, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->c:Ljava/util/List;

    invoke-interface {p3}, Ljava/util/List;->size()I

    move-result p3

    if-lt p1, p3, :cond_0

    goto :goto_1

    .line 61
    :cond_0
    iget-object p3, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->c:Ljava/util/List;

    invoke-interface {p3, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/areamanagement/entity/CityItemRecord;

    .line 62
    iget-object p3, p1, Lcom/moji/areamanagement/entity/CityItemRecord;->cityName:Ljava/lang/String;

    .line 63
    iget-object p1, p1, Lcom/moji/areamanagement/entity/CityItemRecord;->provinceName:Ljava/lang/String;

    const v1, 0x7f09027f

    .line 64
    invoke-virtual {p2, v1}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    const v2, 0x7f090280

    .line 65
    invoke-virtual {p2, v2}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    .line 66
    iget v3, p0, Lcom/moji/mjweather/setting/adapter/CityGridAdapter;->b:I

    const/4 v4, 0x1

    if-eq v3, v4, :cond_2

    const/4 p1, 0x3

    if-eq v3, p1, :cond_1

    goto :goto_0

    :cond_1
    const/16 p1, 0x11

    .line 73
    invoke-virtual {p2, p1}, Landroid/widget/LinearLayout;->setGravity(I)V

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

    goto :goto_0

    .line 68
    :cond_2
    invoke-virtual {v1, p3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

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

    .line 70
    new-instance p3, Ljava/lang/StringBuilder;

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

    const-string v0, " - "

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

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

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

    move-result-object p1

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

    :goto_0
    return-object p2

    :cond_3
    :goto_1
    return-object p2
.end method
