.class public Lcom/moji/mjweather/weather/view/IndexListView;
.super Landroid/widget/ListView;
.source "IndexListView.java"

# interfaces
.implements Landroid/support/v4/view/NestedScrollingParent;


# instance fields
.field private a:Landroid/support/v4/view/NestedScrollingParentHelper;

.field private b:I

.field private c:Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

.field private d:I


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

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

    .line 28
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->c()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0

    .line 32
    invoke-direct {p0, p1, p2}, Landroid/widget/ListView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 33
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->c()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0

    .line 37
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ListView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 38
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->c()V

    return-void
.end method

.method private a(I)I
    .locals 3

    const/4 v0, 0x0

    if-lez p1, :cond_0

    .line 200
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getLastVisiblePosition()I

    move-result v1

    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getAdapter()Landroid/widget/ListAdapter;

    move-result-object v2

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

    move-result v2

    add-int/lit8 v2, v2, -0x1

    if-ne v1, v2, :cond_2

    .line 201
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getChildCount()I

    move-result v1

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

    invoke-virtual {p0, v1}, Lcom/moji/mjweather/weather/view/IndexListView;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    if-eqz v1, :cond_2

    .line 203
    invoke-virtual {v1}, Landroid/view/View;->getTop()I

    move-result v1

    if-lez v1, :cond_2

    .line 205
    invoke-static {v1, p1}, Ljava/lang/Math;->min(II)I

    move-result p1

    return p1

    .line 211
    :cond_0
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getAdapter()Landroid/widget/ListAdapter;

    move-result-object v1

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

    move-result v1

    if-lez v1, :cond_2

    .line 212
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFirstVisiblePosition()I

    move-result v1

    if-eqz v1, :cond_1

    return p1

    .line 215
    :cond_1
    invoke-virtual {p0, v0}, Lcom/moji/mjweather/weather/view/IndexListView;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    if-eqz v1, :cond_2

    .line 217
    invoke-virtual {v1}, Landroid/view/View;->getTop()I

    move-result v1

    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getPaddingTop()I

    move-result v2

    sub-int/2addr v1, v2

    if-gez v1, :cond_2

    .line 219
    invoke-static {p1, v1}, Ljava/lang/Math;->max(II)I

    move-result p1

    return p1

    :cond_2
    return v0
.end method

.method static synthetic a(Lcom/moji/mjweather/weather/view/IndexListView;I)I
    .locals 0

    .line 19
    iput p1, p0, Lcom/moji/mjweather/weather/view/IndexListView;->d:I

    return p1
.end method

.method private static a(Landroid/view/View;)Z
    .locals 2

    .line 161
    instance-of v0, p0, Landroid/widget/AbsListView;

    if-eqz v0, :cond_2

    .line 162
    check-cast p0, Landroid/widget/AbsListView;

    .line 163
    invoke-virtual {p0}, Landroid/widget/AbsListView;->getChildCount()I

    move-result v0

    const/4 v1, 0x0

    if-lez v0, :cond_1

    .line 164
    invoke-virtual {p0}, Landroid/widget/AbsListView;->getFirstVisiblePosition()I

    move-result v0

    if-gtz v0, :cond_0

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

    move-result-object v0

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

    move-result v0

    invoke-virtual {p0}, Landroid/widget/AbsListView;->getPaddingTop()I

    move-result p0

    if-ge v0, p0, :cond_1

    :cond_0
    const/4 v1, 0x1

    :cond_1
    return v1

    :cond_2
    const/4 v0, -0x1

    .line 168
    invoke-static {p0, v0}, Landroid/support/v4/view/ViewCompat;->canScrollVertically(Landroid/view/View;I)Z

    move-result p0

    return p0
.end method

.method private c()V
    .locals 1

    .line 42
    new-instance v0, Landroid/support/v4/view/NestedScrollingParentHelper;

    invoke-direct {v0, p0}, Landroid/support/v4/view/NestedScrollingParentHelper;-><init>(Landroid/view/ViewGroup;)V

    iput-object v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->a:Landroid/support/v4/view/NestedScrollingParentHelper;

    .line 43
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/ViewConfiguration;->getScaledMinimumFlingVelocity()I

    move-result v0

    iput v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->b:I

    .line 44
    new-instance v0, Lcom/moji/mjweather/weather/view/IndexListView$1;

    invoke-direct {v0, p0}, Lcom/moji/mjweather/weather/view/IndexListView$1;-><init>(Lcom/moji/mjweather/weather/view/IndexListView;)V

    invoke-virtual {p0, v0}, Lcom/moji/mjweather/weather/view/IndexListView;->setOnScrollListener(Landroid/widget/AbsListView$OnScrollListener;)V

    return-void
