298 lines
8.3 KiB
Smali
298 lines
8.3 KiB
Smali
|
.class Landroidx/swiperefreshlayout/widget/CircleImageView;
|
||
|
.super Landroid/widget/ImageView;
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation system Ldalvik/annotation/MemberClasses;
|
||
|
value = {
|
||
|
Landroidx/swiperefreshlayout/widget/CircleImageView$OvalShadow;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field private static final FILL_SHADOW_COLOR:I = 0x3d000000
|
||
|
|
||
|
.field private static final KEY_SHADOW_COLOR:I = 0x1e000000
|
||
|
|
||
|
.field private static final SHADOW_ELEVATION:I = 0x4
|
||
|
|
||
|
.field private static final SHADOW_RADIUS:F = 3.5f
|
||
|
|
||
|
.field private static final X_OFFSET:F = 0.0f
|
||
|
|
||
|
.field private static final Y_OFFSET:F = 1.75f
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field private mListener:Landroid/view/animation/Animation$AnimationListener;
|
||
|
|
||
|
.field mShadowRadius:I
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method constructor <init>(Landroid/content/Context;I)V
|
||
|
.locals 5
|
||
|
|
||
|
invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->getContext()Landroid/content/Context;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
iget p1, p1, Landroid/util/DisplayMetrics;->density:F
|
||
|
|
||
|
const/high16 v0, 0x3fe00000 # 1.75f
|
||
|
|
||
|
mul-float v0, v0, p1
|
||
|
|
||
|
float-to-int v0, v0
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
mul-float v1, v1, p1
|
||
|
|
||
|
float-to-int v1, v1
|
||
|
|
||
|
const/high16 v2, 0x40600000 # 3.5f
|
||
|
|
||
|
mul-float v2, v2, p1
|
||
|
|
||
|
float-to-int v2, v2
|
||
|
|
||
|
iput v2, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mShadowRadius:I
|
||
|
|
||
|
invoke-direct {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->elevationSupported()Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
new-instance v0, Landroid/graphics/drawable/ShapeDrawable;
|
||
|
|
||
|
new-instance v1, Landroid/graphics/drawable/shapes/OvalShape;
|
||
|
|
||
|
invoke-direct {v1}, Landroid/graphics/drawable/shapes/OvalShape;-><init>()V
|
||
|
|
||
|
invoke-direct {v0, v1}, Landroid/graphics/drawable/ShapeDrawable;-><init>(Landroid/graphics/drawable/shapes/Shape;)V
|
||
|
|
||
|
const/high16 v1, 0x40800000 # 4.0f
|
||
|
|
||
|
mul-float p1, p1, v1
|
||
|
|
||
|
invoke-static {p0, p1}, Landroidx/core/view/ViewCompat;->setElevation(Landroid/view/View;F)V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p1, Landroidx/swiperefreshlayout/widget/CircleImageView$OvalShadow;
|
||
|
|
||
|
iget v2, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mShadowRadius:I
|
||
|
|
||
|
invoke-direct {p1, p0, v2}, Landroidx/swiperefreshlayout/widget/CircleImageView$OvalShadow;-><init>(Landroidx/swiperefreshlayout/widget/CircleImageView;I)V
|
||
|
|
||
|
new-instance v2, Landroid/graphics/drawable/ShapeDrawable;
|
||
|
|
||
|
invoke-direct {v2, p1}, Landroid/graphics/drawable/ShapeDrawable;-><init>(Landroid/graphics/drawable/shapes/Shape;)V
|
||
|
|
||
|
const/4 p1, 0x1
|
||
|
|
||
|
invoke-virtual {v2}, Landroid/graphics/drawable/ShapeDrawable;->getPaint()Landroid/graphics/Paint;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-virtual {p0, p1, v3}, Landroidx/swiperefreshlayout/widget/CircleImageView;->setLayerType(ILandroid/graphics/Paint;)V
|
||
|
|
||
|
invoke-virtual {v2}, Landroid/graphics/drawable/ShapeDrawable;->getPaint()Landroid/graphics/Paint;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
iget v3, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mShadowRadius:I
|
||
|
|
||
|
int-to-float v3, v3
|
||
|
|
||
|
int-to-float v1, v1
|
||
|
|
||
|
int-to-float v0, v0
|
||
|
|
||
|
const/high16 v4, 0x1e000000
|
||
|
|
||
|
invoke-virtual {p1, v3, v1, v0, v4}, Landroid/graphics/Paint;->setShadowLayer(FFFI)V
|
||
|
|
||
|
iget p1, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mShadowRadius:I
|
||
|
|
||
|
invoke-virtual {p0, p1, p1, p1, p1}, Landroidx/swiperefreshlayout/widget/CircleImageView;->setPadding(IIII)V
|
||
|
|
||
|
move-object v0, v2
|
||
|
|
||
|
:goto_0
|
||
|
invoke-virtual {v0}, Landroid/graphics/drawable/ShapeDrawable;->getPaint()Landroid/graphics/Paint;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p1, p2}, Landroid/graphics/Paint;->setColor(I)V
|
||
|
|
||
|
invoke-static {p0, v0}, Landroidx/core/view/ViewCompat;->setBackground(Landroid/view/View;Landroid/graphics/drawable/Drawable;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private elevationSupported()Z
|
||
|
.locals 2
|
||
|
|
||
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
||
|
|
||
|
const/16 v1, 0x15
|
||
|
|
||
|
if-lt v0, v1, :cond_0
|
||
|
|
||
|
const/4 v0, 0x1
|
||
|
|
||
|
return v0
|
||
|
|
||
|
:cond_0
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public onAnimationEnd()V
|
||
|
.locals 2
|
||
|
|
||
|
invoke-super {p0}, Landroid/widget/ImageView;->onAnimationEnd()V
|
||
|
|
||
|
iget-object v0, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mListener:Landroid/view/animation/Animation$AnimationListener;
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
iget-object v0, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mListener:Landroid/view/animation/Animation$AnimationListener;
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->getAnimation()Landroid/view/animation/Animation;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-interface {v0, v1}, Landroid/view/animation/Animation$AnimationListener;->onAnimationEnd(Landroid/view/animation/Animation;)V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public onAnimationStart()V
|
||
|
.locals 2
|
||
|
|
||
|
invoke-super {p0}, Landroid/widget/ImageView;->onAnimationStart()V
|
||
|
|
||
|
iget-object v0, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mListener:Landroid/view/animation/Animation$AnimationListener;
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
iget-object v0, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mListener:Landroid/view/animation/Animation$AnimationListener;
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->getAnimation()Landroid/view/animation/Animation;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-interface {v0, v1}, Landroid/view/animation/Animation$AnimationListener;->onAnimationStart(Landroid/view/animation/Animation;)V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method protected onMeasure(II)V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-super {p0, p1, p2}, Landroid/widget/ImageView;->onMeasure(II)V
|
||
|
|
||
|
invoke-direct {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->elevationSupported()Z
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
if-nez p1, :cond_0
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->getMeasuredWidth()I
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
iget p2, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mShadowRadius:I
|
||
|
|
||
|
mul-int/lit8 p2, p2, 0x2
|
||
|
|
||
|
add-int/2addr p1, p2
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->getMeasuredHeight()I
|
||
|
|
||
|
move-result p2
|
||
|
|
||
|
iget v0, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mShadowRadius:I
|
||
|
|
||
|
mul-int/lit8 v0, v0, 0x2
|
||
|
|
||
|
add-int/2addr p2, v0
|
||
|
|
||
|
invoke-virtual {p0, p1, p2}, Landroidx/swiperefreshlayout/widget/CircleImageView;->setMeasuredDimension(II)V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V
|
||
|
.locals 0
|
||
|
|
||
|
iput-object p1, p0, Landroidx/swiperefreshlayout/widget/CircleImageView;->mListener:Landroid/view/animation/Animation$AnimationListener;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setBackgroundColor(I)V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->getBackground()Landroid/graphics/drawable/Drawable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
instance-of v0, v0, Landroid/graphics/drawable/ShapeDrawable;
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->getBackground()Landroid/graphics/drawable/Drawable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Landroid/graphics/drawable/ShapeDrawable;
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/graphics/drawable/ShapeDrawable;->getPaint()Landroid/graphics/Paint;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColor(I)V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setBackgroundColorRes(I)V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/swiperefreshlayout/widget/CircleImageView;->getContext()Landroid/content/Context;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {v0, p1}, Landroidx/core/content/ContextCompat;->getColor(Landroid/content/Context;I)I
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/swiperefreshlayout/widget/CircleImageView;->setBackgroundColor(I)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|