.class Lcom/moji/forum/ui/TopicActivity$5;
.super Ljava/lang/Object;
.source "TopicActivity.java"

# interfaces
.implements Landroid/widget/AbsListView$OnScrollListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/moji/forum/ui/TopicActivity;->a()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic a:Lcom/moji/forum/ui/TopicActivity;

.field private b:Z


# direct methods
.method constructor <init>(Lcom/moji/forum/ui/TopicActivity;)V
    .locals 0

    .line 489
    iput-object p1, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

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

    return-void
.end method


# virtual methods
.method public onScroll(Landroid/widget/AbsListView;III)V
    .locals 4

    .line 519
    iget-object v0, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {v0}, Lcom/moji/forum/ui/TopicActivity;->j(Lcom/moji/forum/ui/TopicActivity;)Ljava/util/ArrayList;

    move-result-object v0

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

    move-result v0

    const/4 v1, 0x0

    if-lez v0, :cond_0

    if-eqz p4, :cond_0

    add-int v0, p2, p3

    if-lt v0, p4, :cond_0

    iget-object v0, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {v0}, Lcom/moji/forum/ui/TopicActivity;->g(Lcom/moji/forum/ui/TopicActivity;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    .line 520
    invoke-static {v0}, Lcom/moji/forum/ui/TopicActivity;->k(Lcom/moji/forum/ui/TopicActivity;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "lijf"

    const-string v2, "onScroll   loadPostList(false)"

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

    .line 522
    iget-object v0, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {v0, v1, v1}, Lcom/moji/forum/ui/TopicActivity;->a(Lcom/moji/forum/ui/TopicActivity;ZZ)V

    :cond_0
    const/16 v0, 0xa

    if-le p2, v0, :cond_2

    .line 525
    iget-object v0, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {v0}, Lcom/moji/forum/ui/TopicActivity;->l(Lcom/moji/forum/ui/TopicActivity;)Landroid/widget/ImageView;

    move-result-object v0

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

    const/16 v0, 0xb

    if-ne p2, v0, :cond_1

    .line 527
    invoke-virtual {p1, v1}, Landroid/widget/AbsListView;->getChildAt(I)Landroid/view/View;

    move-result-object p2

    .line 528
    iget-object v0, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {v0}, Lcom/moji/forum/ui/TopicActivity;->l(Lcom/moji/forum/ui/TopicActivity;)Landroid/widget/ImageView;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    const/high16 v2, 0x437f0000    # 255.0f

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

    move-result v3

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

    move-result v3

    int-to-float v3, v3

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

    move-result p2

    int-to-float p2, p2

    div-float/2addr v3, p2

    const/high16 p2, 0x3f800000    # 1.0f

    invoke-static {v3, p2}, Ljava/lang/Math;->min(FF)F

    move-result p2

    mul-float p2, p2, v2

    float-to-int p2, p2

    invoke-virtual {v0, p2}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V

    goto :goto_0

    .line 530
    :cond_1
    iget-object p2, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p2}, Lcom/moji/forum/ui/TopicActivity;->l(Lcom/moji/forum/ui/TopicActivity;)Landroid/widget/ImageView;

    move-result-object p2

    invoke-virtual {p2}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object p2

    const/16 v0, 0xff

    invoke-virtual {p2, v0}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V

    goto :goto_0

    .line 532
    :cond_2
    iget-object p2, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p2}, Lcom/moji/forum/ui/TopicActivity;->l(Lcom/moji/forum/ui/TopicActivity;)Landroid/widget/ImageView;

    move-result-object p2

    const/16 v0, 0x8

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

    .line 533
    :goto_0
    invoke-virtual {p1}, Landroid/widget/AbsListView;->getLastVisiblePosition()I

    move-result p2

    const/4 v0, 0x1

    sub-int/2addr p4, v0

    if-ne p2, p4, :cond_3

    sub-int/2addr p3, v0

    invoke-virtual {p1, p3}, Landroid/widget/AbsListView;->getChildAt(I)Landroid/view/View;

    move-result-object p2

    if-eqz p2, :cond_3

    .line 534
    invoke-virtual {p1, p3}, Landroid/widget/AbsListView;->getChildAt(I)Landroid/view/View;

    move-result-object p1

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

    move-result p1

    iget-object p2, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p2}, Lcom/moji/forum/ui/TopicActivity;->h(Lcom/moji/forum/ui/TopicActivity;)Landroid/widget/ListView;

    move-result-object p2

    invoke-virtual {p2}, Landroid/widget/ListView;->getHeight()I

    move-result p2

    if-gt p1, p2, :cond_3

    const-string p1, "lijf"

    const-string p2, "isScrollToBottom = true"

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

    .line 536
    iput-boolean v0, p0, Lcom/moji/forum/ui/TopicActivity$5;->b:Z

    goto :goto_1

    .line 538
    :cond_3
    iput-boolean v1, p0, Lcom/moji/forum/ui/TopicActivity$5;->b:Z

    :goto_1
    return-void
