415 lines
12 KiB
Smali
415 lines
12 KiB
Smali
.class public Landroidx/constraintlayout/utils/widget/MotionTelltales;
|
|
.super Landroidx/constraintlayout/utils/widget/MockView;
|
|
.source "MotionTelltales.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final TAG:Ljava/lang/String; = "MotionTelltales"
|
|
|
|
|
|
# instance fields
|
|
.field public mInvertMatrix:Landroid/graphics/Matrix;
|
|
|
|
.field public mMotionLayout:Landroidx/constraintlayout/motion/widget/MotionLayout;
|
|
|
|
.field public mPaintTelltales:Landroid/graphics/Paint;
|
|
|
|
.field public mTailColor:I
|
|
|
|
.field public mTailScale:F
|
|
|
|
.field public mVelocityMode:I
|
|
|
|
.field public velocity:[F
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0, p1}, Landroidx/constraintlayout/utils/widget/MockView;-><init>(Landroid/content/Context;)V
|
|
|
|
new-instance v0, Landroid/graphics/Paint;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mPaintTelltales:Landroid/graphics/Paint;
|
|
|
|
const/4 v0, 0x2
|
|
|
|
new-array v0, v0, [F
|
|
|
|
iput-object v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->velocity:[F
|
|
|
|
new-instance v0, Landroid/graphics/Matrix;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Matrix;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mInvertMatrix:Landroid/graphics/Matrix;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mVelocityMode:I
|
|
|
|
const v0, -0xff01
|
|
|
|
iput v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailColor:I
|
|
|
|
const/high16 v0, 0x3e800000 # 0.25f
|
|
|
|
iput v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailScale:F
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, p1, v0}, Landroidx/constraintlayout/utils/widget/MotionTelltales;->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
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/constraintlayout/utils/widget/MockView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
new-instance v0, Landroid/graphics/Paint;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mPaintTelltales:Landroid/graphics/Paint;
|
|
|
|
const/4 v0, 0x2
|
|
|
|
new-array v0, v0, [F
|
|
|
|
iput-object v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->velocity:[F
|
|
|
|
new-instance v0, Landroid/graphics/Matrix;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Matrix;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mInvertMatrix:Landroid/graphics/Matrix;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mVelocityMode:I
|
|
|
|
const v0, -0xff01
|
|
|
|
iput v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailColor:I
|
|
|
|
const/high16 v0, 0x3e800000 # 0.25f
|
|
|
|
iput v0, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailScale:F
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/constraintlayout/utils/widget/MotionTelltales;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroidx/constraintlayout/utils/widget/MockView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
new-instance p3, Landroid/graphics/Paint;
|
|
|
|
invoke-direct {p3}, Landroid/graphics/Paint;-><init>()V
|
|
|
|
iput-object p3, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mPaintTelltales:Landroid/graphics/Paint;
|
|
|
|
const/4 p3, 0x2
|
|
|
|
new-array p3, p3, [F
|
|
|
|
iput-object p3, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->velocity:[F
|
|
|
|
new-instance p3, Landroid/graphics/Matrix;
|
|
|
|
invoke-direct {p3}, Landroid/graphics/Matrix;-><init>()V
|
|
|
|
iput-object p3, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mInvertMatrix:Landroid/graphics/Matrix;
|
|
|
|
const/4 p3, 0x0
|
|
|
|
iput p3, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mVelocityMode:I
|
|
|
|
const p3, -0xff01
|
|
|
|
iput p3, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailColor:I
|
|
|
|
const/high16 p3, 0x3e800000 # 0.25f
|
|
|
|
iput p3, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailScale:F
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/constraintlayout/utils/widget/MotionTelltales;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private init(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 3
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
sget-object v0, Landroidx/constraintlayout/widget/R$styleable;->MotionTelltales:[I
|
|
|
|
invoke-virtual {p1, p2, v0}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->getIndexCount()I
|
|
|
|
move-result p2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-ge v0, p2, :cond_3
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/res/TypedArray;->getIndex(I)I
|
|
|
|
move-result v1
|
|
|
|
sget v2, Landroidx/constraintlayout/widget/R$styleable;->MotionTelltales_telltales_tailColor:I
|
|
|
|
if-ne v1, v2, :cond_0
|
|
|
|
iget v2, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailColor:I
|
|
|
|
invoke-virtual {p1, v1, v2}, Landroid/content/res/TypedArray;->getColor(II)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailColor:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
sget v2, Landroidx/constraintlayout/widget/R$styleable;->MotionTelltales_telltales_velocityMode:I
|
|
|
|
if-ne v1, v2, :cond_1
|
|
|
|
iget v2, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mVelocityMode:I
|
|
|
|
invoke-virtual {p1, v1, v2}, Landroid/content/res/TypedArray;->getInt(II)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mVelocityMode:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
sget v2, Landroidx/constraintlayout/widget/R$styleable;->MotionTelltales_telltales_tailScale:I
|
|
|
|
if-ne v1, v2, :cond_2
|
|
|
|
iget v2, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailScale:F
|
|
|
|
invoke-virtual {p1, v1, v2}, Landroid/content/res/TypedArray;->getFloat(IF)F
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailScale:F
|
|
|
|
:cond_2
|
|
:goto_1
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
iget-object p1, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mPaintTelltales:Landroid/graphics/Paint;
|
|
|
|
iget p2, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailColor:I
|
|
|
|
invoke-virtual {p1, p2}, Landroid/graphics/Paint;->setColor(I)V
|
|
|
|
iget-object p1, p0, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mPaintTelltales:Landroid/graphics/Paint;
|
|
|
|
const/high16 p2, 0x40a00000 # 5.0f
|
|
|
|
invoke-virtual {p1, p2}, Landroid/graphics/Paint;->setStrokeWidth(F)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onAttachedToWindow()V
|
|
.locals 0
|
|
|
|
invoke-super {p0}, Landroid/view/View;->onAttachedToWindow()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onDraw(Landroid/graphics/Canvas;)V
|
|
.locals 22
|
|
|
|
move-object/from16 v6, p0
|
|
|
|
invoke-super/range {p0 .. p1}, Landroidx/constraintlayout/utils/widget/MockView;->onDraw(Landroid/graphics/Canvas;)V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/View;->getMatrix()Landroid/graphics/Matrix;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mInvertMatrix:Landroid/graphics/Matrix;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/graphics/Matrix;->invert(Landroid/graphics/Matrix;)Z
|
|
|
|
iget-object v0, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mMotionLayout:Landroidx/constraintlayout/motion/widget/MotionLayout;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Landroidx/constraintlayout/motion/widget/MotionLayout;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
check-cast v0, Landroidx/constraintlayout/motion/widget/MotionLayout;
|
|
|
|
iput-object v0, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mMotionLayout:Landroidx/constraintlayout/motion/widget/MotionLayout;
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result v7
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/View;->getHeight()I
|
|
|
|
move-result v8
|
|
|
|
const/4 v9, 0x5
|
|
|
|
new-array v10, v9, [F
|
|
|
|
fill-array-data v10, :array_0
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/4 v12, 0x0
|
|
|
|
:goto_0
|
|
if-ge v12, v9, :cond_3
|
|
|
|
aget v13, v10, v12
|
|
|
|
const/4 v14, 0x0
|
|
|
|
:goto_1
|
|
if-ge v14, v9, :cond_2
|
|
|
|
aget v15, v10, v14
|
|
|
|
iget-object v0, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mMotionLayout:Landroidx/constraintlayout/motion/widget/MotionLayout;
|
|
|
|
iget-object v4, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->velocity:[F
|
|
|
|
iget v5, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mVelocityMode:I
|
|
|
|
move-object/from16 v1, p0
|
|
|
|
move v2, v15
|
|
|
|
move v3, v13
|
|
|
|
invoke-virtual/range {v0 .. v5}, Landroidx/constraintlayout/motion/widget/MotionLayout;->getViewVelocity(Landroid/view/View;FF[FI)V
|
|
|
|
iget-object v0, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mInvertMatrix:Landroid/graphics/Matrix;
|
|
|
|
iget-object v1, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->velocity:[F
|
|
|
|
invoke-virtual {v0, v1}, Landroid/graphics/Matrix;->mapVectors([F)V
|
|
|
|
int-to-float v0, v7
|
|
|
|
mul-float v17, v0, v15
|
|
|
|
int-to-float v0, v8
|
|
|
|
mul-float v18, v0, v13
|
|
|
|
iget-object v0, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->velocity:[F
|
|
|
|
aget v1, v0, v11
|
|
|
|
iget v2, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mTailScale:F
|
|
|
|
mul-float v1, v1, v2
|
|
|
|
sub-float v19, v17, v1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
aget v1, v0, v1
|
|
|
|
mul-float v1, v1, v2
|
|
|
|
sub-float v20, v18, v1
|
|
|
|
iget-object v1, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mInvertMatrix:Landroid/graphics/Matrix;
|
|
|
|
invoke-virtual {v1, v0}, Landroid/graphics/Matrix;->mapVectors([F)V
|
|
|
|
iget-object v0, v6, Landroidx/constraintlayout/utils/widget/MotionTelltales;->mPaintTelltales:Landroid/graphics/Paint;
|
|
|
|
move-object/from16 v16, p1
|
|
|
|
move-object/from16 v21, v0
|
|
|
|
invoke-virtual/range {v16 .. v21}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V
|
|
|
|
add-int/lit8 v14, v14, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
add-int/lit8 v12, v12, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
return-void
|
|
|
|
:array_0
|
|
.array-data 4
|
|
0x3dcccccd # 0.1f
|
|
0x3e800000 # 0.25f
|
|
0x3f000000 # 0.5f
|
|
0x3f400000 # 0.75f
|
|
0x3f666666 # 0.9f
|
|
.end array-data
|
|
.end method
|
|
|
|
.method public onLayout(ZIIII)V
|
|
.locals 0
|
|
|
|
invoke-super/range {p0 .. p5}, Landroid/view/View;->onLayout(ZIIII)V
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->postInvalidate()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setText(Ljava/lang/CharSequence;)V
|
|
.locals 0
|
|
|
|
invoke-interface {p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Landroidx/constraintlayout/utils/widget/MockView;->mText:Ljava/lang/String;
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->requestLayout()V
|
|
|
|
return-void
|
|
.end method
|