2019-07-24 11:27:29 +00:00
|
|
|
.class public final Lcom/discord/utilities/display/DisplayUtils;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "DisplayUtils.kt"
|
|
|
|
|
|
|
|
|
2020-01-07 02:40:43 +00:00
|
|
|
# static fields
|
|
|
|
.field public static final NO_OP_WINDOW_INSETS_LISTENER:Landroidx/core/view/OnApplyWindowInsetsListener;
|
|
|
|
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
# direct methods
|
2020-01-07 02:40:43 +00:00
|
|
|
.method public static constructor <clinit>()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/utilities/display/DisplayUtils$NO_OP_WINDOW_INSETS_LISTENER$1;->INSTANCE:Lcom/discord/utilities/display/DisplayUtils$NO_OP_WINDOW_INSETS_LISTENER$1;
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/utilities/display/DisplayUtils;->NO_OP_WINDOW_INSETS_LISTENER:Landroidx/core/view/OnApplyWindowInsetsListener;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final drawUnderSystemBars(Landroid/view/View;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/View;->setFitsSystemWindows(Z)V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->getSystemUiVisibility()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
or-int/lit16 v0, v0, 0x700
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/View;->setSystemUiVisibility(I)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string p0, "view"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2020-01-07 02:40:43 +00:00
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
throw p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final getNO_OP_WINDOW_INSETS_LISTENER()Landroidx/core/view/OnApplyWindowInsetsListener;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/utilities/display/DisplayUtils;->NO_OP_WINDOW_INSETS_LISTENER:Landroidx/core/view/OnApplyWindowInsetsListener;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
.method public static final getNavigationBarHeight(Landroid/content/res/Resources;)I
|
|
|
|
.locals 3
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const-string v0, "navigation_bar_height"
|
|
|
|
|
|
|
|
const-string v1, "dimen"
|
|
|
|
|
|
|
|
const-string v2, "android"
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0, v1, v2}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
return p0
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p0, "resources"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2020-04-25 00:39:25 +00:00
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
throw p0
|
|
|
|
.end method
|
|
|
|
|
2020-04-27 21:50:40 +00:00
|
|
|
.method public static final getScreenRefreshRate(Landroid/content/Context;)F
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
|
|
|
|
const-string v0, "window"
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
|
|
|
|
check-cast p0, Landroid/view/WindowManager;
|
|
|
|
|
|
|
|
invoke-interface {p0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
const-string v0, "(context.getSystemServic\u2026owManager).defaultDisplay"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0, v0}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-04-27 21:50:40 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/view/Display;->getRefreshRate()F
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
return p0
|
|
|
|
|
|
|
|
:cond_0
|
2020-05-07 23:11:04 +00:00
|
|
|
new-instance p0, Ly/l;
|
2020-04-27 21:50:40 +00:00
|
|
|
|
|
|
|
const-string v0, "null cannot be cast to non-null type android.view.WindowManager"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-direct {p0, v0}, Ly/l;-><init>(Ljava/lang/String;)V
|
2020-04-27 21:50:40 +00:00
|
|
|
|
|
|
|
throw p0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p0, "context"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2020-04-27 21:50:40 +00:00
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
throw p0
|
|
|
|
.end method
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
.method public static final getScreenSize(Landroid/content/Context;)Landroid/graphics/Rect;
|
2019-11-20 22:09:14 +00:00
|
|
|
.locals 3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const-string v0, "window"
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
2019-11-20 22:09:14 +00:00
|
|
|
if-eqz p0, :cond_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
check-cast p0, Landroid/view/WindowManager;
|
|
|
|
|
|
|
|
new-instance v0, Landroid/graphics/Point;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Point;-><init>()V
|
|
|
|
|
|
|
|
invoke-interface {p0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/Display;->getRealSize(Landroid/graphics/Point;)V
|
|
|
|
|
|
|
|
new-instance p0, Landroid/graphics/Rect;
|
|
|
|
|
2019-11-20 22:09:14 +00:00
|
|
|
iget v1, v0, Landroid/graphics/Point;->x:I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
iget v0, v0, Landroid/graphics/Point;->y:I
|
|
|
|
|
2019-11-20 22:09:14 +00:00
|
|
|
const/4 v2, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-11-20 22:09:14 +00:00
|
|
|
invoke-direct {p0, v2, v2, v1, v0}, Landroid/graphics/Rect;-><init>(IIII)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
return-object p0
|
|
|
|
|
2019-11-20 22:09:14 +00:00
|
|
|
:cond_0
|
2020-05-07 23:11:04 +00:00
|
|
|
new-instance p0, Ly/l;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-11-20 22:09:14 +00:00
|
|
|
const-string v0, "null cannot be cast to non-null type android.view.WindowManager"
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-direct {p0, v0}, Ly/l;-><init>(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
throw p0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p0, "context"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
const/4 p0, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
throw p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final getStatusBarHeight(Landroid/content/res/Resources;)I
|
|
|
|
.locals 3
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const-string v0, "status_bar_height"
|
|
|
|
|
|
|
|
const-string v1, "dimen"
|
|
|
|
|
|
|
|
const-string v2, "android"
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0, v1, v2}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
return p0
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p0, "resources"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
throw p0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final hasNavigationBar(Landroid/content/res/Resources;)Z
|
|
|
|
.locals 3
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const-string v0, "config_showNavigationBar"
|
|
|
|
|
|
|
|
const-string v1, "bool"
|
|
|
|
|
|
|
|
const-string v2, "android"
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0, v1, v2}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/content/res/Resources;->getBoolean(I)Z
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
|
|
|
|
const/4 p0, 0x1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:goto_0
|
2019-07-24 11:27:29 +00:00
|
|
|
return p0
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p0, "resources"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
throw p0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final resizeToFit(Landroid/graphics/Rect;Landroid/graphics/Rect;)Landroid/graphics/Rect;
|
|
|
|
.locals 2
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const/4 v0, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_3
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p1, :cond_2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/Rect;->width()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/Rect;->height()I
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Rect;->width()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-le v0, v1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Rect;->width()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
int-to-float v1, v1
|
|
|
|
|
|
|
|
int-to-float v0, v0
|
|
|
|
|
|
|
|
div-float/2addr v1, v0
|
|
|
|
|
|
|
|
int-to-float p0, p0
|
|
|
|
|
|
|
|
mul-float v1, v1, p0
|
|
|
|
|
|
|
|
float-to-int p0, v1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Rect;->width()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Rect;->height()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-le p0, v1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Rect;->height()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
int-to-float v1, v1
|
|
|
|
|
|
|
|
int-to-float p0, p0
|
|
|
|
|
|
|
|
div-float/2addr v1, p0
|
|
|
|
|
|
|
|
int-to-float p0, v0
|
|
|
|
|
|
|
|
mul-float v1, v1, p0
|
|
|
|
|
|
|
|
float-to-int v0, v1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Rect;->height()I
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
new-instance p1, Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
invoke-direct {p1, v1, v1, v0, p0}, Landroid/graphics/Rect;-><init>(IIII)V
|
|
|
|
|
|
|
|
return-object p1
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p0, "bounds"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string p0, "in"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
throw v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final resizeToFitScreen(Landroid/content/Context;Landroid/graphics/Rect;)Landroid/graphics/Rect;
|
|
|
|
.locals 1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
const/4 v0, 0x0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p0, :cond_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
if-eqz p1, :cond_0
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-static {p0}, Lcom/discord/utilities/display/DisplayUtils;->getScreenSize(Landroid/content/Context;)Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
invoke-static {p1, p0}, Lcom/discord/utilities/display/DisplayUtils;->resizeToFit(Landroid/graphics/Rect;Landroid/graphics/Rect;)Landroid/graphics/Rect;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string p0, "in"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p0, "context"
|
|
|
|
|
2020-05-07 23:11:04 +00:00
|
|
|
invoke-static {p0}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
2019-12-06 03:29:40 +00:00
|
|
|
|
|
|
|
throw v0
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|