.class public Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;
.super Landroid/support/v4/widget/NestedScrollView;
.source "TyphoonScrollView.java"


# instance fields
.field private a:I

.field private b:I

.field private c:Landroid/widget/OverScroller;


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

    const/4 v0, 0x0

    .line 33
    invoke-direct {p0, p1, v0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

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

    const/4 v0, 0x0

    .line 37
    invoke-direct {p0, p1, p2, v0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

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

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

    const/4 p2, 0x0

    .line 26
    iput p2, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    .line 42
    new-instance p2, Landroid/widget/OverScroller;

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

    iput-object p2, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->c:Landroid/widget/OverScroller;

    const/4 p2, 0x2

    .line 43
    invoke-virtual {p0, p2}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->setOverScrollMode(I)V

    .line 44
    invoke-static {p1}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;

    move-result-object p1

    invoke-virtual {p1}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I

    move-result p1

    iput p1, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->b:I

    return-void
.end method


# virtual methods
.method public a(II)V
    .locals 6

    if-eqz p2, :cond_0

    .line 118
    iput p2, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    const-string v0, "scrollX"

    const/4 v1, 0x1

    .line 119
    new-array v2, v1, [I

    const/4 v3, 0x0

    aput p1, v2, v3

    invoke-static {p0, v0, v2}, Landroid/animation/ObjectAnimator;->ofInt(Ljava/lang/Object;Ljava/lang/String;[I)Landroid/animation/ObjectAnimator;

    move-result-object p1

    const-string v0, "scrollY"

    .line 120
    new-array v2, v1, [I

    aput p2, v2, v3

    invoke-static {p0, v0, v2}, Landroid/animation/ObjectAnimator;->ofInt(Ljava/lang/Object;Ljava/lang/String;[I)Landroid/animation/ObjectAnimator;

    move-result-object p2

    .line 122
    new-instance v0, Landroid/animation/AnimatorSet;

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

    const-wide/16 v4, 0x190

    .line 123
    invoke-virtual {v0, v4, v5}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;

    const/4 v2, 0x2

    .line 124
    new-array v2, v2, [Landroid/animation/Animator;

    aput-object p1, v2, v3

    aput-object p2, v2, v1

    invoke-virtual {v0, v2}, Landroid/animation/AnimatorSet;->playTogether([Landroid/animation/Animator;)V

    .line 125
    new-instance p1, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView$1;

    invoke-direct {p1, p0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView$1;-><init>(Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;)V

    invoke-virtual {v0, p1}, Landroid/animation/AnimatorSet;->addListener(Landroid/animation/Animator$AnimatorListener;)V

    .line 143
    invoke-virtual {v0}, Landroid/animation/AnimatorSet;->start()V

    :cond_0
    return-void
.end method

.method public computeScroll()V
    .locals 2

    .line 104
    iget-object v0, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->c:Landroid/widget/OverScroller;

    invoke-virtual {v0}, Landroid/widget/OverScroller;->computeScrollOffset()Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    .line 105
    iget-object v1, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->c:Landroid/widget/OverScroller;

    invoke-virtual {v1}, Landroid/widget/OverScroller;->getCurrY()I

    move-result v1

    invoke-virtual {p0, v0, v1}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->scrollTo(II)V

    .line 106
    invoke-virtual {p0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->invalidate()V

    :cond_0
    return-void
.end method

.method public fling(I)V
    .locals 9

    .line 85
    iget-object v0, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->c:Landroid/widget/OverScroller;

    invoke-virtual {p0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->getScrollY()I

    move-result v2

    iget v8, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    const/4 v1, 0x0

    const/4 v3, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    move v4, p1

    invoke-virtual/range {v0 .. v8}, Landroid/widget/OverScroller;->fling(IIIIIIII)V

    .line 86
    invoke-virtual {p0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->invalidate()V

    return-void
.end method

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

    const-string v0, "TyphoonScrollView"

    const-string v1, "onNestedFling: "

    .line 71
    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 72
    invoke-super {p0, p1, p2, p3, p4}, Landroid/support/v4/widget/NestedScrollView;->onNestedFling(Landroid/view/View;FFZ)Z

    move-result p1

    return p1
.end method

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

    const-string p1, "TyphoonScrollView"

    const-string p2, "onNestedPreFling"

    .line 77
    invoke-static {p1, p2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 78
    invoke-virtual {p0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->getScrollY()I

    move-result p1

    iget p2, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    if-lt p1, p2, :cond_0

    const/4 p1, 0x0

    return p1

    :cond_0
    float-to-int p1, p3

    .line 79
    invoke-virtual {p0, p1}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->fling(I)V

    const/4 p1, 0x1

    return p1
.end method

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

    const-string p2, "TyphoonScrollView"

    const-string v0, "onNestedPreScroll"

    .line 55
    invoke-static {p2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 56
    iget p2, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    const/4 v0, 0x0

    if-nez p2, :cond_0

    .line 57
    invoke-virtual {p0, v0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->getChildAt(I)Landroid/view/View;

    move-result-object p2

    check-cast p2, Landroid/widget/LinearLayout;

    invoke-virtual {p2, v0}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object p2

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

    move-result p2

    iput p2, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    :cond_0
    const/4 p2, 0x1

    if-lez p3, :cond_1

    .line 59
    invoke-virtual {p0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->getScrollY()I

    move-result v1

    iget v2, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    if-ge v1, v2, :cond_1

    const/4 v1, 0x1

    goto :goto_0

    :cond_1
    const/4 v1, 0x0

    :goto_0
    if-gez p3, :cond_2

    .line 60
    invoke-virtual {p0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->getScrollY()I

    move-result v2

    if-ltz v2, :cond_2

    const/4 v2, -0x1

    invoke-static {p1, v2}, Landroid/support/v4/view/ViewCompat;->canScrollVertically(Landroid/view/View;I)Z

    move-result p1

    if-nez p1, :cond_2

    const/4 p1, 0x1

    goto :goto_1

    :cond_2
    const/4 p1, 0x0

    :goto_1
    if-nez v1, :cond_3

    if-eqz p1, :cond_4

    .line 63
    :cond_3
    invoke-virtual {p0, v0, p3}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->scrollBy(II)V

    .line 64
    aput p3, p4, p2

    :cond_4
    return-void
.end method

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

    const-string v0, "TyphoonScrollView"

    const-string v1, "onNestedScroll"

    .line 49
    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 50
    invoke-super/range {p0 .. p5}, Landroid/support/v4/widget/NestedScrollView;->onNestedScroll(Landroid/view/View;IIII)V

    return-void
.end method

.method public scrollTo(II)V
    .locals 1

    if-gez p2, :cond_0

    const/4 p2, 0x0

    .line 94
    :cond_0
    iget v0, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    if-le p2, v0, :cond_1

    .line 95
    iget p2, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    .line 97
    :cond_1
    invoke-virtual {p0}, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->getScrollY()I

    move-result v0

    if-eq p2, v0, :cond_2

    .line 98
    invoke-super {p0, p1, p2}, Landroid/support/v4/widget/NestedScrollView;->scrollTo(II)V

    :cond_2
    return-void
.end method

.method public setTopViewHeight(I)V
    .locals 0

    if-eqz p1, :cond_0

    .line 112
    iput p1, p0, Lcom/moji/mjweather/typhoon/view/TyphoonScrollView;->a:I

    :cond_0
    return-void
.end method
