365 lines
9.7 KiB
Smali
365 lines
9.7 KiB
Smali
.class public Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;
|
|
.super Landroidx/recyclerview/widget/GridLayoutManager;
|
|
.source "ResizingGridLayoutManager.kt"
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;II)V
|
|
.locals 1
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, p1, p2, p3, v0}, Landroidx/recyclerview/widget/GridLayoutManager;-><init>(Landroid/content/Context;IIZ)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getHorizontalSpace()I
|
|
.locals 2
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getWidth()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getPaddingRight()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getPaddingLeft()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private final getVerticalSpace()I
|
|
.locals 2
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getHeight()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getPaddingBottom()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getPaddingTop()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private final maxColumns()I
|
|
.locals 1
|
|
|
|
const/4 v0, 0x4
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private final maxRows()I
|
|
.locals 1
|
|
|
|
const/4 v0, 0x4
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method private final spanLayoutSize(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
.locals 2
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/LinearLayoutManager;->getOrientation()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->spanLayoutSizeVerticalOrientation(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->spanLayoutSizeHorizontalOrientation(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final spanLayoutSizeHorizontalOrientation(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
.locals 3
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getItemCount()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getItemCount()I
|
|
|
|
move-result v0
|
|
|
|
div-int/2addr v0, v1
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getItemCount()I
|
|
|
|
move-result v2
|
|
|
|
rem-int/2addr v2, v1
|
|
|
|
add-int v1, v2, v0
|
|
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->getHorizontalSpace()I
|
|
|
|
move-result v0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->maxColumns()I
|
|
|
|
move-result v2
|
|
|
|
div-int/2addr v0, v2
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->getHorizontalSpace()I
|
|
|
|
move-result v2
|
|
|
|
div-int/2addr v2, v1
|
|
|
|
if-ge v2, v0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move v0, v2
|
|
|
|
:goto_0
|
|
iput v0, p1, Landroid/view/ViewGroup$MarginLayoutParams;->width:I
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final spanLayoutSizeVerticalOrientation(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
.locals 3
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getItemCount()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getItemCount()I
|
|
|
|
move-result v0
|
|
|
|
div-int/2addr v0, v1
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getItemCount()I
|
|
|
|
move-result v2
|
|
|
|
rem-int/2addr v2, v1
|
|
|
|
add-int v1, v2, v0
|
|
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->getVerticalSpace()I
|
|
|
|
move-result v0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->maxRows()I
|
|
|
|
move-result v2
|
|
|
|
div-int/2addr v0, v2
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->getVerticalSpace()I
|
|
|
|
move-result v2
|
|
|
|
div-int/2addr v2, v1
|
|
|
|
if-ge v2, v0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move v0, v2
|
|
|
|
:goto_0
|
|
iput v0, p1, Landroid/view/ViewGroup$MarginLayoutParams;->height:I
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public canScrollHorizontally()Z
|
|
.locals 1
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/LinearLayoutManager;->getOrientation()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public canScrollVertically()Z
|
|
.locals 2
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/LinearLayoutManager;->getOrientation()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
return v1
|
|
.end method
|
|
|
|
.method public checkLayoutParams(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Z
|
|
.locals 3
|
|
|
|
const-string v0, "lp"
|
|
|
|
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->generateDefaultLayoutParams()Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-super {p0, p1}, Landroidx/recyclerview/widget/GridLayoutManager;->checkLayoutParams(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
iget v1, v0, Landroid/view/ViewGroup$MarginLayoutParams;->width:I
|
|
|
|
iget v2, p1, Landroid/view/ViewGroup$MarginLayoutParams;->width:I
|
|
|
|
if-ne v1, v2, :cond_0
|
|
|
|
iget v0, v0, Landroid/view/ViewGroup$MarginLayoutParams;->height:I
|
|
|
|
iget p1, p1, Landroid/view/ViewGroup$MarginLayoutParams;->height:I
|
|
|
|
if-ne v0, p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
return p1
|
|
.end method
|
|
|
|
.method public generateDefaultLayoutParams()Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
.locals 2
|
|
|
|
invoke-super {p0}, Landroidx/recyclerview/widget/GridLayoutManager;->generateDefaultLayoutParams()Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "super.generateDefaultLayoutParams()"
|
|
|
|
invoke-static {v0, v1}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->spanLayoutSize(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public generateLayoutParams(Landroid/content/Context;Landroid/util/AttributeSet;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
.locals 1
|
|
|
|
const-string v0, "c"
|
|
|
|
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "attrs"
|
|
|
|
invoke-static {p2, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-super {p0, p1, p2}, Landroidx/recyclerview/widget/GridLayoutManager;->generateLayoutParams(Landroid/content/Context;Landroid/util/AttributeSet;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "super.generateLayoutParams(c, attrs)"
|
|
|
|
invoke-static {p1, p2}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->spanLayoutSize(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public generateLayoutParams(Landroid/view/ViewGroup$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
.locals 1
|
|
|
|
const-string v0, "lp"
|
|
|
|
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-super {p0, p1}, Landroidx/recyclerview/widget/GridLayoutManager;->generateLayoutParams(Landroid/view/ViewGroup$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "super.generateLayoutParams(lp)"
|
|
|
|
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/voice/fullscreen/grid/ResizingGridLayoutManager;->spanLayoutSize(Landroidx/recyclerview/widget/RecyclerView$LayoutParams;)Landroidx/recyclerview/widget/RecyclerView$LayoutParams;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|