apkfuckery/com.discord/smali/androidx/appcompat/widget/ButtonBarLayout.smali

460 lines
9.5 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public Landroidx/appcompat/widget/ButtonBarLayout;
.super Landroid/widget/LinearLayout;
.source "ButtonBarLayout.java"
2019-12-06 03:29:40 +00:00
# annotations
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
2019-07-24 11:27:29 +00:00
# static fields
2019-12-06 03:29:40 +00:00
.field public static final PEEK_BUTTON_DP:I = 0x10
2019-07-24 11:27:29 +00:00
# instance fields
2019-12-06 03:29:40 +00:00
.field public mAllowStacking:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mLastWidthSize:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mMinimumHeight:I
2019-07-24 11:27:29 +00:00
# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
2019-11-15 02:21:15 +00:00
.locals 8
2019-07-24 11:27:29 +00:00
invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
const/4 v0, -0x1
iput v0, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mLastWidthSize:I
const/4 v0, 0x0
iput v0, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mMinimumHeight:I
sget-object v0, Landroidx/appcompat/R$styleable;->ButtonBarLayout:[I
invoke-virtual {p1, p2, v0}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
2019-11-15 02:21:15 +00:00
move-result-object v0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
const/16 v2, 0x1d
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-lt v1, v2, :cond_0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget-object v3, Landroidx/appcompat/R$styleable;->ButtonBarLayout:[I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
const/4 v6, 0x0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
const/4 v7, 0x0
move-object v1, p0
move-object v2, p1
move-object v4, p2
move-object v5, v0
2019-12-06 03:29:40 +00:00
invoke-virtual/range {v1 .. v7}, Landroid/widget/LinearLayout;->saveAttributeDataForStyleable(Landroid/content/Context;[ILandroid/util/AttributeSet;Landroid/content/res/TypedArray;II)V
2019-11-15 02:21:15 +00:00
:cond_0
sget p1, Landroidx/appcompat/R$styleable;->ButtonBarLayout_allowStacking:I
const/4 p2, 0x1
invoke-virtual {v0, p1, p2}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result p1
iput-boolean p1, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mAllowStacking:Z
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method private getNextVisibleChildIndex(I)I
.locals 2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getChildCount()I
2019-07-24 11:27:29 +00:00
move-result v0
:goto_0
if-ge p1, v0, :cond_1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
2019-07-24 11:27:29 +00:00
move-result-object v1
invoke-virtual {v1}, Landroid/view/View;->getVisibility()I
move-result v1
if-nez v1, :cond_0
return p1
:cond_0
add-int/lit8 p1, p1, 0x1
goto :goto_0
:cond_1
const/4 p1, -0x1
return p1
.end method
.method private isStacked()Z
.locals 2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getOrientation()I
2019-07-24 11:27:29 +00:00
move-result v0
const/4 v1, 0x1
if-ne v0, v1, :cond_0
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_0
2019-12-06 03:29:40 +00:00
const/4 v1, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:goto_0
return v1
2019-07-24 11:27:29 +00:00
.end method
.method private setStacked(Z)V
.locals 1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroid/widget/LinearLayout;->setOrientation(I)V
2019-07-24 11:27:29 +00:00
if-eqz p1, :cond_0
const/4 v0, 0x5
goto :goto_0
:cond_0
const/16 v0, 0x50
:goto_0
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v0}, Landroid/widget/LinearLayout;->setGravity(I)V
2019-07-24 11:27:29 +00:00
sget v0, Landroidx/appcompat/R$id;->spacer:I
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v0}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;
2019-07-24 11:27:29 +00:00
move-result-object v0
if-eqz v0, :cond_2
if-eqz p1, :cond_1
const/16 p1, 0x8
goto :goto_1
:cond_1
const/4 p1, 0x4
:goto_1
invoke-virtual {v0, p1}, Landroid/view/View;->setVisibility(I)V
:cond_2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getChildCount()I
2019-07-24 11:27:29 +00:00
move-result p1
add-int/lit8 p1, p1, -0x2
:goto_2
if-ltz p1, :cond_3
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
2019-07-24 11:27:29 +00:00
move-result-object v0
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v0}, Landroid/widget/LinearLayout;->bringChildToFront(Landroid/view/View;)V
2019-07-24 11:27:29 +00:00
add-int/lit8 p1, p1, -0x1
goto :goto_2
:cond_3
return-void
.end method
# virtual methods
.method public getMinimumHeight()I
.locals 2
iget v0, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mMinimumHeight:I
invoke-super {p0}, Landroid/widget/LinearLayout;->getMinimumHeight()I
move-result v1
invoke-static {v0, v1}, Ljava/lang/Math;->max(II)I
move-result v0
return v0
.end method
2019-12-06 03:29:40 +00:00
.method public onMeasure(II)V
2019-07-24 11:27:29 +00:00
.locals 5
invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I
move-result v0
iget-boolean v1, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mAllowStacking:Z
const/4 v2, 0x0
if-eqz v1, :cond_1
iget v1, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mLastWidthSize:I
if-le v0, v1, :cond_0
invoke-direct {p0}, Landroidx/appcompat/widget/ButtonBarLayout;->isStacked()Z
move-result v1
if-eqz v1, :cond_0
invoke-direct {p0, v2}, Landroidx/appcompat/widget/ButtonBarLayout;->setStacked(Z)V
:cond_0
iput v0, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mLastWidthSize:I
:cond_1
invoke-direct {p0}, Landroidx/appcompat/widget/ButtonBarLayout;->isStacked()Z
move-result v1
const/4 v3, 0x1
if-nez v1, :cond_2
invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I
move-result v1
const/high16 v4, 0x40000000 # 2.0f
if-ne v1, v4, :cond_2
const/high16 v1, -0x80000000
invoke-static {v0, v1}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
move-result v0
const/4 v1, 0x1
goto :goto_0
:cond_2
move v0, p1
const/4 v1, 0x0
:goto_0
invoke-super {p0, v0, p2}, Landroid/widget/LinearLayout;->onMeasure(II)V
iget-boolean v0, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mAllowStacking:Z
if-eqz v0, :cond_4
invoke-direct {p0}, Landroidx/appcompat/widget/ButtonBarLayout;->isStacked()Z
move-result v0
if-nez v0, :cond_4
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getMeasuredWidthAndState()I
2019-07-24 11:27:29 +00:00
move-result v0
const/high16 v4, -0x1000000
and-int/2addr v0, v4
const/high16 v4, 0x1000000
if-ne v0, v4, :cond_3
const/4 v0, 0x1
goto :goto_1
:cond_3
const/4 v0, 0x0
:goto_1
if-eqz v0, :cond_4
invoke-direct {p0, v3}, Landroidx/appcompat/widget/ButtonBarLayout;->setStacked(Z)V
const/4 v1, 0x1
:cond_4
if-eqz v1, :cond_5
invoke-super {p0, p1, p2}, Landroid/widget/LinearLayout;->onMeasure(II)V
:cond_5
invoke-direct {p0, v2}, Landroidx/appcompat/widget/ButtonBarLayout;->getNextVisibleChildIndex(I)I
move-result p1
if-ltz p1, :cond_8
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
2019-07-24 11:27:29 +00:00
move-result-object p2
invoke-virtual {p2}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
move-result-object v0
check-cast v0, Landroid/widget/LinearLayout$LayoutParams;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getPaddingTop()I
2019-07-24 11:27:29 +00:00
move-result v1
invoke-virtual {p2}, Landroid/view/View;->getMeasuredHeight()I
move-result p2
2019-12-06 03:29:40 +00:00
add-int/2addr p2, v1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v1, v0, Landroid/widget/LinearLayout$LayoutParams;->topMargin:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr p2, v1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v0, v0, Landroid/widget/LinearLayout$LayoutParams;->bottomMargin:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr p2, v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr p2, v2
2019-07-24 11:27:29 +00:00
invoke-direct {p0}, Landroidx/appcompat/widget/ButtonBarLayout;->isStacked()Z
2019-12-06 03:29:40 +00:00
move-result v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz v0, :cond_7
2019-07-24 11:27:29 +00:00
add-int/2addr p1, v3
invoke-direct {p0, p1}, Landroidx/appcompat/widget/ButtonBarLayout;->getNextVisibleChildIndex(I)I
move-result p1
if-ltz p1, :cond_6
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;
2019-07-24 11:27:29 +00:00
move-result-object p1
invoke-virtual {p1}, Landroid/view/View;->getPaddingTop()I
move-result p1
2019-12-06 03:29:40 +00:00
const/high16 v0, 0x41800000 # 16.0f
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getResources()Landroid/content/res/Resources;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v1
iget v1, v1, Landroid/util/DisplayMetrics;->density:F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
mul-float v1, v1, v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
float-to-int v0, v1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr p1, v0
2019-07-24 11:27:29 +00:00
add-int/2addr p1, p2
2019-12-06 03:29:40 +00:00
move v2, p1
goto :goto_2
2019-07-24 11:27:29 +00:00
:cond_6
2019-12-06 03:29:40 +00:00
move v2, p2
2019-07-24 11:27:29 +00:00
goto :goto_2
:cond_7
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getPaddingBottom()I
2019-07-24 11:27:29 +00:00
move-result p1
2019-12-06 03:29:40 +00:00
add-int v2, p1, p2
2019-07-24 11:27:29 +00:00
:cond_8
:goto_2
invoke-static {p0}, Landroidx/core/view/ViewCompat;->getMinimumHeight(Landroid/view/View;)I
move-result p1
if-eq p1, v2, :cond_9
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v2}, Landroid/widget/LinearLayout;->setMinimumHeight(I)V
2019-07-24 11:27:29 +00:00
:cond_9
return-void
.end method
.method public setAllowStacking(Z)V
.locals 1
iget-boolean v0, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mAllowStacking:Z
if-eq v0, p1, :cond_1
iput-boolean p1, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mAllowStacking:Z
iget-boolean p1, p0, Landroidx/appcompat/widget/ButtonBarLayout;->mAllowStacking:Z
if-nez p1, :cond_0
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getOrientation()I
2019-07-24 11:27:29 +00:00
move-result p1
const/4 v0, 0x1
if-ne p1, v0, :cond_0
const/4 p1, 0x0
invoke-direct {p0, p1}, Landroidx/appcompat/widget/ButtonBarLayout;->setStacked(Z)V
:cond_0
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/LinearLayout;->requestLayout()V
2019-07-24 11:27:29 +00:00
:cond_1
return-void
.end method