2019-07-24 11:27:29 +00:00
|
|
|
.class public Landroidx/transition/ArcMotion;
|
|
|
|
.super Landroidx/transition/PathMotion;
|
|
|
|
.source "ArcMotion.java"
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final DEFAULT_MAX_ANGLE_DEGREES:F = 70.0f
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final DEFAULT_MAX_TANGENT:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public static final DEFAULT_MIN_ANGLE_DEGREES:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mMaximumAngle:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mMaximumTangent:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mMinimumHorizontalAngle:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mMinimumHorizontalTangent:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mMinimumVerticalAngle:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public mMinimumVerticalTangent:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static constructor <clinit>()V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 2
|
|
|
|
|
|
|
|
const-wide v0, 0x4041800000000000L # 35.0
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->toRadians(D)D
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->tan(D)D
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
double-to-float v0, v0
|
|
|
|
|
|
|
|
sput v0, Landroidx/transition/ArcMotion;->DEFAULT_MAX_TANGENT:F
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/transition/PathMotion;-><init>()V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMinimumHorizontalAngle:F
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMinimumVerticalAngle:F
|
|
|
|
|
|
|
|
const/high16 v1, 0x428c0000 # 70.0f
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/transition/ArcMotion;->mMaximumAngle:F
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMinimumHorizontalTangent:F
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMinimumVerticalTangent:F
|
|
|
|
|
|
|
|
sget v0, Landroidx/transition/ArcMotion;->DEFAULT_MAX_TANGENT:F
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMaximumTangent:F
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
.locals 4
|
2020-01-07 02:40:43 +00:00
|
|
|
.annotation build Landroid/annotation/SuppressLint;
|
|
|
|
value = {
|
|
|
|
"RestrictedApi"
|
|
|
|
}
|
|
|
|
.end annotation
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/transition/PathMotion;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMinimumHorizontalAngle:F
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMinimumVerticalAngle:F
|
|
|
|
|
|
|
|
const/high16 v1, 0x428c0000 # 70.0f
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/transition/ArcMotion;->mMaximumAngle:F
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMinimumHorizontalTangent:F
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/transition/ArcMotion;->mMinimumVerticalTangent:F
|
|
|
|
|
|
|
|
sget v2, Landroidx/transition/ArcMotion;->DEFAULT_MAX_TANGENT:F
|
|
|
|
|
|
|
|
iput v2, p0, Landroidx/transition/ArcMotion;->mMaximumTangent:F
|
|
|
|
|
|
|
|
sget-object v2, Landroidx/transition/Styleable;->ARC_MOTION:[I
|
|
|
|
|
|
|
|
invoke-virtual {p1, p2, v2}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
check-cast p2, Lorg/xmlpull/v1/XmlPullParser;
|
|
|
|
|
|
|
|
const-string v2, "minimumVerticalAngle"
|
|
|
|
|
|
|
|
const/4 v3, 0x1
|
|
|
|
|
|
|
|
invoke-static {p1, p2, v2, v3, v0}, Landroidx/core/content/res/TypedArrayUtils;->getNamedFloat(Landroid/content/res/TypedArray;Lorg/xmlpull/v1/XmlPullParser;Ljava/lang/String;IF)F
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-virtual {p0, v2}, Landroidx/transition/ArcMotion;->setMinimumVerticalAngle(F)V
|
|
|
|
|
|
|
|
const-string v2, "minimumHorizontalAngle"
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
invoke-static {p1, p2, v2, v3, v0}, Landroidx/core/content/res/TypedArrayUtils;->getNamedFloat(Landroid/content/res/TypedArray;Lorg/xmlpull/v1/XmlPullParser;Ljava/lang/String;IF)F
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroidx/transition/ArcMotion;->setMinimumHorizontalAngle(F)V
|
|
|
|
|
|
|
|
const-string v0, "maximumAngle"
|
|
|
|
|
|
|
|
const/4 v2, 0x2
|
|
|
|
|
|
|
|
invoke-static {p1, p2, v0, v2, v1}, Landroidx/core/content/res/TypedArrayUtils;->getNamedFloat(Landroid/content/res/TypedArray;Lorg/xmlpull/v1/XmlPullParser;Ljava/lang/String;IF)F
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
invoke-virtual {p0, p2}, Landroidx/transition/ArcMotion;->setMaximumAngle(F)V
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static toTangent(F)F
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 2
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
cmpg-float v0, p0, v0
|
|
|
|
|
|
|
|
if-ltz v0, :cond_0
|
|
|
|
|
|
|
|
const/high16 v0, 0x42b40000 # 90.0f
|
|
|
|
|
|
|
|
cmpl-float v0, p0, v0
|
|
|
|
|
|
|
|
if-gtz v0, :cond_0
|
|
|
|
|
|
|
|
const/high16 v0, 0x40000000 # 2.0f
|
|
|
|
|
|
|
|
div-float/2addr p0, v0
|
|
|
|
|
|
|
|
float-to-double v0, p0
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->toRadians(D)D
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->tan(D)D
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
double-to-float p0, v0
|
|
|
|
|
|
|
|
return p0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
|
|
|
|
const-string v0, "Arc must be between 0 and 90 degrees"
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public getMaximumAngle()F
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/transition/ArcMotion;->mMaximumAngle:F
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getMinimumHorizontalAngle()F
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/transition/ArcMotion;->mMinimumHorizontalAngle:F
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getMinimumVerticalAngle()F
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/transition/ArcMotion;->mMinimumVerticalAngle:F
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getPath(FFFF)Landroid/graphics/Path;
|
|
|
|
.locals 11
|
|
|
|
|
|
|
|
new-instance v7, Landroid/graphics/Path;
|
|
|
|
|
|
|
|
invoke-direct {v7}, Landroid/graphics/Path;-><init>()V
|
|
|
|
|
|
|
|
invoke-virtual {v7, p1, p2}, Landroid/graphics/Path;->moveTo(FF)V
|
|
|
|
|
|
|
|
sub-float v0, p3, p1
|
|
|
|
|
|
|
|
sub-float v1, p4, p2
|
|
|
|
|
|
|
|
mul-float v2, v0, v0
|
|
|
|
|
|
|
|
mul-float v3, v1, v1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
add-float/2addr v3, v2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
add-float v2, p1, p3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/high16 v4, 0x40000000 # 2.0f
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
div-float/2addr v2, v4
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
add-float v5, p2, p4
|
|
|
|
|
|
|
|
div-float/2addr v5, v4
|
|
|
|
|
|
|
|
const/high16 v6, 0x3e800000 # 0.25f
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
mul-float v6, v6, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
cmpl-float v8, p2, p4
|
|
|
|
|
|
|
|
if-lez v8, :cond_0
|
|
|
|
|
|
|
|
const/4 v8, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
|
|
|
|
|
|
|
|
move-result v9
|
|
|
|
|
|
|
|
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
|
|
|
|
|
|
|
|
move-result v10
|
|
|
|
|
|
|
|
cmpg-float v9, v9, v10
|
|
|
|
|
|
|
|
if-gez v9, :cond_2
|
|
|
|
|
|
|
|
mul-float v1, v1, v4
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
div-float/2addr v3, v1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-static {v3}, Ljava/lang/Math;->abs(F)F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v8, :cond_1
|
|
|
|
|
|
|
|
add-float/2addr v0, p4
|
|
|
|
|
|
|
|
move v1, v0
|
|
|
|
|
|
|
|
move v0, p3
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
add-float/2addr v0, p2
|
|
|
|
|
|
|
|
move v1, v0
|
|
|
|
|
|
|
|
move v0, p1
|
|
|
|
|
|
|
|
:goto_1
|
2019-12-06 03:29:40 +00:00
|
|
|
iget v3, p0, Landroidx/transition/ArcMotion;->mMinimumVerticalTangent:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
goto :goto_3
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
mul-float v0, v0, v4
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
div-float/2addr v3, v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
if-eqz v8, :cond_3
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
add-float/2addr v3, p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move v1, p2
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move v0, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_3
|
2019-12-06 03:29:40 +00:00
|
|
|
sub-float v0, p3, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move v1, p4
|
|
|
|
|
|
|
|
:goto_2
|
2019-12-06 03:29:40 +00:00
|
|
|
iget v3, p0, Landroidx/transition/ArcMotion;->mMinimumHorizontalTangent:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:goto_3
|
2019-12-06 03:29:40 +00:00
|
|
|
mul-float v8, v6, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
mul-float v8, v8, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
sub-float v3, v2, v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
sub-float v9, v5, v1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
mul-float v3, v3, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
mul-float v9, v9, v9
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
add-float/2addr v9, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
iget v3, p0, Landroidx/transition/ArcMotion;->mMaximumTangent:F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
mul-float v6, v6, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
mul-float v3, v3, v6
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const/4 v6, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
cmpg-float v10, v9, v8
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
if-gez v10, :cond_4
|
|
|
|
|
|
|
|
goto :goto_4
|
|
|
|
|
|
|
|
:cond_4
|
2019-12-06 03:29:40 +00:00
|
|
|
cmpl-float v8, v9, v3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
if-lez v8, :cond_5
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move v8, v3
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
goto :goto_4
|
|
|
|
|
|
|
|
:cond_5
|
2019-12-06 03:29:40 +00:00
|
|
|
const/4 v8, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:goto_4
|
2019-12-06 03:29:40 +00:00
|
|
|
cmpl-float v3, v8, v6
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz v3, :cond_6
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
div-float/2addr v8, v9
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
float-to-double v8, v8
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-static {v8, v9}, Ljava/lang/Math;->sqrt(D)D
|
|
|
|
|
|
|
|
move-result-wide v8
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
double-to-float v3, v8
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2020-04-27 20:53:11 +00:00
|
|
|
invoke-static {v0, v2, v3, v2}, Le/e/b/a/a;->a(FFFF)F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result v0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2020-04-27 20:53:11 +00:00
|
|
|
invoke-static {v1, v5, v3, v5}, Le/e/b/a/a;->a(FFFF)F
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
move-result v1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_6
|
|
|
|
add-float/2addr p1, v0
|
|
|
|
|
|
|
|
div-float/2addr p1, v4
|
|
|
|
|
|
|
|
add-float/2addr p2, v1
|
|
|
|
|
|
|
|
div-float v2, p2, v4
|
|
|
|
|
|
|
|
add-float/2addr v0, p3
|
|
|
|
|
|
|
|
div-float v3, v0, v4
|
|
|
|
|
|
|
|
add-float/2addr v1, p4
|
|
|
|
|
|
|
|
div-float v4, v1, v4
|
|
|
|
|
|
|
|
move-object v0, v7
|
|
|
|
|
|
|
|
move v1, p1
|
|
|
|
|
|
|
|
move v5, p3
|
|
|
|
|
|
|
|
move v6, p4
|
|
|
|
|
|
|
|
invoke-virtual/range {v0 .. v6}, Landroid/graphics/Path;->cubicTo(FFFFFF)V
|
|
|
|
|
|
|
|
return-object v7
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setMaximumAngle(F)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/transition/ArcMotion;->mMaximumAngle:F
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroidx/transition/ArcMotion;->toTangent(F)F
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/transition/ArcMotion;->mMaximumTangent:F
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setMinimumHorizontalAngle(F)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/transition/ArcMotion;->mMinimumHorizontalAngle:F
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroidx/transition/ArcMotion;->toTangent(F)F
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/transition/ArcMotion;->mMinimumHorizontalTangent:F
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setMinimumVerticalAngle(F)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/transition/ArcMotion;->mMinimumVerticalAngle:F
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroidx/transition/ArcMotion;->toTangent(F)F
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/transition/ArcMotion;->mMinimumVerticalTangent:F
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|