180 lines
4.2 KiB
Smali
180 lines
4.2 KiB
Smali
|
.class public Landroidx/preference/internal/PreferenceImageView;
|
||
|
.super Landroid/widget/ImageView;
|
||
|
.source "PreferenceImageView.java"
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field private mMaxHeight:I
|
||
|
|
||
|
.field private mMaxWidth:I
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>(Landroid/content/Context;)V
|
||
|
.locals 1
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
invoke-direct {p0, p1, v0}, Landroidx/preference/internal/PreferenceImageView;-><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
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
invoke-direct {p0, p1, p2, v0}, Landroidx/preference/internal/PreferenceImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
||
|
.locals 3
|
||
|
|
||
|
invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
||
|
|
||
|
const v0, 0x7fffffff
|
||
|
|
||
|
iput v0, p0, Landroidx/preference/internal/PreferenceImageView;->mMaxWidth:I
|
||
|
|
||
|
iput v0, p0, Landroidx/preference/internal/PreferenceImageView;->mMaxHeight:I
|
||
|
|
||
|
sget-object v1, Landroidx/preference/R$styleable;->PreferenceImageView:[I
|
||
|
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
invoke-virtual {p1, p2, v1, p3, v2}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
sget p2, Landroidx/preference/R$styleable;->PreferenceImageView_maxWidth:I
|
||
|
|
||
|
invoke-virtual {p1, p2, v0}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I
|
||
|
|
||
|
move-result p2
|
||
|
|
||
|
invoke-virtual {p0, p2}, Landroidx/preference/internal/PreferenceImageView;->setMaxWidth(I)V
|
||
|
|
||
|
sget p2, Landroidx/preference/R$styleable;->PreferenceImageView_maxHeight:I
|
||
|
|
||
|
invoke-virtual {p1, p2, v0}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I
|
||
|
|
||
|
move-result p2
|
||
|
|
||
|
invoke-virtual {p0, p2}, Landroidx/preference/internal/PreferenceImageView;->setMaxHeight(I)V
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public getMaxHeight()I
|
||
|
.locals 1
|
||
|
|
||
|
iget v0, p0, Landroidx/preference/internal/PreferenceImageView;->mMaxHeight:I
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method public getMaxWidth()I
|
||
|
.locals 1
|
||
|
|
||
|
iget v0, p0, Landroidx/preference/internal/PreferenceImageView;->mMaxWidth:I
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method protected onMeasure(II)V
|
||
|
.locals 5
|
||
|
|
||
|
invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
const v1, 0x7fffffff
|
||
|
|
||
|
const/high16 v2, -0x80000000
|
||
|
|
||
|
if-eq v0, v2, :cond_0
|
||
|
|
||
|
if-nez v0, :cond_2
|
||
|
|
||
|
:cond_0
|
||
|
invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/preference/internal/PreferenceImageView;->getMaxWidth()I
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eq v4, v1, :cond_2
|
||
|
|
||
|
if-lt v4, v3, :cond_1
|
||
|
|
||
|
if-nez v0, :cond_2
|
||
|
|
||
|
:cond_1
|
||
|
invoke-static {v4, v2}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
:cond_2
|
||
|
invoke-static {p2}, Landroid/view/View$MeasureSpec;->getMode(I)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eq v0, v2, :cond_3
|
||
|
|
||
|
if-nez v0, :cond_5
|
||
|
|
||
|
:cond_3
|
||
|
invoke-static {p2}, Landroid/view/View$MeasureSpec;->getSize(I)I
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/preference/internal/PreferenceImageView;->getMaxHeight()I
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eq v4, v1, :cond_5
|
||
|
|
||
|
if-lt v4, v3, :cond_4
|
||
|
|
||
|
if-nez v0, :cond_5
|
||
|
|
||
|
:cond_4
|
||
|
invoke-static {v4, v2}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
|
||
|
|
||
|
move-result p2
|
||
|
|
||
|
:cond_5
|
||
|
invoke-super {p0, p1, p2}, Landroid/widget/ImageView;->onMeasure(II)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setMaxHeight(I)V
|
||
|
.locals 0
|
||
|
|
||
|
iput p1, p0, Landroidx/preference/internal/PreferenceImageView;->mMaxHeight:I
|
||
|
|
||
|
invoke-super {p0, p1}, Landroid/widget/ImageView;->setMaxHeight(I)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setMaxWidth(I)V
|
||
|
.locals 0
|
||
|
|
||
|
iput p1, p0, Landroidx/preference/internal/PreferenceImageView;->mMaxWidth:I
|
||
|
|
||
|
invoke-super {p0, p1}, Landroid/widget/ImageView;->setMaxWidth(I)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|