.class Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;
.super Ljava/lang/Object;
.source "GridViewWithHeaderAndFooter.java"

# interfaces
.implements Landroid/widget/Filterable;
.implements Landroid/widget/WrapperListAdapter;


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

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "HeaderViewGridAdapter"
.end annotation


# static fields
.field static final a:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field b:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;",
            ">;"
        }
    .end annotation
.end field

.field c:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;",
            ">;"
        }
    .end annotation
.end field

.field d:Z

.field private final e:Landroid/database/DataSetObservable;

.field private final f:Landroid/widget/ListAdapter;

.field private g:I

.field private h:I

.field private final i:Z

.field private j:Z

.field private k:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 448
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    sput-object v0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a:Ljava/util/ArrayList;

    return-void
.end method

.method public constructor <init>(Ljava/util/ArrayList;Ljava/util/ArrayList;Landroid/widget/ListAdapter;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList<",
            "Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;",
            ">;",
            "Ljava/util/ArrayList<",
            "Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;",
            ">;",
            "Landroid/widget/ListAdapter;",
            ")V"
        }
    .end annotation

    .line 462
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 446
    new-instance v0, Landroid/database/DataSetObservable;

    invoke-direct {v0}, Landroid/database/DataSetObservable;-><init>()V

    iput-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->e:Landroid/database/DataSetObservable;

    const/4 v0, 0x1

    .line 454
    iput v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    const/4 v1, -0x1

    .line 455
    iput v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->h:I

    .line 458
    iput-boolean v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->j:Z

    const/4 v1, 0x0

    .line 460
    iput-boolean v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->k:Z

    .line 463
    iput-object p3, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    .line 464
    instance-of p3, p3, Landroid/widget/Filterable;

    iput-boolean p3, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->i:Z

    if-nez p1, :cond_0

    .line 466
    sget-object p1, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a:Ljava/util/ArrayList;

    iput-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    goto :goto_0

    .line 468
    :cond_0
    iput-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    :goto_0
    if-nez p2, :cond_1

    .line 472
    sget-object p1, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a:Ljava/util/ArrayList;

    iput-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    goto :goto_1

    .line 474
    :cond_1
    iput-object p2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    .line 476
    :goto_1
    iget-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    invoke-direct {p0, p1}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a(Ljava/util/ArrayList;)Z

    move-result p1

    if-eqz p1, :cond_2

    iget-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    .line 477
    invoke-direct {p0, p1}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a(Ljava/util/ArrayList;)Z

    move-result p1

    if-eqz p1, :cond_2

    goto :goto_2

    :cond_2
    const/4 v0, 0x0

    :goto_2
    iput-boolean v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->d:Z

    return-void
.end method

.method private a(Ljava/util/ArrayList;)Z
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList<",
            "Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;",
            ">;)Z"
        }
    .end annotation

    if-eqz p1, :cond_1

    .line 515
    invoke-virtual {p1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :cond_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;

    .line 516
    iget-boolean v0, v0, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;->d:Z

    if-nez v0, :cond_0

    const/4 p1, 0x0

    return p1

    :cond_1
    const/4 p1, 0x1

    return p1
.end method

.method private d()I
    .locals 4

    .line 567
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0}, Landroid/widget/ListAdapter;->getCount()I

    move-result v0

    int-to-float v0, v0

    const/high16 v1, 0x3f800000    # 1.0f

    mul-float v0, v0, v1

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    int-to-float v1, v1

    div-float/2addr v0, v1

    float-to-double v0, v0

    invoke-static {v0, v1}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v0

    iget v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    int-to-double v2, v2

    invoke-static {v2, v3}, Ljava/lang/Double;->isNaN(D)Z

    mul-double v0, v0, v2

    double-to-int v0, v0

    return v0
.end method


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

    .line 495
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public a(I)V
    .locals 1

    const/4 v0, 0x1

    if-ge p1, v0, :cond_0

    return-void

    .line 484
    :cond_0
    iget v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    if-eq v0, p1, :cond_1

    .line 485
    iput p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    .line 486
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c()V

    :cond_1
    return-void
.end method

