467 lines
15 KiB
Smali
467 lines
15 KiB
Smali
.class public final Lcom/discord/widgets/settings/WidgetSettingsUserConnections;
|
|
.super Lcom/discord/app/AppFragment;
|
|
.source "WidgetSettingsUserConnections.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/settings/WidgetSettingsUserConnections$UserConnectionItem;,
|
|
Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;,
|
|
Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
.field public static final CONNECTION_ID:Ljava/lang/String; = "connection_id"
|
|
|
|
.field public static final Companion:Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Companion;
|
|
|
|
.field public static final PLATFORM_NAME:Ljava/lang/String; = "platform_name"
|
|
|
|
.field public static final PLATFORM_TITLE:Ljava/lang/String; = "platform_title"
|
|
|
|
|
|
# instance fields
|
|
.field private adapter:Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;
|
|
|
|
.field private final emptyView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field private final recyclerView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 6
|
|
|
|
const-class v0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;
|
|
|
|
const/4 v1, 0x2
|
|
|
|
new-array v1, v1, [Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v2, Lkotlin/jvm/internal/v;
|
|
|
|
invoke-static {v0}, Lkotlin/jvm/internal/w;->Q(Ljava/lang/Class;)Lkotlin/reflect/b;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v4, "emptyView"
|
|
|
|
const-string v5, "getEmptyView()Landroid/view/View;"
|
|
|
|
invoke-direct {v2, v3, v4, v5}, Lkotlin/jvm/internal/v;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {v2}, Lkotlin/jvm/internal/w;->a(Lkotlin/jvm/internal/u;)Lkotlin/reflect/d;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
aput-object v2, v1, v3
|
|
|
|
new-instance v2, Lkotlin/jvm/internal/v;
|
|
|
|
invoke-static {v0}, Lkotlin/jvm/internal/w;->Q(Ljava/lang/Class;)Lkotlin/reflect/b;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v3, "recyclerView"
|
|
|
|
const-string v4, "getRecyclerView()Landroidx/recyclerview/widget/RecyclerView;"
|
|
|
|
invoke-direct {v2, v0, v3, v4}, Lkotlin/jvm/internal/v;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {v2}, Lkotlin/jvm/internal/w;->a(Lkotlin/jvm/internal/u;)Lkotlin/reflect/d;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput-object v0, v1, v2
|
|
|
|
sput-object v1, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->Companion:Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Companion;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Lcom/discord/app/AppFragment;-><init>()V
|
|
|
|
const v0, 0x7f0a022d
|
|
|
|
invoke-static {p0, v0}, Lkotterknife/b;->c(Landroidx/fragment/app/Fragment;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->emptyView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
const v0, 0x7f0a022e
|
|
|
|
invoke-static {p0, v0}, Lkotterknife/b;->c(Landroidx/fragment/app/Fragment;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->recyclerView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$configureUI(Lcom/discord/widgets/settings/WidgetSettingsUserConnections;Ljava/util/List;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->configureUI(Ljava/util/List;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final configureUI(Ljava/util/List;)V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/models/domain/ModelConnectedAccount;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->adapter:Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;->getItemCount()I
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->getEmptyView()Landroid/view/View;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x2
|
|
|
|
invoke-static {v2, v3, v1, v5, v4}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setVisibilityBy$default(Landroid/view/View;ZIILjava/lang/Object;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->getRecyclerView()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroid/view/View;
|
|
|
|
move-object v3, p1
|
|
|
|
check-cast v3, Ljava/util/Collection;
|
|
|
|
invoke-interface {v3}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v3
|
|
|
|
xor-int/lit8 v3, v3, 0x1
|
|
|
|
invoke-static {v2, v3, v1, v5, v4}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setVisibilityBy$default(Landroid/view/View;ZIILjava/lang/Object;)V
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
check-cast p1, Ljava/lang/Iterable;
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_1
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
move-object v3, v1
|
|
|
|
check-cast v3, Ljava/util/Collection;
|
|
|
|
check-cast v2, Lcom/discord/models/domain/ModelConnectedAccount;
|
|
|
|
new-instance v4, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$UserConnectionItem;
|
|
|
|
invoke-direct {v4, v2}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$UserConnectionItem;-><init>(Lcom/discord/models/domain/ModelConnectedAccount;)V
|
|
|
|
invoke-interface {v3, v4}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-object p1, p0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->adapter:Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
move-object v2, v1
|
|
|
|
check-cast v2, Ljava/util/List;
|
|
|
|
invoke-virtual {p1, v2}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;->setData(Ljava/util/List;)V
|
|
|
|
:cond_2
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-virtual {v1}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result p1
|
|
|
|
if-le p1, v0, :cond_3
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->getRecyclerView()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v0
|
|
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/recyclerview/widget/RecyclerView;->smoothScrollToPosition(I)V
|
|
|
|
:cond_3
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getEmptyView()Landroid/view/View;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->emptyView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/view/View;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getRecyclerView()Landroidx/recyclerview/widget/RecyclerView;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->recyclerView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final launch(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->Companion:Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Companion;
|
|
|
|
invoke-virtual {v0, p0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Companion;->launch(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getContentViewResId()I
|
|
.locals 1
|
|
|
|
const v0, 0x7f0d01a1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final onViewBound(Landroid/view/View;)V
|
|
.locals 6
|
|
|
|
const-string v0, "view"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-super {p0, p1}, Lcom/discord/app/AppFragment;->onViewBound(Landroid/view/View;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->getActivity()Landroidx/fragment/app/FragmentActivity;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
sget-object v0, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->Companion:Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$Companion;
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->getRecyclerView()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "it"
|
|
|
|
invoke-static {p1, v3}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroidx/fragment/app/FragmentActivity;->getSupportFragmentManager()Landroidx/fragment/app/FragmentManager;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v3, "it.supportFragmentManager"
|
|
|
|
invoke-static {p1, v3}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {v1, v2, p1}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;-><init>(Landroidx/recyclerview/widget/RecyclerView;Landroidx/fragment/app/FragmentManager;)V
|
|
|
|
check-cast v1, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter$Companion;->configure(Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;)Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->adapter:Lcom/discord/widgets/settings/WidgetSettingsUserConnections$Adapter;
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
const/4 v0, 0x3
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-static {p0, p1, v1, v0, v1}, Lcom/discord/app/AppFragment;->setActionBarDisplayHomeAsUpEnabled$default(Lcom/discord/app/AppFragment;ZLjava/lang/Integer;ILjava/lang/Object;)Landroidx/appcompat/widget/Toolbar;
|
|
|
|
const p1, 0x7f121229
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->setActionBarSubtitle(I)Lkotlin/Unit;
|
|
|
|
const p1, 0x7f12043c
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections;->setActionBarTitle(I)Lkotlin/Unit;
|
|
|
|
const v1, 0x7f0e0006
|
|
|
|
new-instance p1, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$onViewBound$2;
|
|
|
|
invoke-direct {p1, p0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$onViewBound$2;-><init>(Lcom/discord/widgets/settings/WidgetSettingsUserConnections;)V
|
|
|
|
move-object v2, p1
|
|
|
|
check-cast v2, Lrx/functions/Action2;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/app/AppFragment;->setActionBarOptionsMenu$default(Lcom/discord/app/AppFragment;ILrx/functions/Action2;Lrx/functions/Action1;ILjava/lang/Object;)Landroidx/appcompat/widget/Toolbar;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onViewBoundOrOnResume()V
|
|
.locals 13
|
|
|
|
invoke-super {p0}, Lcom/discord/app/AppFragment;->onViewBoundOrOnResume()V
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getUserConnections()Lcom/discord/stores/StoreUserConnections;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUserConnections;->getConnectedAccounts()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
move-object v1, p0
|
|
|
|
check-cast v1, Lcom/discord/app/AppComponent;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x2
|
|
|
|
invoke-static {v0, v1, v2, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v5
|
|
|
|
new-instance v0, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$onViewBoundOrOnResume$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/settings/WidgetSettingsUserConnections$onViewBoundOrOnResume$1;-><init>(Lcom/discord/widgets/settings/WidgetSettingsUserConnections;)V
|
|
|
|
move-object v10, v0
|
|
|
|
check-cast v10, Lkotlin/jvm/functions/Function1;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/16 v11, 0x1e
|
|
|
|
const/4 v12, 0x0
|
|
|
|
invoke-static/range {v4 .. v12}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|