.end method

.method private getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;
    .locals 1

    .line 229
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->c:Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    if-eqz v0, :cond_0

    .line 230
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->c:Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    return-object v0

    .line 232
    :cond_0
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    check-cast v0, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    iput-object v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->c:Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    .line 233
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->c:Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    return-object v0
.end method


# virtual methods
.method public a()Z
    .locals 3

    .line 175
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getChildCount()I

    move-result v0

    const/4 v1, 0x1

    if-lez v0, :cond_1

    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getLastVisiblePosition()I

    move-result v0

    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getAdapter()Landroid/widget/ListAdapter;

    move-result-object v2

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

    move-result v2

    sub-int/2addr v2, v1

    if-ne v0, v2, :cond_1

    .line 176
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getChildCount()I

    move-result v0

    sub-int/2addr v0, v1

    invoke-virtual {p0, v0}, Lcom/moji/mjweather/weather/view/IndexListView;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    if-eqz v0, :cond_1

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

    move-result v0

    if-lez v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v1, 0x0

    :goto_0
    return v1

    :cond_1
    return v1
.end method

.method public b()Z
    .locals 2

    .line 185
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getChildCount()I

    move-result v0

    const/4 v1, 0x0

    if-lez v0, :cond_1

    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFirstVisiblePosition()I

    move-result v0

    if-nez v0, :cond_1

    .line 186
    invoke-virtual {p0, v1}, Lcom/moji/mjweather/weather/view/IndexListView;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    if-eqz v0, :cond_1

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

    move-result v0

    if-nez v0, :cond_0

    const/4 v1, 0x1

    :cond_0
    return v1

    :cond_1
    return v1
.end method

.method public canScrollList(I)Z
    .locals 0

    .line 157
    invoke-super {p0, p1}, Landroid/widget/ListView;->canScrollList(I)Z

    move-result p1

    return p1
.end method

.method public getLastScrollY()I
    .locals 1

    .line 195
    iget v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->d:I

    return v0
.end method

.method public getNestedScrollAxes()I
    .locals 1

    .line 152
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->a:Landroid/support/v4/view/NestedScrollingParentHelper;

    invoke-virtual {v0}, Landroid/support/v4/view/NestedScrollingParentHelper;->getNestedScrollAxes()I

    move-result v0

    return v0
.end method