.end method

.method public onScrollStateChanged(Landroid/widget/AbsListView;I)V
    .locals 2

    const/4 p1, 0x1

    if-ne p2, p1, :cond_0

    .line 495
    iget-object p1, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p1}, Lcom/moji/forum/ui/TopicActivity;->a(Lcom/moji/forum/ui/TopicActivity;)Lcom/moji/forum/view/AutoHeightLayout;

    move-result-object p1

    invoke-virtual {p1}, Lcom/moji/forum/view/AutoHeightLayout;->a()Z

    move-result p1

    if-eqz p1, :cond_0

    .line 496
    iget-object p1, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p1}, Lcom/moji/forum/ui/TopicActivity;->a(Lcom/moji/forum/ui/TopicActivity;)Lcom/moji/forum/view/AutoHeightLayout;

    move-result-object p1

    invoke-virtual {p1}, Lcom/moji/forum/view/AutoHeightLayout;->b()V

    .line 497
    iget-object p1, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p1}, Lcom/moji/forum/ui/TopicActivity;->f(Lcom/moji/forum/ui/TopicActivity;)Landroid/widget/ImageButton;

    move-result-object p1

    sget v0, Lcom/moji/forum/R$drawable;->add_emotion_forum:I

    invoke-virtual {p1, v0}, Landroid/widget/ImageButton;->setBackgroundResource(I)V

    :cond_0
    if-eqz p2, :cond_1

    const/4 p1, 0x2

    if-ne p2, p1, :cond_4

    .line 501
    :cond_1
    iget-boolean p1, p0, Lcom/moji/forum/ui/TopicActivity$5;->b:Z

    if-eqz p1, :cond_2

    iget-object p1, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p1}, Lcom/moji/forum/ui/TopicActivity;->g(Lcom/moji/forum/ui/TopicActivity;)Z

    move-result p1

    if-nez p1, :cond_2

    .line 502
    iget-object p1, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    const/4 v0, 0x0

    invoke-static {p1, v0, v0}, Lcom/moji/forum/ui/TopicActivity;->a(Lcom/moji/forum/ui/TopicActivity;ZZ)V

    .line 505
    :cond_2
    iget-object p1, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p1}, Lcom/moji/forum/ui/TopicActivity;->h(Lcom/moji/forum/ui/TopicActivity;)Landroid/widget/ListView;

    move-result-object p1

    invoke-virtual {p1}, Landroid/widget/ListView;->getLastVisiblePosition()I

    move-result p1

    if-nez p2, :cond_4

    .line 506
    iget-object p2, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p2}, Lcom/moji/forum/ui/TopicActivity;->i(Lcom/moji/forum/ui/TopicActivity;)I

    move-result p2

    if-eq p2, p1, :cond_4

    .line 507
    iget-object p2, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p2}, Lcom/moji/forum/ui/TopicActivity;->i(Lcom/moji/forum/ui/TopicActivity;)I

    move-result p2

    if-le p2, p1, :cond_3

    .line 508
    invoke-static {}, Lcom/moji/statistics/EventManager;->a()Lcom/moji/statistics/EventManager;

    move-result-object p2

    sget-object v0, Lcom/moji/statistics/EVENT_TAG;->POST_PULL_SHOW:Lcom/moji/statistics/EVENT_TAG;

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

    move-result-object v1

    invoke-virtual {p2, v0, v1}, Lcom/moji/statistics/EventManager;->a(Lcom/moji/statistics/EVENT_TAG;Ljava/lang/String;)Lcom/moji/statistics/EventManager;

    goto :goto_0

    .line 510
    :cond_3
    invoke-static {}, Lcom/moji/statistics/EventManager;->a()Lcom/moji/statistics/EventManager;

    move-result-object p2

    sget-object v0, Lcom/moji/statistics/EVENT_TAG;->POST_SLIDE_SHOW:Lcom/moji/statistics/EVENT_TAG;

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

    move-result-object v1

    invoke-virtual {p2, v0, v1}, Lcom/moji/statistics/EventManager;->a(Lcom/moji/statistics/EVENT_TAG;Ljava/lang/String;)Lcom/moji/statistics/EventManager;

    .line 512
    :goto_0
    iget-object p2, p0, Lcom/moji/forum/ui/TopicActivity$5;->a:Lcom/moji/forum/ui/TopicActivity;

    invoke-static {p2, p1}, Lcom/moji/forum/ui/TopicActivity;->a(Lcom/moji/forum/ui/TopicActivity;I)I

    :cond_4
    return-void
.end method
