172 lines
4 KiB
Smali
172 lines
4 KiB
Smali
.class public final Lcom/discord/widgets/chat/input/gifpicker/GifAdapter$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "GifAdapter.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/chat/input/gifpicker/GifAdapter;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/input/gifpicker/GifAdapter$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final calculateColumnCount(Landroidx/recyclerview/widget/RecyclerView;)I
|
|
.locals 1
|
|
|
|
const-string v0, "recyclerView"
|
|
|
|
invoke-static {p1, v0}, Lz/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "recyclerView.resources"
|
|
|
|
invoke-static {p1, v0}, Lz/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object p1
|
|
|
|
iget p1, p1, Landroid/util/DisplayMetrics;->widthPixels:I
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-static {p1, v0}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result p1
|
|
|
|
const/16 v0, 0xa4
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/dimen/DimenUtils;->dpToPixels(I)I
|
|
|
|
move-result v0
|
|
|
|
div-int/2addr p1, v0
|
|
|
|
const/4 v0, 0x2
|
|
|
|
invoke-static {v0, p1}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final calculateColumnWidth(Landroidx/recyclerview/widget/RecyclerView;II)I
|
|
.locals 4
|
|
|
|
const-string v0, "recyclerView"
|
|
|
|
invoke-static {p1, v0}, Lz/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "resources"
|
|
|
|
invoke-static {v0, v1}, Lz/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object v0
|
|
|
|
iget v0, v0, Landroid/util/DisplayMetrics;->widthPixels:I
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
move-result-object v1
|
|
|
|
instance-of v2, v1, Landroid/view/ViewGroup$MarginLayoutParams;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
check-cast v1, Landroid/view/ViewGroup$MarginLayoutParams;
|
|
|
|
invoke-static {v1}, Landroidx/core/view/MarginLayoutParamsCompat;->getMarginStart(Landroid/view/ViewGroup$MarginLayoutParams;)I
|
|
|
|
move-result v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
sub-int/2addr v0, v1
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
move-result-object v1
|
|
|
|
instance-of v2, v1, Landroid/view/ViewGroup$MarginLayoutParams;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
check-cast v1, Landroid/view/ViewGroup$MarginLayoutParams;
|
|
|
|
invoke-static {v1}, Landroidx/core/view/MarginLayoutParamsCompat;->getMarginEnd(Landroid/view/ViewGroup$MarginLayoutParams;)I
|
|
|
|
move-result v3
|
|
|
|
:cond_1
|
|
sub-int/2addr v0, v3
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getPaddingStart()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getPaddingEnd()I
|
|
|
|
move-result p1
|
|
|
|
sub-int/2addr v0, p1
|
|
|
|
add-int/lit8 p1, p2, -0x1
|
|
|
|
mul-int p1, p1, p3
|
|
|
|
int-to-float p3, v0
|
|
|
|
int-to-float p1, p1
|
|
|
|
sub-float/2addr p3, p1
|
|
|
|
int-to-float p1, p2
|
|
|
|
div-float/2addr p3, p1
|
|
|
|
float-to-int p1, p3
|
|
|
|
return p1
|
|
.end method
|