.method public onNestedFling(Landroid/view/View;FFZ)Z
    .locals 0

    .line 121
    invoke-static {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->a(Landroid/view/View;)Z

    move-result p1

    if-eqz p1, :cond_0

    if-nez p4, :cond_0

    .line 122
    invoke-static {p3}, Ljava/lang/Math;->abs(F)F

    move-result p1

    iget p2, p0, Lcom/moji/mjweather/weather/view/IndexListView;->b:I

    int-to-float p2, p2

    cmpl-float p1, p1, p2

    if-lez p1, :cond_0

    .line 123
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p1

    const/4 p2, 0x2

    invoke-virtual {p1, p2}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->a(I)V

    .line 124
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p1

    float-to-int p2, p3

    invoke-virtual {p1, p2}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->b(I)V

    const/4 p1, 0x1

    return p1

    :cond_0
    const/4 p1, 0x0

    return p1
.end method

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

    const/4 p2, 0x0

    const/4 v0, 0x0

    cmpg-float v1, p3, v0

    if-gez v1, :cond_0

    .line 134
    invoke-static {p1}, Lcom/moji/mjweather/weather/view/IndexListView;->a(Landroid/view/View;)Z

    move-result p1

    if-eqz p1, :cond_0

    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->a()Z

    move-result p1

    if-nez p1, :cond_0

    return p2

    :cond_0
    const/4 p1, 0x1

    const/4 v1, 0x2

    cmpl-float v2, p3, v0

    if-lez v2, :cond_1

    .line 138
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->a()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 139
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p2

    invoke-virtual {p2, v1}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->a(I)V

    .line 140
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p2

    float-to-int p3, p3

    invoke-virtual {p2, p3}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->b(I)V

    return p1

    :cond_1
    cmpg-float v0, p3, v0

    if-gez v0, :cond_2

    .line 142
    invoke-static {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->a(Landroid/view/View;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 143
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p2

    invoke-virtual {p2, v1}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->a(I)V

    .line 144
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p2

    float-to-int p3, p3

    invoke-virtual {p2, p3}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->b(I)V

    return p1

    :cond_2
    return p2
.end method

.method public onNestedPreScroll(Landroid/view/View;II[I)V
    .locals 0

    if-gez p3, :cond_0

    .line 92
    invoke-static {p1}, Lcom/moji/mjweather/weather/view/IndexListView;->a(Landroid/view/View;)Z

    move-result p1

    if-eqz p1, :cond_0

    return-void

    :cond_0
    const/4 p1, 0x1

    if-lez p3, :cond_2

    .line 99
    invoke-direct {p0, p3}, Lcom/moji/mjweather/weather/view/IndexListView;->a(I)I

    move-result p2

    if-eqz p2, :cond_1

    .line 101
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p3

    invoke-virtual {p3, p1}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->a(I)V

    .line 103
    :cond_1
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p3

    invoke-virtual {p3, p2}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->c(I)V

    .line 104
    aput p2, p4, p1

    goto :goto_0

    :cond_2
    if-gez p3, :cond_4

    .line 108
    invoke-direct {p0, p3}, Lcom/moji/mjweather/weather/view/IndexListView;->a(I)I

    move-result p2

    if-eqz p2, :cond_3

    .line 111
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p3

    invoke-virtual {p3, p1}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->a(I)V

    .line 113
    :cond_3
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p3

    invoke-virtual {p3, p2}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->c(I)V

    .line 114
    aput p2, p4, p1

    :cond_4
    :goto_0
    return-void
.end method

.method public onNestedScroll(Landroid/view/View;IIII)V
    .locals 0

    .line 80
    invoke-static {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->a(Landroid/view/View;)Z

    move-result p1

    if-eqz p1, :cond_0

    .line 82
    invoke-direct {p0, p5}, Lcom/moji/mjweather/weather/view/IndexListView;->a(I)I

    move-result p1

    .line 83
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p2

    invoke-virtual {p2, p1}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->c(I)V

    :cond_0
    return-void
.end method

.method public onNestedScrollAccepted(Landroid/view/View;Landroid/view/View;I)V
    .locals 1

    .line 68
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->a:Landroid/support/v4/view/NestedScrollingParentHelper;

    invoke-virtual {v0, p1, p2, p3}, Landroid/support/v4/view/NestedScrollingParentHelper;->onNestedScrollAccepted(Landroid/view/View;Landroid/view/View;I)V

    return-void
.end method

.method protected onSizeChanged(IIII)V
    .locals 0

    .line 239
    invoke-super {p0, p1, p2, p3, p4}, Landroid/widget/ListView;->onSizeChanged(IIII)V

    if-eq p2, p4, :cond_0

    .line 241
    invoke-static {p2}, Lcom/moji/mjweather/weather/WeatherSizeHelper;->a(I)V

    :cond_0
    return-void
.end method

.method public onStartNestedScroll(Landroid/view/View;Landroid/view/View;I)Z
    .locals 0

    .line 62
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->isEnabled()Z

    move-result p1

    if-eqz p1, :cond_0

    and-int/lit8 p1, p3, 0x2

    if-eqz p1, :cond_0

    const/4 p1, 0x1

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    :goto_0
    return p1
.end method

.method public onStopNestedScroll(Landroid/view/View;)V
    .locals 2

    .line 73
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/IndexListView;->a:Landroid/support/v4/view/NestedScrollingParentHelper;

    invoke-virtual {v0, p1}, Landroid/support/v4/view/NestedScrollingParentHelper;->onStopNestedScroll(Landroid/view/View;)V

    .line 74
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p1

    const/4 v0, 0x1

    invoke-virtual {p1, v0}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->setIsForAbsorb(Z)V

    .line 75
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object p1

    const/4 v1, 0x0

    invoke-virtual {p1, v1, v0}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->a(IZ)V

    return-void
.end method

.method public requestDisallowInterceptTouchEvent(Z)V
    .locals 1

    .line 247
    invoke-super {p0, p1}, Landroid/widget/ListView;->requestDisallowInterceptTouchEvent(Z)V

    .line 248
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/IndexListView;->getFrameLayout()Lcom/moji/mjweather/weather/view/HomePageFrameLayout;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/moji/mjweather/weather/view/HomePageFrameLayout;->a(Z)V

    return-void
.end method
