510 lines
15 KiB
Smali
510 lines
15 KiB
Smali
.class public Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;
|
|
.super Ljava/lang/Object;
|
|
.source "KeyCycleOscillator.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Landroidx/constraintlayout/motion/widget/KeyCycleOscillator;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x9
|
|
name = "CycleOscillator"
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final TAG:Ljava/lang/String; = "CycleOscillator"
|
|
|
|
.field public static final UNSET:I = -0x1
|
|
|
|
|
|
# instance fields
|
|
.field public mCurveFit:Landroidx/constraintlayout/motion/utils/CurveFit;
|
|
|
|
.field public mCustomConstraints:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/String;",
|
|
"Landroidx/constraintlayout/widget/ConstraintAttribute;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public mOffset:[F
|
|
|
|
.field public mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
.field public mPathLength:F
|
|
|
|
.field public mPeriod:[F
|
|
|
|
.field public mPosition:[D
|
|
|
|
.field public mScale:[F
|
|
|
|
.field public mSplineSlopeCache:[D
|
|
|
|
.field public mSplineValueCache:[D
|
|
|
|
.field public mValues:[F
|
|
|
|
.field public final mVariesBy:I
|
|
|
|
.field public mWaveShape:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(III)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
invoke-direct {v0}, Landroidx/constraintlayout/motion/utils/Oscillator;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCustomConstraints:Ljava/util/HashMap;
|
|
|
|
iput p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mWaveShape:I
|
|
|
|
iput p2, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mVariesBy:I
|
|
|
|
iget-object p2, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
invoke-virtual {p2, p1}, Landroidx/constraintlayout/motion/utils/Oscillator;->setType(I)V
|
|
|
|
new-array p1, p3, [F
|
|
|
|
iput-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mValues:[F
|
|
|
|
new-array p1, p3, [D
|
|
|
|
iput-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPosition:[D
|
|
|
|
new-array p1, p3, [F
|
|
|
|
iput-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPeriod:[F
|
|
|
|
new-array p1, p3, [F
|
|
|
|
iput-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOffset:[F
|
|
|
|
new-array p1, p3, [F
|
|
|
|
iput-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mScale:[F
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private get(Ljava/lang/String;Landroidx/constraintlayout/widget/ConstraintAttribute$AttributeType;)Landroidx/constraintlayout/widget/ConstraintAttribute;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCustomConstraints:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCustomConstraints:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/constraintlayout/widget/ConstraintAttribute;
|
|
|
|
invoke-virtual {p1}, Landroidx/constraintlayout/widget/ConstraintAttribute;->getType()Landroidx/constraintlayout/widget/ConstraintAttribute$AttributeType;
|
|
|
|
move-result-object v0
|
|
|
|
if-ne v0, p2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "ConstraintAttribute is already a "
|
|
|
|
invoke-static {v0}, Lf/e/c/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Landroidx/constraintlayout/widget/ConstraintAttribute;->getType()Landroidx/constraintlayout/widget/ConstraintAttribute$AttributeType;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Enum;->name()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
:cond_1
|
|
new-instance v0, Landroidx/constraintlayout/widget/ConstraintAttribute;
|
|
|
|
invoke-direct {v0, p1, p2}, Landroidx/constraintlayout/widget/ConstraintAttribute;-><init>(Ljava/lang/String;Landroidx/constraintlayout/widget/ConstraintAttribute$AttributeType;)V
|
|
|
|
iget-object p2, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCustomConstraints:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p2, p1, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-object p1, v0
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getSlope(F)D
|
|
.locals 9
|
|
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCurveFit:Landroidx/constraintlayout/motion/utils/CurveFit;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
float-to-double v3, p1
|
|
|
|
iget-object v5, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineSlopeCache:[D
|
|
|
|
invoke-virtual {v0, v3, v4, v5}, Landroidx/constraintlayout/motion/utils/CurveFit;->getSlope(D[D)V
|
|
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCurveFit:Landroidx/constraintlayout/motion/utils/CurveFit;
|
|
|
|
iget-object v5, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineValueCache:[D
|
|
|
|
invoke-virtual {v0, v3, v4, v5}, Landroidx/constraintlayout/motion/utils/CurveFit;->getPos(D[D)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineSlopeCache:[D
|
|
|
|
const-wide/16 v3, 0x0
|
|
|
|
aput-wide v3, v0, v1
|
|
|
|
aput-wide v3, v0, v2
|
|
|
|
:goto_0
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
float-to-double v3, p1
|
|
|
|
invoke-virtual {v0, v3, v4}, Landroidx/constraintlayout/motion/utils/Oscillator;->getValue(D)D
|
|
|
|
move-result-wide v5
|
|
|
|
iget-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
invoke-virtual {p1, v3, v4}, Landroidx/constraintlayout/motion/utils/Oscillator;->getSlope(D)D
|
|
|
|
move-result-wide v3
|
|
|
|
iget-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineSlopeCache:[D
|
|
|
|
aget-wide v0, p1, v1
|
|
|
|
aget-wide v7, p1, v2
|
|
|
|
mul-double v5, v5, v7
|
|
|
|
add-double/2addr v5, v0
|
|
|
|
iget-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineValueCache:[D
|
|
|
|
aget-wide v0, p1, v2
|
|
|
|
mul-double v3, v3, v0
|
|
|
|
add-double/2addr v3, v5
|
|
|
|
return-wide v3
|
|
.end method
|
|
|
|
.method public getValues(F)D
|
|
.locals 6
|
|
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCurveFit:Landroidx/constraintlayout/motion/utils/CurveFit;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
float-to-double v3, p1
|
|
|
|
iget-object v5, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineValueCache:[D
|
|
|
|
invoke-virtual {v0, v3, v4, v5}, Landroidx/constraintlayout/motion/utils/CurveFit;->getPos(D[D)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineValueCache:[D
|
|
|
|
iget-object v3, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOffset:[F
|
|
|
|
aget v3, v3, v2
|
|
|
|
float-to-double v3, v3
|
|
|
|
aput-wide v3, v0, v2
|
|
|
|
iget-object v3, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mValues:[F
|
|
|
|
aget v3, v3, v2
|
|
|
|
float-to-double v3, v3
|
|
|
|
aput-wide v3, v0, v1
|
|
|
|
:goto_0
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineValueCache:[D
|
|
|
|
aget-wide v2, v0, v2
|
|
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
float-to-double v4, p1
|
|
|
|
invoke-virtual {v0, v4, v5}, Landroidx/constraintlayout/motion/utils/Oscillator;->getValue(D)D
|
|
|
|
move-result-wide v4
|
|
|
|
iget-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineValueCache:[D
|
|
|
|
aget-wide v0, p1, v1
|
|
|
|
mul-double v4, v4, v0
|
|
|
|
add-double/2addr v4, v2
|
|
|
|
return-wide v4
|
|
.end method
|
|
|
|
.method public setPoint(IIFFF)V
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPosition:[D
|
|
|
|
int-to-double v1, p2
|
|
|
|
const-wide/high16 v3, 0x4059000000000000L # 100.0
|
|
|
|
div-double/2addr v1, v3
|
|
|
|
aput-wide v1, v0, p1
|
|
|
|
iget-object p2, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPeriod:[F
|
|
|
|
aput p3, p2, p1
|
|
|
|
iget-object p2, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOffset:[F
|
|
|
|
aput p4, p2, p1
|
|
|
|
iget-object p2, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mValues:[F
|
|
|
|
aput p5, p2, p1
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setup(F)V
|
|
.locals 8
|
|
|
|
iput p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPathLength:F
|
|
|
|
iget-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPosition:[D
|
|
|
|
array-length p1, p1
|
|
|
|
const/4 v0, 0x2
|
|
|
|
new-array v1, v0, [I
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput v0, v1, v2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
aput p1, v1, v0
|
|
|
|
const-class p1, D
|
|
|
|
invoke-static {p1, v1}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, [[D
|
|
|
|
iget-object v1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mValues:[F
|
|
|
|
array-length v3, v1
|
|
|
|
add-int/2addr v3, v2
|
|
|
|
new-array v3, v3, [D
|
|
|
|
iput-object v3, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineValueCache:[D
|
|
|
|
array-length v1, v1
|
|
|
|
add-int/2addr v1, v2
|
|
|
|
new-array v1, v1, [D
|
|
|
|
iput-object v1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mSplineSlopeCache:[D
|
|
|
|
iget-object v1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPosition:[D
|
|
|
|
aget-wide v3, v1, v0
|
|
|
|
const-wide/16 v5, 0x0
|
|
|
|
cmpl-double v1, v3, v5
|
|
|
|
if-lez v1, :cond_0
|
|
|
|
iget-object v1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
iget-object v3, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPeriod:[F
|
|
|
|
aget v3, v3, v0
|
|
|
|
invoke-virtual {v1, v5, v6, v3}, Landroidx/constraintlayout/motion/utils/Oscillator;->addPoint(DF)V
|
|
|
|
:cond_0
|
|
iget-object v1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPosition:[D
|
|
|
|
array-length v3, v1
|
|
|
|
sub-int/2addr v3, v2
|
|
|
|
aget-wide v4, v1, v3
|
|
|
|
const-wide/high16 v6, 0x3ff0000000000000L # 1.0
|
|
|
|
cmpg-double v1, v4, v6
|
|
|
|
if-gez v1, :cond_1
|
|
|
|
iget-object v1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
iget-object v4, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPeriod:[F
|
|
|
|
aget v3, v4, v3
|
|
|
|
invoke-virtual {v1, v6, v7, v3}, Landroidx/constraintlayout/motion/utils/Oscillator;->addPoint(DF)V
|
|
|
|
:cond_1
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
array-length v3, p1
|
|
|
|
if-ge v1, v3, :cond_3
|
|
|
|
aget-object v3, p1, v1
|
|
|
|
iget-object v4, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOffset:[F
|
|
|
|
aget v4, v4, v1
|
|
|
|
float-to-double v4, v4
|
|
|
|
aput-wide v4, v3, v0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
iget-object v4, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mValues:[F
|
|
|
|
array-length v5, v4
|
|
|
|
if-ge v3, v5, :cond_2
|
|
|
|
aget-object v5, p1, v3
|
|
|
|
aget v4, v4, v3
|
|
|
|
float-to-double v6, v4
|
|
|
|
aput-wide v6, v5, v2
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
iget-object v3, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
iget-object v4, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPosition:[D
|
|
|
|
aget-wide v5, v4, v1
|
|
|
|
iget-object v4, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPeriod:[F
|
|
|
|
aget v4, v4, v1
|
|
|
|
invoke-virtual {v3, v5, v6, v4}, Landroidx/constraintlayout/motion/utils/Oscillator;->addPoint(DF)V
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
iget-object v1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mOscillator:Landroidx/constraintlayout/motion/utils/Oscillator;
|
|
|
|
invoke-virtual {v1}, Landroidx/constraintlayout/motion/utils/Oscillator;->normalize()V
|
|
|
|
iget-object v1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mPosition:[D
|
|
|
|
array-length v3, v1
|
|
|
|
if-le v3, v2, :cond_4
|
|
|
|
invoke-static {v0, v1, p1}, Landroidx/constraintlayout/motion/utils/CurveFit;->get(I[D[[D)Landroidx/constraintlayout/motion/utils/CurveFit;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCurveFit:Landroidx/constraintlayout/motion/utils/CurveFit;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
const/4 p1, 0x0
|
|
|
|
iput-object p1, p0, Landroidx/constraintlayout/motion/widget/KeyCycleOscillator$CycleOscillator;->mCurveFit:Landroidx/constraintlayout/motion/utils/CurveFit;
|
|
|
|
:goto_2
|
|
return-void
|
|
.end method
|