SmartRefreshHorizontal.smali

.class public Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;
.super Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;
.source "SmartRefreshHorizontal.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal$a;
    }
.end annotation


# static fields
.field protected static sFooterCreator:Lcom/scwang/smartrefresh/layout/a/a;

.field protected static sHeaderCreator:Lcom/scwang/smartrefresh/layout/a/b;

.field protected static sRefreshInitializer:Lcom/scwang/smartrefresh/layout/a/c;


# instance fields
.field protected isInLayout:Z


# direct methods
.method static constructor <clinit>()V
    .registers 0

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .registers 3

    const/4 v0, 0x0

    .line 1
    invoke-direct {p0, p1, v0}, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

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

    .line 2
    invoke-static {p1}, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->wrapper(Landroid/content/Context;)Landroid/content/Context;

    invoke-direct {p0, p1, p2}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/4 p1, 0x0

    .line 3
    iput-boolean p1, p0, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->isInLayout:Z

    .line 4
    new-instance p1, Lcom/scwang/smartrefresh/horizontal/b;

    invoke-direct {p1}, Lcom/scwang/smartrefresh/horizontal/b;-><init>()V

    invoke-virtual {p0, p1}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->setScrollBoundaryDecider(Lcom/scwang/smartrefresh/layout/a/k;)Lcom/scwang/smartrefresh/layout/a/j;

    return-void
.end method

.method public static setDefaultRefreshFooterCreator(Lcom/scwang/smartrefresh/layout/a/a;)V
    .registers 1

    .line 1
    sput-object p0, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->sFooterCreator:Lcom/scwang/smartrefresh/layout/a/a;

    return-void
.end method

.method public static setDefaultRefreshHeaderCreator(Lcom/scwang/smartrefresh/layout/a/b;)V
    .registers 1

    .line 1
    sput-object p0, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->sHeaderCreator:Lcom/scwang/smartrefresh/layout/a/b;

    return-void
.end method

.method public static setDefaultRefreshInitializer(Lcom/scwang/smartrefresh/layout/a/c;)V
    .registers 1

    .line 1
    sput-object p0, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->sRefreshInitializer:Lcom/scwang/smartrefresh/layout/a/c;

    return-void
.end method

.method protected static wrapper(Landroid/content/Context;)Landroid/content/Context;
    .registers 4

    .line 1
    sget-object v0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->sRefreshInitializer:Lcom/scwang/smartrefresh/layout/a/c;

    .line 2
    new-instance v1, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal$a;

    sget-object v2, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->sRefreshInitializer:Lcom/scwang/smartrefresh/layout/a/c;

    invoke-direct {v1, v2, v0}, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal$a;-><init>(Lcom/scwang/smartrefresh/layout/a/c;Lcom/scwang/smartrefresh/layout/a/c;)V

    invoke-static {v1}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->setDefaultRefreshInitializer(Lcom/scwang/smartrefresh/layout/a/c;)V

    return-object p0
.end method


# virtual methods
.method protected isRefreshComponent(Landroid/view/View;)Z
    .registers 4

    .line 1
    iget-object v0, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshHeader:Lcom/scwang/smartrefresh/layout/a/h;

    .line 2
    iget-object v1, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshFooter:Lcom/scwang/smartrefresh/layout/a/h;

    if-eqz v0, :cond_e

    if-eq p1, v0, :cond_18

    .line 3
    invoke-interface {v0}, Lcom/scwang/smartrefresh/layout/a/h;->getView()Landroid/view/View;

    move-result-object v0

    if-eq p1, v0, :cond_18

    :cond_e
    if-eqz v1, :cond_1a

    if-eq p1, v1, :cond_18

    .line 4
    invoke-interface {v1}, Lcom/scwang/smartrefresh/layout/a/h;->getView()Landroid/view/View;

    move-result-object v0

    if-ne p1, v0, :cond_1a

    :cond_18
    const/4 p1, 0x1

    goto :goto_1b

    :cond_1a
    const/4 p1, 0x0

    :goto_1b
    return p1
.end method

