2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/views/StatusView;
|
|
|
|
.super Landroidx/appcompat/widget/AppCompatImageView;
|
|
|
|
.source "StatusView.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public d:F
|
|
|
|
|
|
|
|
.field public e:Landroid/graphics/Paint;
|
|
|
|
|
|
|
|
.field public f:Z
|
|
|
|
|
|
|
|
.field public g:Z
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
2020-07-08 16:44:49 +00:00
|
|
|
.locals 4
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "context"
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/appcompat/widget/AppCompatImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
|
|
|
|
const/high16 p1, 0x40000000 # 2.0f
|
|
|
|
|
|
|
|
iput p1, p0, Lcom/discord/views/StatusView;->d:F
|
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Lcom/discord/views/StatusView;->f:Z
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Lcom/discord/views/StatusView;->g:Z
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setAdjustViewBounds(Z)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object v0, Landroid/widget/ImageView$ScaleType;->FIT_XY:Landroid/widget/ImageView$ScaleType;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p0, v0}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result-object v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object v1, Lcom/discord/R$a;->StatusView:[I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v2, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v0, p2, v1, v2, v2}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result-object p2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-13 20:45:03 +00:00
|
|
|
const-string v0, "context.obtainStyledAttr\u2026yleable.StatusView, 0, 0)"
|
|
|
|
|
|
|
|
invoke-static {p2, v0}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v0, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:try_start_0
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p2, p1, v0}, Landroid/content/res/TypedArray;->getDimension(IF)F
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result v1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
float-to-int v1, v1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p0, v1}, Lcom/discord/views/StatusView;->setBorderWidth(I)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p2, v2, v2}, Landroid/content/res/TypedArray;->getColor(II)I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result v1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
new-instance v2, Landroid/graphics/Paint;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-direct {v2}, Landroid/graphics/Paint;-><init>()V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object v3, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v2, v1}, Landroid/graphics/Paint;->setColor(I)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iput-object v2, p0, Lcom/discord/views/StatusView;->e:Landroid/graphics/Paint;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v1, 0x3
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p2, v1, p1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result p1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iput-boolean p1, p0, Lcom/discord/views/StatusView;->f:Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 p1, 0x2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p2, p1, v0}, Landroid/content/res/TypedArray;->getDimension(IF)F
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result p1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iput p1, p0, Lcom/discord/views/StatusView;->d:F
|
2020-05-17 12:40:10 +00:00
|
|
|
:try_end_0
|
|
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p2}, Landroid/content/res/TypedArray;->recycle()V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:catchall_0
|
2020-07-08 16:44:49 +00:00
|
|
|
move-exception p1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {p2}, Landroid/content/res/TypedArray;->recycle()V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
throw p1
|
2020-05-17 12:40:10 +00:00
|
|
|
.end method
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
|
|
|
|
# virtual methods
|
2020-05-17 12:40:10 +00:00
|
|
|
.method public onDraw(Landroid/graphics/Canvas;)V
|
|
|
|
.locals 11
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "canvas"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-09-09 19:21:20 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
iget-boolean v0, p0, Lcom/discord/views/StatusView;->g:Z
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string v2, "backgroundPaint"
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
if-eqz v0, :cond_1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getWidth()I
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
move-result v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
int-to-float v0, v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/high16 v3, 0x40000000 # 2.0f
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
div-float/2addr v0, v3
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getHeight()I
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
int-to-float v4, v4
|
|
|
|
|
|
|
|
div-float/2addr v4, v3
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getWidth()I
|
|
|
|
|
|
|
|
move-result v5
|
|
|
|
|
|
|
|
int-to-float v5, v5
|
|
|
|
|
|
|
|
div-float/2addr v5, v3
|
|
|
|
|
|
|
|
iget-object v3, p0, Lcom/discord/views/StatusView;->e:Landroid/graphics/Paint;
|
|
|
|
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
invoke-virtual {p1, v0, v4, v5, v3}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {v2}, Lc0/n/c/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
throw v1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getWidth()I
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
move-result v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
int-to-float v6, v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getHeight()I
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
move-result v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
int-to-float v7, v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
iget v9, p0, Lcom/discord/views/StatusView;->d:F
|
|
|
|
|
|
|
|
iget-object v10, p0, Lcom/discord/views/StatusView;->e:Landroid/graphics/Paint;
|
|
|
|
|
|
|
|
if-eqz v10, :cond_2
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
move-object v3, p1
|
|
|
|
|
|
|
|
move v8, v9
|
|
|
|
|
|
|
|
invoke-virtual/range {v3 .. v10}, Landroid/graphics/Canvas;->drawRoundRect(FFFFFFLandroid/graphics/Paint;)V
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-super {p0, p1}, Landroid/widget/ImageView;->onDraw(Landroid/graphics/Canvas;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_2
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {v2}, Lc0/n/c/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
throw v1
|
2020-05-17 12:40:10 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setBackgroundColor(I)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
new-instance v0, Landroid/graphics/Paint;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
|
|
|
|
|
|
|
|
sget-object v1, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColor(I)V
|
|
|
|
|
|
|
|
iput-object v0, p0, Lcom/discord/views/StatusView;->e:Landroid/graphics/Paint;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final setBorderWidth(I)V
|
|
|
|
.locals 0
|
|
|
|
.param p1 # I
|
|
|
|
.annotation build Landroidx/annotation/Px;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1, p1, p1, p1}, Landroid/widget/ImageView;->setPadding(IIII)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final setCornerRadius(F)V
|
|
|
|
.locals 0
|
|
|
|
.param p1 # F
|
|
|
|
.annotation build Landroidx/annotation/Px;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
iput p1, p0, Lcom/discord/views/StatusView;->d:F
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->invalidate()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final setPresence(Lcom/discord/models/domain/ModelPresence;)V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Lcom/discord/views/StatusView;->f:Z
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPresence;->getClientStatuses()Lcom/discord/models/domain/ModelPresence$ClientStatuses;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelPresence$ClientStatuses;->isMobile()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
|
2020-11-02 23:44:01 +00:00
|
|
|
const v0, 0x7f080373
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPresence;->getStreamingActivity()Lcom/discord/models/domain/activity/ModelActivity;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
move-object v2, v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
|
2020-11-02 23:44:01 +00:00
|
|
|
const v0, 0x7f080423
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPresence;->getStatus()Lcom/discord/models/domain/ModelPresence$Status;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
if-eqz v0, :cond_7
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
if-eq v0, v1, :cond_6
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 v2, 0x2
|
|
|
|
|
|
|
|
if-eq v0, v2, :cond_5
|
|
|
|
|
|
|
|
:goto_1
|
2020-11-02 23:44:01 +00:00
|
|
|
const v0, 0x7f080421
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_5
|
2020-11-02 23:44:01 +00:00
|
|
|
const v0, 0x7f08041f
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_6
|
2020-11-02 23:44:01 +00:00
|
|
|
const v0, 0x7f080420
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_7
|
2020-11-02 23:44:01 +00:00
|
|
|
const v0, 0x7f080422
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:goto_2
|
|
|
|
invoke-virtual {p0, v0}, Landroidx/appcompat/widget/AppCompatImageView;->setImageResource(I)V
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Lcom/discord/views/StatusView;->f:Z
|
|
|
|
|
|
|
|
if-eqz v0, :cond_8
|
|
|
|
|
|
|
|
if-eqz p1, :cond_8
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPresence;->getClientStatuses()Lcom/discord/models/domain/ModelPresence$ClientStatuses;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_8
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPresence$ClientStatuses;->isMobile()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-ne p1, v1, :cond_8
|
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
|
|
|
goto :goto_3
|
|
|
|
|
|
|
|
:cond_8
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
:goto_3
|
|
|
|
xor-int/2addr p1, v1
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Lcom/discord/views/StatusView;->g:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|