.class Lcom/moji/imageview/TouchImageView$Fling;
.super Ljava/lang/Object;
.source "TouchImageView.java"

# interfaces
.implements Ljava/lang/Runnable;


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

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "Fling"
.end annotation


# instance fields
.field a:Lcom/moji/imageview/TouchImageView$CompatScroller;

.field b:I

.field c:I

.field final synthetic d:Lcom/moji/imageview/TouchImageView;


# direct methods
.method constructor <init>(Lcom/moji/imageview/TouchImageView;II)V
    .locals 11

    .line 1039
    iput-object p1, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

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

    .line 1040
    sget-object v0, Lcom/moji/imageview/TouchImageView$State;->FLING:Lcom/moji/imageview/TouchImageView$State;

    invoke-static {p1, v0}, Lcom/moji/imageview/TouchImageView;->a(Lcom/moji/imageview/TouchImageView;Lcom/moji/imageview/TouchImageView$State;)V

    .line 1041
    new-instance v0, Lcom/moji/imageview/TouchImageView$CompatScroller;

    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->r(Lcom/moji/imageview/TouchImageView;)Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, p1, v1}, Lcom/moji/imageview/TouchImageView$CompatScroller;-><init>(Lcom/moji/imageview/TouchImageView;Landroid/content/Context;)V

    iput-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    .line 1042
    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->m(Lcom/moji/imageview/TouchImageView;)Landroid/graphics/Matrix;

    move-result-object v0

    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->s(Lcom/moji/imageview/TouchImageView;)[F

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/graphics/Matrix;->getValues([F)V

    .line 1044
    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->s(Lcom/moji/imageview/TouchImageView;)[F

    move-result-object v0

    const/4 v1, 0x2

    aget v0, v0, v1

    float-to-int v0, v0

    .line 1045
    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->s(Lcom/moji/imageview/TouchImageView;)[F

    move-result-object v1

    const/4 v2, 0x5

    aget v1, v1, v2

    float-to-int v10, v1

    .line 1048
    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->j(Lcom/moji/imageview/TouchImageView;)F

    move-result v1

    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->i(Lcom/moji/imageview/TouchImageView;)I

    move-result v2

    int-to-float v2, v2

    const/4 v3, 0x0

    cmpl-float v1, v1, v2

    if-lez v1, :cond_0

    .line 1049
    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->i(Lcom/moji/imageview/TouchImageView;)I

    move-result v1

    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->j(Lcom/moji/imageview/TouchImageView;)F

    move-result v2

    float-to-int v2, v2

    sub-int/2addr v1, v2

    move v6, v1

    const/4 v7, 0x0

    goto :goto_0

    :cond_0
    move v6, v0

    move v7, v6

    .line 1056
    :goto_0
    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->l(Lcom/moji/imageview/TouchImageView;)F

    move-result v1

    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->k(Lcom/moji/imageview/TouchImageView;)I

    move-result v2

    int-to-float v2, v2

    cmpl-float v1, v1, v2

    if-lez v1, :cond_1

    .line 1057
    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->k(Lcom/moji/imageview/TouchImageView;)I

    move-result v1

    invoke-static {p1}, Lcom/moji/imageview/TouchImageView;->l(Lcom/moji/imageview/TouchImageView;)F

    move-result p1

    float-to-int p1, p1

    sub-int/2addr v1, p1

    move v8, v1

    const/4 v9, 0x0

    goto :goto_1

    :cond_1
    move v8, v10

    move v9, v8

    .line 1064
    :goto_1
    iget-object v1, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    move v2, v0

    move v3, v10

    move v4, p2

    move v5, p3

    invoke-virtual/range {v1 .. v9}, Lcom/moji/imageview/TouchImageView$CompatScroller;->a(IIIIIIII)V

    .line 1066
    iput v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->b:I

    .line 1067
    iput v10, p0, Lcom/moji/imageview/TouchImageView$Fling;->c:I

    return-void
.end method


# virtual methods
.method public a()V
    .locals 2

    .line 1071
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    if-eqz v0, :cond_0

    .line 1072
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

    sget-object v1, Lcom/moji/imageview/TouchImageView$State;->NONE:Lcom/moji/imageview/TouchImageView$State;

    invoke-static {v0, v1}, Lcom/moji/imageview/TouchImageView;->a(Lcom/moji/imageview/TouchImageView;Lcom/moji/imageview/TouchImageView$State;)V

    .line 1073
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/moji/imageview/TouchImageView$CompatScroller;->a(Z)V

    :cond_0
    return-void
.end method

.method public run()V
    .locals 4

    .line 1084
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

    invoke-static {v0}, Lcom/moji/imageview/TouchImageView;->p(Lcom/moji/imageview/TouchImageView;)Lcom/moji/imageview/TouchImageView$OnTouchImageViewListener;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 1085
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

    invoke-static {v0}, Lcom/moji/imageview/TouchImageView;->p(Lcom/moji/imageview/TouchImageView;)Lcom/moji/imageview/TouchImageView$OnTouchImageViewListener;

    move-result-object v0

    invoke-interface {v0}, Lcom/moji/imageview/TouchImageView$OnTouchImageViewListener;->a()V

    .line 1088
    :cond_0
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    invoke-virtual {v0}, Lcom/moji/imageview/TouchImageView$CompatScroller;->a()Z

    move-result v0

    if-eqz v0, :cond_1

    const/4 v0, 0x0

    .line 1089
    iput-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    return-void

    .line 1093
    :cond_1
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    invoke-virtual {v0}, Lcom/moji/imageview/TouchImageView$CompatScroller;->b()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 1094
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    invoke-virtual {v0}, Lcom/moji/imageview/TouchImageView$CompatScroller;->c()I

    move-result v0

    .line 1095
    iget-object v1, p0, Lcom/moji/imageview/TouchImageView$Fling;->a:Lcom/moji/imageview/TouchImageView$CompatScroller;

    invoke-virtual {v1}, Lcom/moji/imageview/TouchImageView$CompatScroller;->d()I

    move-result v1

    .line 1096
    iget v2, p0, Lcom/moji/imageview/TouchImageView$Fling;->b:I

    sub-int v2, v0, v2

    .line 1097
    iget v3, p0, Lcom/moji/imageview/TouchImageView$Fling;->c:I

    sub-int v3, v1, v3

    .line 1098
    iput v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->b:I

    .line 1099
    iput v1, p0, Lcom/moji/imageview/TouchImageView$Fling;->c:I

    .line 1100
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

    invoke-static {v0}, Lcom/moji/imageview/TouchImageView;->m(Lcom/moji/imageview/TouchImageView;)Landroid/graphics/Matrix;

    move-result-object v0

    int-to-float v1, v2

    int-to-float v2, v3

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Matrix;->postTranslate(FF)Z

    .line 1101
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

    invoke-static {v0}, Lcom/moji/imageview/TouchImageView;->n(Lcom/moji/imageview/TouchImageView;)V

    .line 1102
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

    iget-object v1, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

    invoke-static {v1}, Lcom/moji/imageview/TouchImageView;->m(Lcom/moji/imageview/TouchImageView;)Landroid/graphics/Matrix;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/imageview/TouchImageView;->setImageMatrix(Landroid/graphics/Matrix;)V

    .line 1103
    iget-object v0, p0, Lcom/moji/imageview/TouchImageView$Fling;->d:Lcom/moji/imageview/TouchImageView;

    invoke-static {v0, p0}, Lcom/moji/imageview/TouchImageView;->a(Lcom/moji/imageview/TouchImageView;Ljava/lang/Runnable;)V

    :cond_2
    return-void
.end method