.method protected onAttachedToWindow()V
    .registers 5

    .line 1
    sget-object v0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->sHeaderCreator:Lcom/scwang/smartrefresh/layout/a/b;

    .line 2
    sget-object v1, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->sFooterCreator:Lcom/scwang/smartrefresh/layout/a/a;

    .line 3
    sget-object v2, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->sHeaderCreator:Lcom/scwang/smartrefresh/layout/a/b;

    invoke-static {v2}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->setDefaultRefreshHeaderCreator(Lcom/scwang/smartrefresh/layout/a/b;)V

    .line 4
    sget-object v2, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->sFooterCreator:Lcom/scwang/smartrefresh/layout/a/a;

    invoke-static {v2}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->setDefaultRefreshFooterCreator(Lcom/scwang/smartrefresh/layout/a/a;)V

    .line 5
    invoke-super {p0}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->onAttachedToWindow()V

    .line 6
    invoke-static {v0}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->setDefaultRefreshHeaderCreator(Lcom/scwang/smartrefresh/layout/a/b;)V

    .line 7
    invoke-static {v1}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->setDefaultRefreshFooterCreator(Lcom/scwang/smartrefresh/layout/a/a;)V

    .line 8
    iget-object v0, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshContent:Lcom/scwang/smartrefresh/layout/a/e;

    if-eqz v0, :cond_52

    instance-of v1, v0, Lcom/scwang/smartrefresh/horizontal/a;

    if-nez v1, :cond_52

    .line 9
    new-instance v1, Lcom/scwang/smartrefresh/horizontal/a;

    invoke-interface {v0}, Lcom/scwang/smartrefresh/layout/a/e;->getView()Landroid/view/View;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/scwang/smartrefresh/horizontal/a;-><init>(Landroid/view/View;)V

    iput-object v1, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshContent:Lcom/scwang/smartrefresh/layout/a/e;

    .line 10
    iget v0, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mFixedHeaderViewId:I

    const/4 v1, 0x0

    if-lez v0, :cond_34

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

    move-result-object v0

    goto :goto_35

    :cond_34
    move-object v0, v1

    .line 11
    :goto_35
    iget v2, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mFixedFooterViewId:I

    if-lez v2, :cond_3d

    invoke-virtual {p0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    .line 12
    :cond_3d
    iget-object v2, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshContent:Lcom/scwang/smartrefresh/layout/a/e;

    iget-object v3, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mScrollBoundaryDecider:Lcom/scwang/smartrefresh/layout/a/k;

    invoke-interface {v2, v3}, Lcom/scwang/smartrefresh/layout/a/e;->a(Lcom/scwang/smartrefresh/layout/a/k;)V

    .line 13
    iget-object v2, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshContent:Lcom/scwang/smartrefresh/layout/a/e;

    iget-boolean v3, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mEnableLoadMoreWhenContentNotFull:Z

    invoke-interface {v2, v3}, Lcom/scwang/smartrefresh/layout/a/e;->a(Z)V

    .line 14
    iget-object v2, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshContent:Lcom/scwang/smartrefresh/layout/a/e;

    iget-object v3, p0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mKernel:Lcom/scwang/smartrefresh/layout/a/i;

    invoke-interface {v2, v3, v0, v1}, Lcom/scwang/smartrefresh/layout/a/e;->a(Lcom/scwang/smartrefresh/layout/a/i;Landroid/view/View;Landroid/view/View;)V

    :cond_52
    const/high16 v0, -0x3d4c0000    # -90.0f

    .line 15
    invoke-virtual {p0, v0}, Landroid/view/View;->setRotation(F)V

    return-void
.end method

.method protected onLayout(ZIIII)V
    .registers 18

    move-object v0, p0

    sub-int v1, p4, p2

    sub-int v2, p5, p3

    sub-int v3, v2, v1

    .line 1
    div-int/lit8 v3, v3, 0x2

    .line 2
    iget-boolean v4, v0, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->isInLayout:Z

    const/4 v5, 0x0

    if-eqz v4, :cond_71

    .line 3
    iget-object v2, v0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshHeader:Lcom/scwang/smartrefresh/layout/a/h;

    .line 4
    iget-object v2, v0, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->mRefreshFooter:Lcom/scwang/smartrefresh/layout/a/h;

    .line 5
    invoke-virtual {p0}, Landroid/view/View;->getPaddingLeft()I

    move-result v2

    .line 6
    invoke-virtual {p0}, Landroid/view/View;->getPaddingRight()I

    .line 7
    invoke-virtual {p0}, Landroid/view/View;->getPaddingTop()I

    move-result v3

    .line 8
    invoke-virtual {p0}, Landroid/view/View;->getPaddingBottom()I

    .line 9
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v4

    :goto_24
    if-ge v5, v4, :cond_6d

    .line 10
    invoke-virtual {p0, v5}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v6

    .line 11
    invoke-virtual {p0, v6}, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->isRefreshComponent(Landroid/view/View;)Z

    move-result v7

    if-nez v7, :cond_6a

    invoke-virtual {v6}, Landroid/view/View;->getVisibility()I

    move-result v7

    const/16 v8, 0x8

    if-eq v7, v8, :cond_6a

    .line 12
    invoke-virtual {v6}, Landroid/view/View;->getMeasuredWidth()I

    move-result v7

    .line 13
    invoke-virtual {v6}, Landroid/view/View;->getMeasuredHeight()I

    move-result v8

    sub-int v9, v1, v3

    .line 14
    invoke-virtual {v6}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v10

    .line 15
    instance-of v11, v10, Landroid/view/ViewGroup$MarginLayoutParams;

    if-eqz v11, :cond_53

    .line 16
    check-cast v10, Landroid/view/ViewGroup$MarginLayoutParams;

    .line 17
    iget v11, v10, Landroid/view/ViewGroup$MarginLayoutParams;->leftMargin:I

    add-int/2addr v11, v2

    .line 18
    iget v10, v10, Landroid/view/ViewGroup$MarginLayoutParams;->topMargin:I

    sub-int/2addr v9, v10

    goto :goto_54

    :cond_53
    move v11, v2

    :goto_54
    sub-int v10, v8, v7

    .line 19
    div-int/lit8 v10, v10, 0x2

    sub-int/2addr v11, v10

    sub-int/2addr v9, v10

    const/high16 v10, 0x42b40000    # 90.0f

    .line 20
    invoke-virtual {v6, v10}, Landroid/view/View;->setRotation(F)V

    .line 21
    sget v10, Lcom/scwang/smartrefresh/horizontal/R$string;->srl_component_falsify:I

    invoke-virtual {v6, v10, v6}, Landroid/view/View;->setTag(ILjava/lang/Object;)V

    sub-int v7, v9, v7

    add-int/2addr v8, v11

    .line 22
    invoke-virtual {v6, v7, v11, v9, v8}, Landroid/view/View;->layout(IIII)V

    :cond_6a
    add-int/lit8 v5, v5, 0x1

    goto :goto_24

    .line 23
    :cond_6d
    invoke-super/range {p0 .. p5}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->onLayout(ZIIII)V

    goto :goto_7e

    :cond_71
    sub-int v4, p3, v3

    add-int/2addr v3, p2

    const/4 v6, 0x1

    .line 24
    iput-boolean v6, v0, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->isInLayout:Z

    add-int/2addr v1, v3

    add-int/2addr v2, v4

    .line 25
    invoke-super {p0, v3, v4, v1, v2}, Landroid/view/ViewGroup;->layout(IIII)V

    .line 26
    iput-boolean v5, v0, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->isInLayout:Z

    :goto_7e
    return-void
.end method

.method protected onMeasure(II)V
    .registers 10

    .line 1
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v0

    const/4 v1, 0x0

    const/4 v2, 0x0

    :goto_6
    const-string v3, "VISIBLE"

    if-ge v2, v0, :cond_1d

    .line 2
    invoke-virtual {p0, v2}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v4

    .line 3
    sget v5, Lcom/scwang/smartrefresh/horizontal/R$string;->srl_component_falsify:I

    invoke-virtual {p0, v4}, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->isRefreshComponent(Landroid/view/View;)Z

    move-result v6

    if-eqz v6, :cond_17

    move-object v3, v4

    :cond_17
    invoke-virtual {v4, v5, v3}, Landroid/view/View;->setTag(ILjava/lang/Object;)V

    add-int/lit8 v2, v2, 0x1

    goto :goto_6

    .line 4
    :cond_1d
    invoke-super {p0, p1, p2}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->onMeasure(II)V

    .line 5
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v0

    const/high16 v2, 0x40000000    # 2.0f

    const/high16 v4, -0x80000000

    if-ne v0, v4, :cond_32

    .line 6
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getMeasuredWidth()I

    move-result p1

    invoke-static {p1, v2}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result p1

    .line 7
    :cond_32
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v0

    if-ne v0, v4, :cond_40

    .line 8
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getMeasuredHeight()I

    move-result p2

    invoke-static {p2, v2}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result p2

    .line 9
    :cond_40
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v0

    :goto_44
    if-ge v1, v0, :cond_5b

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

    move-result-object v2

    .line 11
    sget v4, Lcom/scwang/smartrefresh/horizontal/R$string;->srl_component_falsify:I

    invoke-virtual {p0, v2}, Lcom/scwang/smartrefresh/horizontal/SmartRefreshHorizontal;->isRefreshComponent(Landroid/view/View;)Z

    move-result v5

    if-eqz v5, :cond_54

    move-object v5, v3

    goto :goto_55

    :cond_54
    move-object v5, v2

    :goto_55
    invoke-virtual {v2, v4, v5}, Landroid/view/View;->setTag(ILjava/lang/Object;)V

    add-int/lit8 v1, v1, 0x1

    goto :goto_44

    .line 12
    :cond_5b
    invoke-super {p0, p2, p1}, Lcom/scwang/smartrefresh/layout/SmartRefreshLayout;->onMeasure(II)V

    return-void
.end method