204 lines
6.6 KiB
Smali
204 lines
6.6 KiB
Smali
.class public final Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;
|
|
.super Landroidx/recyclerview/widget/LinearLayoutManager;
|
|
.source "MGRecyclerAdapter.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "LoggingLinearLayoutManager"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final adapterRecyclerWeakReference:Ljava/lang/ref/WeakReference;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/ref/WeakReference<",
|
|
"Landroidx/recyclerview/widget/RecyclerView;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final adapterWeakReference:Ljava/lang/ref/WeakReference;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/ref/WeakReference<",
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter<",
|
|
"*>;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final handler:Landroid/os/Handler;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;I)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter<",
|
|
"*>;I)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {p0, v0, p2, v1}, Landroidx/recyclerview/widget/LinearLayoutManager;-><init>(Landroid/content/Context;IZ)V
|
|
|
|
new-instance p2, Landroid/os/Handler;
|
|
|
|
invoke-direct {p2}, Landroid/os/Handler;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;->handler:Landroid/os/Handler;
|
|
|
|
new-instance p2, Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V
|
|
|
|
iput-object p2, p0, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;->adapterWeakReference:Ljava/lang/ref/WeakReference;
|
|
|
|
new-instance p2, Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->getRecycler()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V
|
|
|
|
iput-object p2, p0, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;->adapterRecyclerWeakReference:Ljava/lang/ref/WeakReference;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/LinearLayoutManager;->setSmoothScrollbarEnabled(Z)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "adapter"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final resetAdapter(Ljava/lang/Throwable;)V
|
|
.locals 8
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;->adapterRecyclerWeakReference:Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
iget-object v1, p0, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;->adapterWeakReference:Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
new-instance v4, Ljava/lang/Exception;
|
|
|
|
const-string v2, "Triggered in adapter: "
|
|
|
|
invoke-static {v2}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v4, v2, p1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
sget-object v2, Lcom/discord/app/AppLog;->c:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x4
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const-string v3, "Invalid adapter configuration."
|
|
|
|
invoke-static/range {v2 .. v7}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;->handler:Landroid/os/Handler;
|
|
|
|
new-instance v2, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager$resetAdapter$1;
|
|
|
|
invoke-direct {v2, v1, v0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager$resetAdapter$1;-><init>(Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;Landroidx/recyclerview/widget/RecyclerView;)V
|
|
|
|
invoke-virtual {p1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onLayoutChildren(Landroidx/recyclerview/widget/RecyclerView$Recycler;Landroidx/recyclerview/widget/RecyclerView$State;)V
|
|
.locals 0
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
:try_start_0
|
|
invoke-super {p0, p1, p2}, Landroidx/recyclerview/widget/LinearLayoutManager;->onLayoutChildren(Landroidx/recyclerview/widget/RecyclerView$Recycler;Landroidx/recyclerview/widget/RecyclerView$State;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/IndexOutOfBoundsException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;->resetAdapter(Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$LoggingLinearLayoutManager;->resetAdapter(Ljava/lang/Throwable;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "state"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|