.method public a(Landroid/view/View;)Z
    .locals 3

    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 539
    :goto_0
    iget-object v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-ge v1, v2, :cond_2

    .line 540
    iget-object v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

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

    move-result-object v2

    check-cast v2, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;

    .line 541
    iget-object v2, v2, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;->a:Landroid/view/View;

    if-ne v2, p1, :cond_1

    .line 542
    iget-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

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

    .line 543
    iget-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    .line 544
    invoke-direct {p0, p1}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a(Ljava/util/ArrayList;)Z

    move-result p1

    const/4 v1, 0x1

    if-eqz p1, :cond_0

    iget-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    invoke-direct {p0, p1}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a(Ljava/util/ArrayList;)Z

    move-result p1

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    :cond_0
    iput-boolean v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->d:Z

    .line 545
    iget-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->e:Landroid/database/DataSetObservable;

    invoke-virtual {p1}, Landroid/database/DataSetObservable;->notifyChanged()V

    return v1

    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_2
    return v0
.end method

.method public areAllItemsEnabled()Z
    .locals 1

    .line 563
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v0, :cond_1

    iget-boolean v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->d:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0}, Landroid/widget/ListAdapter;->areAllItemsEnabled()Z

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    goto :goto_1

    :cond_1
    :goto_0
    const/4 v0, 0x1

    :goto_1
    return v0
.end method

.method public b()I
    .locals 1

    .line 499
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public b(I)V
    .locals 0

    .line 491
    iput p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->h:I

    return-void
.end method

.method public c()V
    .locals 1

    .line 809
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->e:Landroid/database/DataSetObservable;

    invoke-virtual {v0}, Landroid/database/DataSetObservable;->notifyChanged()V

    return-void
.end method

.method public getCount()I
    .locals 2

    .line 554
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v0, :cond_0

    .line 555
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b()I

    move-result v0

    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a()I

    move-result v1

    add-int/2addr v0, v1

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    mul-int v0, v0, v1

    invoke-direct {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->d()I

    move-result v1

    add-int/2addr v0, v1

    return v0

    .line 557
    :cond_0
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b()I

    move-result v0

    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a()I

    move-result v1

    add-int/2addr v0, v1

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    mul-int v0, v0, v1

    return v0
.end method

.method public getFilter()Landroid/widget/Filter;
    .locals 1

    .line 797
    iget-boolean v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->i:Z

    if-eqz v0, :cond_0

    .line 798
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    check-cast v0, Landroid/widget/Filterable;

    invoke-interface {v0}, Landroid/widget/Filterable;->getFilter()Landroid/widget/Filter;

    move-result-object v0

    return-object v0

    :cond_0
    const/4 v0, 0x0

    return-object v0
.end method

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

    .line 598
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a()I

    move-result v0

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    mul-int v0, v0, v1

    const/4 v1, 0x0

    if-ge p1, v0, :cond_1

    .line 600
    iget v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    rem-int v0, p1, v0

    if-nez v0, :cond_0

    .line 601
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    div-int/2addr p1, v1

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

    move-result-object p1

    check-cast p1, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;

    iget-object p1, p1, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;->c:Ljava/lang/Object;

    return-object p1

    :cond_0
    return-object v1

    :cond_1
    sub-int/2addr p1, v0

    const/4 v0, 0x0

    .line 609
    iget-object v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v2, :cond_3

    .line 610
    invoke-direct {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->d()I

    move-result v0

    if-ge p1, v0, :cond_3

    .line 612
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0}, Landroid/widget/ListAdapter;->getCount()I

    move-result v0

    if-ge p1, v0, :cond_2

    .line 613
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0, p1}, Landroid/widget/ListAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object p1

    return-object p1

    :cond_2
    return-object v1

    :cond_3
    sub-int/2addr p1, v0

    .line 622
    iget v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    rem-int v0, p1, v0

    if-nez v0, :cond_4

    .line 623
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

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

    move-result-object p1

    check-cast p1, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;

    iget-object p1, p1, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;->c:Ljava/lang/Object;

    return-object p1

    :cond_4
    return-object v1
.end method

