2020-05-17 12:40:10 +00:00
|
|
|
.class public final Landroidx/core/graphics/drawable/DrawableKt;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "Drawable.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static final toBitmap(Landroid/graphics/drawable/Drawable;IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
|
|
|
|
.locals 6
|
|
|
|
.param p1 # I
|
|
|
|
.annotation build Landroidx/annotation/Px;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p2 # I
|
|
|
|
.annotation build Landroidx/annotation/Px;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "$this$toBitmap"
|
|
|
|
|
2020-09-22 06:09:03 +00:00
|
|
|
invoke-static {p0, v0}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
instance-of v0, p0, Landroid/graphics/drawable/BitmapDrawable;
|
|
|
|
|
|
|
|
const-string v1, "bitmap"
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
|
|
|
|
move-object v0, p0
|
|
|
|
|
|
|
|
check-cast v0, Landroid/graphics/drawable/BitmapDrawable;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2020-09-22 06:09:03 +00:00
|
|
|
invoke-static {v0, v1}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-ne v0, p3, :cond_2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
check-cast p0, Landroid/graphics/drawable/BitmapDrawable;
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/BitmapDrawable;->getIntrinsicWidth()I
|
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
if-ne p1, p3, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/BitmapDrawable;->getIntrinsicHeight()I
|
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
if-ne p2, p3, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
2020-09-22 06:09:03 +00:00
|
|
|
invoke-static {p0, v1}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object p0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
const/4 p3, 0x1
|
|
|
|
|
|
|
|
invoke-static {p0, p1, p2, p3}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
const-string p1, "Bitmap.createScaledBitma\u2026map, width, height, true)"
|
|
|
|
|
2020-09-22 06:09:03 +00:00
|
|
|
invoke-static {p0, p1}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object p0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget v2, v0, Landroid/graphics/Rect;->left:I
|
|
|
|
|
|
|
|
iget v3, v0, Landroid/graphics/Rect;->top:I
|
|
|
|
|
|
|
|
iget v4, v0, Landroid/graphics/Rect;->right:I
|
|
|
|
|
|
|
|
iget v0, v0, Landroid/graphics/Rect;->bottom:I
|
|
|
|
|
|
|
|
if-eqz p3, :cond_3
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
sget-object p3, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-static {p1, p2, p3}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v5, v5, p1, p2}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
|
|
|
|
|
|
|
|
new-instance p1, Landroid/graphics/Canvas;
|
|
|
|
|
|
|
|
invoke-direct {p1, p3}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
|
|
|
|
|
|
|
|
invoke-virtual {p0, v2, v3, v4, v0}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
|
|
|
|
|
2020-09-22 06:09:03 +00:00
|
|
|
invoke-static {p3, v1}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object p3
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic toBitmap$default(Landroid/graphics/drawable/Drawable;IILandroid/graphics/Bitmap$Config;ILjava/lang/Object;)Landroid/graphics/Bitmap;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
and-int/lit8 p5, p4, 0x1
|
|
|
|
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
and-int/lit8 p5, p4, 0x2
|
|
|
|
|
|
|
|
if-eqz p5, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
|
|
|
|
if-eqz p4, :cond_2
|
|
|
|
|
|
|
|
const/4 p3, 0x0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-static {p0, p1, p2, p3}, Landroidx/core/graphics/drawable/DrawableKt;->toBitmap(Landroid/graphics/drawable/Drawable;IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final updateBounds(Landroid/graphics/drawable/Drawable;IIII)V
|
2020-09-16 23:45:23 +00:00
|
|
|
.locals 1
|
2020-05-17 12:40:10 +00:00
|
|
|
.param p1 # I
|
|
|
|
.annotation build Landroidx/annotation/Px;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p2 # I
|
|
|
|
.annotation build Landroidx/annotation/Px;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p3 # I
|
|
|
|
.annotation build Landroidx/annotation/Px;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p4 # I
|
|
|
|
.annotation build Landroidx/annotation/Px;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "$this$updateBounds"
|
|
|
|
|
2020-09-22 06:09:03 +00:00
|
|
|
invoke-static {p0, v0}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0, p1, p2, p3, p4}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic updateBounds$default(Landroid/graphics/drawable/Drawable;IIIIILjava/lang/Object;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
and-int/lit8 p6, p5, 0x1
|
|
|
|
|
|
|
|
if-eqz p6, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iget p1, p1, Landroid/graphics/Rect;->left:I
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
and-int/lit8 p6, p5, 0x2
|
|
|
|
|
|
|
|
if-eqz p6, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
iget p2, p2, Landroid/graphics/Rect;->top:I
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
and-int/lit8 p6, p5, 0x4
|
|
|
|
|
|
|
|
if-eqz p6, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
|
|
|
iget p3, p3, Landroid/graphics/Rect;->right:I
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
and-int/lit8 p5, p5, 0x8
|
|
|
|
|
|
|
|
if-eqz p5, :cond_3
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
move-result-object p4
|
|
|
|
|
|
|
|
iget p4, p4, Landroid/graphics/Rect;->bottom:I
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
invoke-static {p0, p1, p2, p3, p4}, Landroidx/core/graphics/drawable/DrawableKt;->updateBounds(Landroid/graphics/drawable/Drawable;IIII)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|