513 lines
13 KiB
Smali
513 lines
13 KiB
Smali
|
.class public abstract Landroidx/constraintlayout/widget/ConstraintHelper;
|
||
|
.super Landroid/view/View;
|
||
|
.source "ConstraintHelper.java"
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field protected mCount:I
|
||
|
|
||
|
.field protected mHelperWidget:Landroidx/constraintlayout/solver/widgets/Helper;
|
||
|
|
||
|
.field protected mIds:[I
|
||
|
|
||
|
.field private mReferenceIds:Ljava/lang/String;
|
||
|
|
||
|
.field protected mUseViewMeasure:Z
|
||
|
|
||
|
.field protected myContext:Landroid/content/Context;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>(Landroid/content/Context;)V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-direct {p0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V
|
||
|
|
||
|
const/16 v0, 0x20
|
||
|
|
||
|
new-array v0, v0, [I
|
||
|
|
||
|
iput-object v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mIds:[I
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
iput-boolean v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mUseViewMeasure:Z
|
||
|
|
||
|
iput-object p1, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->myContext:Landroid/content/Context;
|
||
|
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/constraintlayout/widget/ConstraintHelper;->init(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}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
||
|
|
||
|
const/16 v0, 0x20
|
||
|
|
||
|
new-array v0, v0, [I
|
||
|
|
||
|
iput-object v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mIds:[I
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
iput-boolean v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mUseViewMeasure:Z
|
||
|
|
||
|
iput-object p1, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->myContext:Landroid/content/Context;
|
||
|
|
||
|
invoke-virtual {p0, p2}, Landroidx/constraintlayout/widget/ConstraintHelper;->init(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}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
||
|
|
||
|
const/16 p3, 0x20
|
||
|
|
||
|
new-array p3, p3, [I
|
||
|
|
||
|
iput-object p3, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mIds:[I
|
||
|
|
||
|
const/4 p3, 0x0
|
||
|
|
||
|
iput-boolean p3, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mUseViewMeasure:Z
|
||
|
|
||
|
iput-object p1, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->myContext:Landroid/content/Context;
|
||
|
|
||
|
invoke-virtual {p0, p2}, Landroidx/constraintlayout/widget/ConstraintHelper;->init(Landroid/util/AttributeSet;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private addID(Ljava/lang/String;)V
|
||
|
.locals 5
|
||
|
|
||
|
if-nez p1, :cond_0
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
iget-object v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->myContext:Landroid/content/Context;
|
||
|
|
||
|
if-nez v0, :cond_1
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
:try_start_0
|
||
|
const-class v2, Landroidx/constraintlayout/widget/R$id;
|
||
|
|
||
|
invoke-virtual {v2, p1}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {v2, v0}, Ljava/lang/reflect/Field;->getInt(Ljava/lang/Object;)I
|
||
|
|
||
|
move-result v2
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:catch_0
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
if-nez v2, :cond_2
|
||
|
|
||
|
iget-object v2, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->myContext:Landroid/content/Context;
|
||
|
|
||
|
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
iget-object v3, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->myContext:Landroid/content/Context;
|
||
|
|
||
|
invoke-virtual {v3}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
const-string v4, "id"
|
||
|
|
||
|
invoke-virtual {v2, p1, v4, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
:cond_2
|
||
|
if-nez v2, :cond_3
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/constraintlayout/widget/ConstraintHelper;->isInEditMode()Z
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
if-eqz v3, :cond_3
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/constraintlayout/widget/ConstraintHelper;->getParent()Landroid/view/ViewParent;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
instance-of v3, v3, Landroidx/constraintlayout/widget/ConstraintLayout;
|
||
|
|
||
|
if-eqz v3, :cond_3
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/constraintlayout/widget/ConstraintHelper;->getParent()Landroid/view/ViewParent;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
check-cast v3, Landroidx/constraintlayout/widget/ConstraintLayout;
|
||
|
|
||
|
invoke-virtual {v3, v1, p1}, Landroidx/constraintlayout/widget/ConstraintLayout;->getDesignInformation(ILjava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
if-eqz v1, :cond_3
|
||
|
|
||
|
instance-of v3, v1, Ljava/lang/Integer;
|
||
|
|
||
|
if-eqz v3, :cond_3
|
||
|
|
||
|
check-cast v1, Ljava/lang/Integer;
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
:cond_3
|
||
|
if-eqz v2, :cond_4
|
||
|
|
||
|
invoke-virtual {p0, v2, v0}, Landroidx/constraintlayout/widget/ConstraintHelper;->setTag(ILjava/lang/Object;)V
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_4
|
||
|
new-instance v0, Ljava/lang/StringBuilder;
|
||
|
|
||
|
const-string v1, "Could not find id of \""
|
||
|
|
||
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
const-string 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
|
||
|
|
||
|
const-string v0, "ConstraintHelper"
|
||
|
|
||
|
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private setIds(Ljava/lang/String;)V
|
||
|
.locals 3
|
||
|
|
||
|
if-nez p1, :cond_0
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
const/16 v1, 0x2c
|
||
|
|
||
|
invoke-virtual {p1, v1, v0}, Ljava/lang/String;->indexOf(II)I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
const/4 v2, -0x1
|
||
|
|
||
|
if-ne v1, v2, :cond_1
|
||
|
|
||
|
invoke-virtual {p1, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-direct {p0, p1}, Landroidx/constraintlayout/widget/ConstraintHelper;->addID(Ljava/lang/String;)V
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
invoke-virtual {p1, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-direct {p0, v0}, Landroidx/constraintlayout/widget/ConstraintHelper;->addID(Ljava/lang/String;)V
|
||
|
|
||
|
add-int/lit8 v0, v1, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public getReferencedIds()[I
|
||
|
.locals 2
|
||
|
|
||
|
iget-object v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mIds:[I
|
||
|
|
||
|
iget v1, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mCount:I
|
||
|
|
||
|
invoke-static {v0, v1}, Ljava/util/Arrays;->copyOf([II)[I
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method protected init(Landroid/util/AttributeSet;)V
|
||
|
.locals 4
|
||
|
|
||
|
if-eqz p1, :cond_1
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/constraintlayout/widget/ConstraintHelper;->getContext()Landroid/content/Context;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sget-object v1, Landroidx/constraintlayout/widget/R$styleable;->ConstraintLayout_Layout:[I
|
||
|
|
||
|
invoke-virtual {v0, p1, v1}, 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 v0
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
if-ge v1, v0, :cond_1
|
||
|
|
||
|
invoke-virtual {p1, v1}, Landroid/content/res/TypedArray;->getIndex(I)I
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
sget v3, Landroidx/constraintlayout/widget/R$styleable;->ConstraintLayout_Layout_constraint_referenced_ids:I
|
||
|
|
||
|
if-ne v2, v3, :cond_0
|
||
|
|
||
|
invoke-virtual {p1, v2}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
iput-object v2, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mReferenceIds:Ljava/lang/String;
|
||
|
|
||
|
iget-object v2, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mReferenceIds:Ljava/lang/String;
|
||
|
|
||
|
invoke-direct {p0, v2}, Landroidx/constraintlayout/widget/ConstraintHelper;->setIds(Ljava/lang/String;)V
|
||
|
|
||
|
:cond_0
|
||
|
add-int/lit8 v1, v1, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_1
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public onDraw(Landroid/graphics/Canvas;)V
|
||
|
.locals 0
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method protected onMeasure(II)V
|
||
|
.locals 1
|
||
|
|
||
|
iget-boolean v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mUseViewMeasure:Z
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-super {p0, p1, p2}, Landroid/view/View;->onMeasure(II)V
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
invoke-virtual {p0, p1, p1}, Landroidx/constraintlayout/widget/ConstraintHelper;->setMeasuredDimension(II)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setReferencedIds([I)V
|
||
|
.locals 3
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
iput v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mCount:I
|
||
|
|
||
|
:goto_0
|
||
|
array-length v1, p1
|
||
|
|
||
|
if-ge v0, v1, :cond_0
|
||
|
|
||
|
aget v1, p1, v0
|
||
|
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
invoke-virtual {p0, v1, v2}, Landroidx/constraintlayout/widget/ConstraintHelper;->setTag(ILjava/lang/Object;)V
|
||
|
|
||
|
add-int/lit8 v0, v0, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setTag(ILjava/lang/Object;)V
|
||
|
.locals 2
|
||
|
|
||
|
iget p2, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mCount:I
|
||
|
|
||
|
add-int/lit8 p2, p2, 0x1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mIds:[I
|
||
|
|
||
|
array-length v1, v0
|
||
|
|
||
|
if-le p2, v1, :cond_0
|
||
|
|
||
|
array-length p2, v0
|
||
|
|
||
|
mul-int/lit8 p2, p2, 0x2
|
||
|
|
||
|
invoke-static {v0, p2}, Ljava/util/Arrays;->copyOf([II)[I
|
||
|
|
||
|
move-result-object p2
|
||
|
|
||
|
iput-object p2, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mIds:[I
|
||
|
|
||
|
:cond_0
|
||
|
iget-object p2, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mIds:[I
|
||
|
|
||
|
iget v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mCount:I
|
||
|
|
||
|
aput p1, p2, v0
|
||
|
|
||
|
add-int/lit8 v0, v0, 0x1
|
||
|
|
||
|
iput v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mCount:I
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public updatePostLayout(Landroidx/constraintlayout/widget/ConstraintLayout;)V
|
||
|
.locals 0
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public updatePostMeasure(Landroidx/constraintlayout/widget/ConstraintLayout;)V
|
||
|
.locals 0
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public updatePreLayout(Landroidx/constraintlayout/widget/ConstraintLayout;)V
|
||
|
.locals 3
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/constraintlayout/widget/ConstraintHelper;->isInEditMode()Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
iget-object v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mReferenceIds:Ljava/lang/String;
|
||
|
|
||
|
invoke-direct {p0, v0}, Landroidx/constraintlayout/widget/ConstraintHelper;->setIds(Ljava/lang/String;)V
|
||
|
|
||
|
:cond_0
|
||
|
iget-object v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mHelperWidget:Landroidx/constraintlayout/solver/widgets/Helper;
|
||
|
|
||
|
if-nez v0, :cond_1
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
invoke-virtual {v0}, Landroidx/constraintlayout/solver/widgets/Helper;->removeAllIds()V
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
iget v1, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mCount:I
|
||
|
|
||
|
if-ge v0, v1, :cond_3
|
||
|
|
||
|
iget-object v1, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mIds:[I
|
||
|
|
||
|
aget v1, v1, v0
|
||
|
|
||
|
invoke-virtual {p1, v1}, Landroidx/constraintlayout/widget/ConstraintLayout;->getViewById(I)Landroid/view/View;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
if-eqz v1, :cond_2
|
||
|
|
||
|
iget-object v2, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mHelperWidget:Landroidx/constraintlayout/solver/widgets/Helper;
|
||
|
|
||
|
invoke-virtual {p1, v1}, Landroidx/constraintlayout/widget/ConstraintLayout;->getViewWidget(Landroid/view/View;)Landroidx/constraintlayout/solver/widgets/ConstraintWidget;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v2, v1}, Landroidx/constraintlayout/solver/widgets/Helper;->add(Landroidx/constraintlayout/solver/widgets/ConstraintWidget;)V
|
||
|
|
||
|
:cond_2
|
||
|
add-int/lit8 v0, v0, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_3
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public validateParams()V
|
||
|
.locals 2
|
||
|
|
||
|
iget-object v0, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mHelperWidget:Landroidx/constraintlayout/solver/widgets/Helper;
|
||
|
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
invoke-virtual {p0}, Landroidx/constraintlayout/widget/ConstraintHelper;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
instance-of v1, v0, Landroidx/constraintlayout/widget/ConstraintLayout$LayoutParams;
|
||
|
|
||
|
if-eqz v1, :cond_1
|
||
|
|
||
|
check-cast v0, Landroidx/constraintlayout/widget/ConstraintLayout$LayoutParams;
|
||
|
|
||
|
iget-object v1, p0, Landroidx/constraintlayout/widget/ConstraintHelper;->mHelperWidget:Landroidx/constraintlayout/solver/widgets/Helper;
|
||
|
|
||
|
iput-object v1, v0, Landroidx/constraintlayout/widget/ConstraintLayout$LayoutParams;->widget:Landroidx/constraintlayout/solver/widgets/ConstraintWidget;
|
||
|
|
||
|
:cond_1
|
||
|
return-void
|
||
|
.end method
|