.method public getItemId(I)J
    .locals 2

    .line 631
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a()I

    move-result v0

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    mul-int v0, v0, v1

    .line 632
    iget-object v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v1, :cond_0

    if-lt p1, v0, :cond_0

    sub-int/2addr p1, v0

    .line 634
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0}, Landroid/widget/ListAdapter;->getCount()I

    move-result v0

    if-ge p1, v0, :cond_0

    .line 636
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0, p1}, Landroid/widget/ListAdapter;->getItemId(I)J

    move-result-wide v0

    return-wide v0

    :cond_0
    const-wide/16 v0, -0x1

    return-wide v0
.end method

.method public getItemViewType(I)I
    .locals 7

    .line 712
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a()I

    move-result v0

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    mul-int v0, v0, v1

    .line 713
    iget-object v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    const/4 v2, 0x0

    const/4 v3, 0x1

    if-nez v1, :cond_0

    const/4 v1, 0x0

    goto :goto_0

    :cond_0
    iget-object v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v1}, Landroid/widget/ListAdapter;->getViewTypeCount()I

    move-result v1

    sub-int/2addr v1, v3

    :goto_0
    const/4 v4, -0x2

    .line 715
    iget-boolean v5, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->j:Z

    if-eqz v5, :cond_2

    if-ge p1, v0, :cond_2

    if-nez p1, :cond_1

    .line 719
    iget-boolean v5, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->k:Z

    if-eqz v5, :cond_1

    .line 720
    iget-object v4, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v4

    add-int/2addr v4, v1

    iget-object v5, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I

    move-result v5

    add-int/2addr v4, v5

    add-int/2addr v4, v3

    add-int/2addr v4, v3

    .line 723
    :cond_1
    iget v5, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    rem-int v5, p1, v5

    if-eqz v5, :cond_2

    .line 724
    iget v4, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    div-int v4, p1, v4

    add-int/2addr v4, v3

    add-int/2addr v4, v1

    :cond_2
    sub-int v0, p1, v0

    .line 732
    iget-object v5, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v5, :cond_4

    .line 733
    invoke-direct {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->d()I

    move-result v5

    if-ltz v0, :cond_5

    if-ge v0, v5, :cond_5

    .line 735
    iget-object v6, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v6}, Landroid/widget/ListAdapter;->getCount()I

    move-result v6

    if-ge v0, v6, :cond_3

    .line 736
    iget-object v4, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v4, v0}, Landroid/widget/ListAdapter;->getItemViewType(I)I

    move-result v4

    goto :goto_1

    .line 738
    :cond_3
    iget-boolean v6, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->j:Z

    if-eqz v6, :cond_5

    .line 739
    iget-object v4, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v4

    add-int/2addr v4, v1

    add-int/2addr v4, v3

    goto :goto_1

    :cond_4
    const/4 v5, 0x0

    .line 745
    :cond_5
    :goto_1
    iget-boolean v6, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->j:Z

    if-eqz v6, :cond_6

    sub-int/2addr v0, v5

    if-ltz v0, :cond_6

    .line 748
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->getCount()I

    move-result v5

    if-ge v0, v5, :cond_6

    iget v5, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    rem-int v5, v0, v5

    if-eqz v5, :cond_6

    .line 749
    iget-object v4, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v4

    add-int/2addr v1, v4

    add-int/2addr v1, v3

    iget v4, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    div-int/2addr v0, v4

    add-int/2addr v0, v3

    add-int v4, v1, v0

    .line 752
    :cond_6
    sget-boolean v0, Lcom/moji/GridViewWithHeaderAndFooter;->a:Z

    if-eqz v0, :cond_7

    const-string v0, "GridViewHeaderAndFooter"

    const-string v1, "getItemViewType: pos: %s, result: %s"

    const/4 v5, 0x4

    .line 753
    new-array v5, v5, [Ljava/lang/Object;

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

    move-result-object p1

    aput-object p1, v5, v2

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

    move-result-object p1

    aput-object p1, v5, v3

    const/4 p1, 0x2

    iget-boolean v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->j:Z

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    aput-object v2, v5, p1

    const/4 p1, 0x3

    iget-boolean v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->k:Z

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    aput-object v2, v5, p1

    invoke-static {v1, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

    :cond_7
    return v4
.end method

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

    .line 649
    sget-boolean v0, Lcom/moji/GridViewWithHeaderAndFooter;->a:Z

    const/4 v1, 0x0

    if-eqz v0, :cond_1

    const-string v0, "GridViewHeaderAndFooter"

    const-string v2, "getView: %s, reused: %s"

    const/4 v3, 0x2

    .line 650
    new-array v3, v3, [Ljava/lang/Object;

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

    move-result-object v4

    aput-object v4, v3, v1

    const/4 v4, 0x1

    if-nez p2, :cond_0

    const/4 v5, 0x1

    goto :goto_0

    :cond_0
    const/4 v5, 0x0

    :goto_0
    invoke-static {v5}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v5

    aput-object v5, v3, v4

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 653
    :cond_1
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a()I

    move-result v0

    iget v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    mul-int v0, v0, v2

    const/4 v2, 0x4

    if-ge p1, v0, :cond_4

    .line 655
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    div-int v1, p1, v1

    .line 656
    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;

    iget-object v0, v0, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;->b:Landroid/view/ViewGroup;

    .line 657
    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    rem-int/2addr p1, v1

    if-nez p1, :cond_2

    return-object v0

    :cond_2
    if-nez p2, :cond_3

    .line 661
    new-instance p2, Landroid/view/View;

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

    move-result-object p1

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

    .line 665
    :cond_3
    invoke-virtual {p2, v2}, Landroid/view/View;->setVisibility(I)V

    .line 666
    invoke-virtual {v0}, Landroid/view/View;->getHeight()I

    move-result p1

    invoke-virtual {p2, p1}, Landroid/view/View;->setMinimumHeight(I)V

    return-object p2

    :cond_4
    sub-int v0, p1, v0

    .line 673
    iget-object v3, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v3, :cond_7

    .line 674
    invoke-direct {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->d()I

    move-result v1

    if-ge v0, v1, :cond_7

    .line 676
    iget-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {p1}, Landroid/widget/ListAdapter;->getCount()I

    move-result p1

    if-ge v0, p1, :cond_5

    .line 677
    iget-object p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {p1, v0, p2, p3}, Landroid/widget/ListAdapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p1

    return-object p1

    :cond_5
    if-nez p2, :cond_6

    .line 680
    new-instance p2, Landroid/view/View;

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

    move-result-object p1

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

    .line 682
    :cond_6
    invoke-virtual {p2, v2}, Landroid/view/View;->setVisibility(I)V

    .line 683
    iget p1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->h:I

    invoke-virtual {p2, p1}, Landroid/view/View;->setMinimumHeight(I)V

    return-object p2

    :cond_7
    sub-int/2addr v0, v1

    .line 690
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->getCount()I

    move-result v1

    if-ge v0, v1, :cond_a

    .line 691
    iget-object v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    iget v3, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    div-int/2addr v0, v3

    .line 692
    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;

    iget-object v0, v0, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;->b:Landroid/view/ViewGroup;

    .line 693
    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    rem-int/2addr p1, v1

    if-nez p1, :cond_8

    return-object v0

    :cond_8
    if-nez p2, :cond_9

    .line 697
    new-instance p2, Landroid/view/View;

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

    move-result-object p1

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

    .line 701
    :cond_9
    invoke-virtual {p2, v2}, Landroid/view/View;->setVisibility(I)V

    .line 702
    invoke-virtual {v0}, Landroid/view/View;->getHeight()I

    move-result p1

    invoke-virtual {p2, p1}, Landroid/view/View;->setMinimumHeight(I)V

    return-object p2

    .line 706
    :cond_a
    new-instance p2, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {p2, p1}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>(I)V

    throw p2
.end method

.method public getViewTypeCount()I
    .locals 6

    .line 765
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    const/4 v1, 0x1

    if-nez v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0}, Landroid/widget/ListAdapter;->getViewTypeCount()I

    move-result v0

    .line 766
    :goto_0
    iget-boolean v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->j:Z

    if-eqz v2, :cond_2

    .line 767
    iget-object v2, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    add-int/2addr v2, v1

    iget-object v3, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    add-int/2addr v2, v3

    .line 768
    iget-boolean v3, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->k:Z

    if-eqz v3, :cond_1

    add-int/lit8 v2, v2, 0x1

    :cond_1
    add-int/2addr v0, v2

    .line 773
    :cond_2
    sget-boolean v2, Lcom/moji/GridViewWithHeaderAndFooter;->a:Z

    if-eqz v2, :cond_3

    const-string v2, "GridViewHeaderAndFooter"

    const-string v3, "getViewTypeCount: %s"

    .line 774
    new-array v1, v1, [Ljava/lang/Object;

    const/4 v4, 0x0

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

    move-result-object v5

    aput-object v5, v1, v4

    invoke-static {v3, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v2, v1}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

    :cond_3
    return v0
.end method

.method public getWrappedAdapter()Landroid/widget/ListAdapter;
    .locals 1

    .line 805
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    return-object v0
.end method

.method public hasStableIds()Z
    .locals 1

    .line 644
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0}, Landroid/widget/ListAdapter;->hasStableIds()Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method

.method public isEmpty()Z
    .locals 1

    .line 510
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0}, Landroid/widget/ListAdapter;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    goto :goto_1

    :cond_1
    :goto_0
    const/4 v0, 0x1

    :goto_1
    return v0
.end method

.method public isEnabled(I)Z
    .locals 4

    .line 573
    invoke-virtual {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->a()I

    move-result v0

    iget v1, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    mul-int v0, v0, v1

    const/4 v1, 0x1

    const/4 v2, 0x0

    if-ge p1, v0, :cond_1

    .line 575
    iget v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    rem-int v0, p1, v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->b:Ljava/util/ArrayList;

    iget v3, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    div-int/2addr p1, v3

    .line 576
    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;

    iget-boolean p1, p1, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;->d:Z

    if-eqz p1, :cond_0

    goto :goto_0

    :cond_0
    const/4 v1, 0x0

    :goto_0
    return v1

    :cond_1
    sub-int/2addr p1, v0

    .line 582
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v0, :cond_3

    .line 583
    invoke-direct {p0}, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->d()I

    move-result v0

    if-ge p1, v0, :cond_4

    .line 585
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0}, Landroid/widget/ListAdapter;->getCount()I

    move-result v0

    if-ge p1, v0, :cond_2

    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0, p1}, Landroid/widget/ListAdapter;->isEnabled(I)Z

    move-result p1

    if-eqz p1, :cond_2

    goto :goto_1

    :cond_2
    const/4 v1, 0x0

    :goto_1
    return v1

    :cond_3
    const/4 v0, 0x0

    :cond_4
    sub-int/2addr p1, v0

    .line 591
    iget v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    rem-int v0, p1, v0

    if-nez v0, :cond_5

    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->c:Ljava/util/ArrayList;

    iget v3, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->g:I

    div-int/2addr p1, v3

    .line 592
    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;

    iget-boolean p1, p1, Lcom/moji/GridViewWithHeaderAndFooter$FixedViewInfo;->d:Z

    if-eqz p1, :cond_5

    goto :goto_2

    :cond_5
    const/4 v1, 0x0

    :goto_2
    return v1
.end method

.method public registerDataSetObserver(Landroid/database/DataSetObserver;)V
    .locals 1

    .line 781
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->e:Landroid/database/DataSetObservable;

    invoke-virtual {v0, p1}, Landroid/database/DataSetObservable;->registerObserver(Ljava/lang/Object;)V

    .line 782
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v0, :cond_0

    .line 783
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0, p1}, Landroid/widget/ListAdapter;->registerDataSetObserver(Landroid/database/DataSetObserver;)V

    :cond_0
    return-void
.end method

.method public unregisterDataSetObserver(Landroid/database/DataSetObserver;)V
    .locals 1

    .line 789
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->e:Landroid/database/DataSetObservable;

    invoke-virtual {v0, p1}, Landroid/database/DataSetObservable;->unregisterObserver(Ljava/lang/Object;)V

    .line 790
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    if-eqz v0, :cond_0

    .line 791
    iget-object v0, p0, Lcom/moji/GridViewWithHeaderAndFooter$HeaderViewGridAdapter;->f:Landroid/widget/ListAdapter;

    invoke-interface {v0, p1}, Landroid/widget/ListAdapter;->unregisterDataSetObserver(Landroid/database/DataSetObserver;)V

    :cond_0
    return-void
.end method
