95 lines
1.9 KiB
Smali
95 lines
1.9 KiB
Smali
.class public Lcom/vk/im/ui/utils/ViewUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "ViewUtils.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final a:Ljava/lang/ThreadLocal;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/ThreadLocal<",
|
|
"Landroid/graphics/Rect;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
new-instance v0, Lcom/vk/im/ui/utils/ViewUtils$a;
|
|
|
|
invoke-direct {v0}, Lcom/vk/im/ui/utils/ViewUtils$a;-><init>()V
|
|
|
|
sput-object v0, Lcom/vk/im/ui/utils/ViewUtils;->a:Ljava/lang/ThreadLocal;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Landroid/view/View;F)Z
|
|
.locals 2
|
|
.param p1 # F
|
|
.annotation build Landroidx/annotation/FloatRange;
|
|
from = 0.0
|
|
to = 1.0
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/vk/im/ui/utils/ViewUtils;->a:Ljava/lang/ThreadLocal;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/graphics/Rect;
|
|
|
|
.line 2
|
|
invoke-virtual {p0, v0}, Landroid/view/View;->getGlobalVisibleRect(Landroid/graphics/Rect;)Z
|
|
|
|
.line 3
|
|
invoke-virtual {v0}, Landroid/graphics/Rect;->width()I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/Rect;->height()I
|
|
|
|
move-result v0
|
|
|
|
mul-int v1, v1, v0
|
|
|
|
.line 4
|
|
invoke-virtual {p0}, Landroid/view/View;->getHeight()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result p0
|
|
|
|
mul-int v0, v0, p0
|
|
|
|
int-to-float p0, v1
|
|
|
|
int-to-float v0, v0
|
|
|
|
div-float/2addr p0, v0
|
|
|
|
cmpl-float p0, p0, p1
|
|
|
|
if-ltz p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|