apkfuckery/com.discord/smali_classes2/com/lytefast/flexinput/fragment/FilesFragment.smali

433 lines
15 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.class public Lcom/lytefast/flexinput/fragment/FilesFragment;
.super Lcom/lytefast/flexinput/fragment/PermissionsFragment;
.source "FilesFragment.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/lytefast/flexinput/fragment/FilesFragment$Companion;
}
.end annotation
# static fields
.field public static final Companion:Lcom/lytefast/flexinput/fragment/FilesFragment$Companion;
.field public static final REQUIRED_PERMISSION:Ljava/lang/String; = "android.permission.READ_EXTERNAL_STORAGE"
# instance fields
.field public adapter:Lcom/lytefast/flexinput/adapters/FileListAdapter;
.field public recyclerView:Landroidx/recyclerview/widget/RecyclerView;
.field public selectionCoordinator:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"Lcom/lytefast/flexinput/model/Attachment<",
"Ljava/lang/Object;",
">;",
"Lcom/lytefast/flexinput/model/Attachment<",
"Ljava/io/File;",
">;>;"
}
.end annotation
.end field
.field public swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
# direct methods
.method public static constructor <clinit>()V
.locals 2
new-instance v0, Lcom/lytefast/flexinput/fragment/FilesFragment$Companion;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lcom/lytefast/flexinput/fragment/FilesFragment$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lcom/lytefast/flexinput/fragment/FilesFragment;->Companion:Lcom/lytefast/flexinput/fragment/FilesFragment$Companion;
return-void
.end method
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/PermissionsFragment;-><init>()V
return-void
.end method
.method public static final synthetic access$getAdapter$p(Lcom/lytefast/flexinput/fragment/FilesFragment;)Lcom/lytefast/flexinput/adapters/FileListAdapter;
.locals 0
iget-object p0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->adapter:Lcom/lytefast/flexinput/adapters/FileListAdapter;
return-object p0
.end method
.method public static final synthetic access$getSelectionCoordinator$p(Lcom/lytefast/flexinput/fragment/FilesFragment;)Lcom/lytefast/flexinput/utils/SelectionCoordinator;
.locals 0
iget-object p0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->selectionCoordinator:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
return-object p0
.end method
.method public static final synthetic access$loadDownloadFolder(Lcom/lytefast/flexinput/fragment/FilesFragment;)V
.locals 0
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/FilesFragment;->loadDownloadFolder()V
return-void
.end method
.method public static final synthetic access$requestPermissions(Lcom/lytefast/flexinput/fragment/FilesFragment;)V
.locals 0
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/FilesFragment;->requestPermissions()V
return-void
.end method
.method public static final synthetic access$setAdapter$p(Lcom/lytefast/flexinput/fragment/FilesFragment;Lcom/lytefast/flexinput/adapters/FileListAdapter;)V
.locals 0
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->adapter:Lcom/lytefast/flexinput/adapters/FileListAdapter;
return-void
.end method
.method public static final synthetic access$setSelectionCoordinator$p(Lcom/lytefast/flexinput/fragment/FilesFragment;Lcom/lytefast/flexinput/utils/SelectionCoordinator;)V
.locals 0
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->selectionCoordinator:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
return-void
.end method
.method private final loadDownloadFolder()V
2020-09-09 19:21:20 +00:00
.locals 4
2020-05-17 12:40:10 +00:00
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->adapter:Lcom/lytefast/flexinput/adapters/FileListAdapter;
const/4 v1, 0x0
2020-09-09 19:21:20 +00:00
if-nez v0, :cond_0
2020-05-17 12:40:10 +00:00
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
2020-09-09 19:21:20 +00:00
invoke-static {v0}, Lk0/n/c/i;->checkNotNull(Ljava/lang/Object;)V
2020-05-17 12:40:10 +00:00
invoke-virtual {v0, v1}, Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;->setRefreshing(Z)V
return-void
:cond_0
sget-object v0, Landroid/os/Environment;->DIRECTORY_DOWNLOADS:Ljava/lang/String;
invoke-static {v0}, Landroid/os/Environment;->getExternalStoragePublicDirectory(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
2020-09-09 19:21:20 +00:00
iget-object v2, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->adapter:Lcom/lytefast/flexinput/adapters/FileListAdapter;
invoke-static {v2}, Lk0/n/c/i;->checkNotNull(Ljava/lang/Object;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
const-string v3, "downloadFolder"
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-static {v0, v3}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
const-string v3, "root"
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-static {v0, v3}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
new-instance v3, Lcom/lytefast/flexinput/adapters/FileListAdapter$a;
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-direct {v3, v2}, Lcom/lytefast/flexinput/adapters/FileListAdapter$a;-><init>(Lcom/lytefast/flexinput/adapters/FileListAdapter;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
const/4 v2, 0x1
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
new-array v2, v2, [Ljava/io/File;
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
aput-object v0, v2, v1
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-virtual {v3, v2}, Landroid/os/AsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;
2020-05-17 12:40:10 +00:00
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
2020-09-09 19:21:20 +00:00
invoke-static {v0}, Lk0/n/c/i;->checkNotNull(Ljava/lang/Object;)V
2020-05-17 12:40:10 +00:00
invoke-virtual {v0, v1}, Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;->setRefreshing(Z)V
return-void
.end method
.method private final requestPermissions()V
.locals 2
new-instance v0, Lcom/lytefast/flexinput/fragment/FilesFragment$c;
invoke-direct {v0, p0}, Lcom/lytefast/flexinput/fragment/FilesFragment$c;-><init>(Lcom/lytefast/flexinput/fragment/FilesFragment;)V
const-string v1, "android.permission.READ_EXTERNAL_STORAGE"
filled-new-array {v1}, [Ljava/lang/String;
move-result-object v1
invoke-virtual {p0, v0, v1}, Lcom/lytefast/flexinput/fragment/PermissionsFragment;->requestPermissions(Lcom/lytefast/flexinput/fragment/PermissionsFragment$PermissionsResultCallback;[Ljava/lang/String;)Z
return-void
.end method
# virtual methods
.method public final getRecyclerView$flexinput_release()Landroidx/recyclerview/widget/RecyclerView;
.locals 1
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;
return-object v0
.end method
.method public final getSwipeRefreshLayout$flexinput_release()Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
.locals 1
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
return-object v0
.end method
.method public newPermissionsRequestAdapter(Landroid/view/View$OnClickListener;)Lcom/lytefast/flexinput/adapters/EmptyListAdapter;
.locals 3
2020-09-09 19:21:20 +00:00
const-string v0, "onClickListener"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
2020-05-17 12:40:10 +00:00
new-instance v0, Lcom/lytefast/flexinput/adapters/EmptyListAdapter;
sget v1, Lcom/lytefast/flexinput/R$f;->item_permission_storage:I
sget v2, Lcom/lytefast/flexinput/R$e;->permissions_req_btn:I
invoke-direct {v0, v1, v2, p1}, Lcom/lytefast/flexinput/adapters/EmptyListAdapter;-><init>(IILandroid/view/View$OnClickListener;)V
return-object v0
.end method
.method public onCreateView(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View;
.locals 2
2020-09-09 19:21:20 +00:00
const-string p3, "inflater"
invoke-static {p1, p3}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
new-instance p3, Lcom/lytefast/flexinput/utils/SelectionCoordinator;
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
const/4 v0, 0x0
2020-05-17 12:40:10 +00:00
const/4 v1, 0x3
2020-09-09 19:21:20 +00:00
invoke-direct {p3, v0, v0, v1}, Lcom/lytefast/flexinput/utils/SelectionCoordinator;-><init>(Landroidx/collection/ArrayMap;Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;I)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
iput-object p3, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->selectionCoordinator:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
2020-05-17 12:40:10 +00:00
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getParentFragment()Landroidx/fragment/app/Fragment;
2020-09-09 19:21:20 +00:00
move-result-object p3
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
if-eqz p3, :cond_0
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-virtual {p3}, Landroidx/fragment/app/Fragment;->getParentFragment()Landroidx/fragment/app/Fragment;
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
move-result-object p3
2020-05-17 12:40:10 +00:00
goto :goto_0
:cond_0
2020-09-09 19:21:20 +00:00
move-object p3, v0
2020-05-17 12:40:10 +00:00
:goto_0
2020-09-09 19:21:20 +00:00
instance-of v1, p3, Lf/b/a/b;
2020-05-17 12:40:10 +00:00
if-nez v1, :cond_1
2020-09-09 19:21:20 +00:00
move-object p3, v0
2020-05-17 12:40:10 +00:00
:cond_1
2020-09-09 19:21:20 +00:00
check-cast p3, Lf/b/a/b;
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
if-eqz p3, :cond_2
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-interface {p3}, Lf/b/a/b;->b()Lcom/lytefast/flexinput/utils/SelectionAggregator;
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
move-result-object p3
2020-05-17 12:40:10 +00:00
iget-object v1, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->selectionCoordinator:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
2020-09-09 19:21:20 +00:00
invoke-static {v1}, Lk0/n/c/i;->checkNotNull(Ljava/lang/Object;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-virtual {p3, v1}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->registerSelectionCoordinator(Lcom/lytefast/flexinput/utils/SelectionCoordinator;)V
2020-05-17 12:40:10 +00:00
:cond_2
2020-09-09 19:21:20 +00:00
sget p3, Lcom/lytefast/flexinput/R$f;->fragment_recycler_view:I
2020-05-17 12:40:10 +00:00
const/4 v1, 0x0
2020-09-09 19:21:20 +00:00
invoke-virtual {p1, p3, p2, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
2020-05-17 12:40:10 +00:00
move-result-object p1
2020-09-09 19:21:20 +00:00
if-eqz p1, :cond_6
2020-05-17 12:40:10 +00:00
sget p2, Lcom/lytefast/flexinput/R$e;->list:I
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object p2
check-cast p2, Landroidx/recyclerview/widget/RecyclerView;
iput-object p2, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;
const-string p2, "android.permission.READ_EXTERNAL_STORAGE"
filled-new-array {p2}, [Ljava/lang/String;
move-result-object p2
invoke-virtual {p0, p2}, Lcom/lytefast/flexinput/fragment/PermissionsFragment;->hasPermissions([Ljava/lang/String;)Z
move-result p2
2020-09-09 19:21:20 +00:00
if-eqz p2, :cond_3
2020-05-17 12:40:10 +00:00
new-instance p2, Lcom/lytefast/flexinput/adapters/FileListAdapter;
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
2020-09-09 19:21:20 +00:00
move-result-object p3
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
const-string v0, "context"
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-static {p3, v0}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-virtual {p3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
move-result-object p3
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
const-string v0, "context.contentResolver"
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-static {p3, v0}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->selectionCoordinator:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-static {v0}, Lk0/n/c/i;->checkNotNull(Ljava/lang/Object;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
invoke-direct {p2, p3, v0}, Lcom/lytefast/flexinput/adapters/FileListAdapter;-><init>(Landroid/content/ContentResolver;Lcom/lytefast/flexinput/utils/SelectionCoordinator;)V
2020-05-17 12:40:10 +00:00
iput-object p2, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->adapter:Lcom/lytefast/flexinput/adapters/FileListAdapter;
2020-07-08 16:44:49 +00:00
iget-object p3, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
if-eqz p3, :cond_4
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {p3, p2}, Landroidx/recyclerview/widget/RecyclerView;->setAdapter(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
goto :goto_1
2020-09-08 08:16:32 +00:00
2020-09-09 19:21:20 +00:00
:cond_3
2020-05-17 12:40:10 +00:00
iget-object p2, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;
2020-09-09 19:21:20 +00:00
if-eqz p2, :cond_4
2020-05-17 12:40:10 +00:00
new-instance p3, Lcom/lytefast/flexinput/fragment/FilesFragment$a;
invoke-direct {p3, p0}, Lcom/lytefast/flexinput/fragment/FilesFragment$a;-><init>(Lcom/lytefast/flexinput/fragment/FilesFragment;)V
invoke-virtual {p0, p3}, Lcom/lytefast/flexinput/fragment/FilesFragment;->newPermissionsRequestAdapter(Landroid/view/View$OnClickListener;)Lcom/lytefast/flexinput/adapters/EmptyListAdapter;
move-result-object p3
invoke-virtual {p2, p3}, Landroidx/recyclerview/widget/RecyclerView;->setAdapter(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
2020-09-09 19:21:20 +00:00
:cond_4
:goto_1
2020-05-17 12:40:10 +00:00
sget p2, Lcom/lytefast/flexinput/R$e;->swipeRefreshLayout:I
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object p2
check-cast p2, Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
iput-object p2, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
2020-09-09 19:21:20 +00:00
if-eqz p2, :cond_5
2020-05-17 12:40:10 +00:00
new-instance p3, Lcom/lytefast/flexinput/fragment/FilesFragment$b;
invoke-direct {p3, p0}, Lcom/lytefast/flexinput/fragment/FilesFragment$b;-><init>(Lcom/lytefast/flexinput/fragment/FilesFragment;)V
2020-07-23 01:06:17 +00:00
new-instance v0, Lf/b/a/a/f;
2020-05-17 12:40:10 +00:00
2020-07-23 01:06:17 +00:00
invoke-direct {v0, p3}, Lf/b/a/a/f;-><init>(Lkotlin/jvm/functions/Function0;)V
2020-05-17 12:40:10 +00:00
invoke-virtual {p2, v0}, Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;->setOnRefreshListener(Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout$OnRefreshListener;)V
2020-09-09 19:21:20 +00:00
:cond_5
move-object v0, p1
2020-09-08 08:16:32 +00:00
2020-09-09 19:21:20 +00:00
:cond_6
return-object v0
2020-05-17 12:40:10 +00:00
.end method
.method public onDestroyView()V
.locals 1
iget-object v0, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->selectionCoordinator:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
if-eqz v0, :cond_0
2020-07-08 16:44:49 +00:00
iget-object v0, v0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->c:Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
invoke-interface {v0}, Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;->unregister()V
2020-05-17 12:40:10 +00:00
:cond_0
invoke-super {p0}, Landroidx/fragment/app/Fragment;->onDestroyView()V
return-void
.end method
.method public onStart()V
.locals 0
invoke-super {p0}, Landroidx/fragment/app/Fragment;->onStart()V
invoke-direct {p0}, Lcom/lytefast/flexinput/fragment/FilesFragment;->loadDownloadFolder()V
return-void
.end method
.method public final setRecyclerView$flexinput_release(Landroidx/recyclerview/widget/RecyclerView;)V
.locals 0
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;
return-void
.end method
.method public final setSwipeRefreshLayout$flexinput_release(Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;)V
.locals 0
iput-object p1, p0, Lcom/lytefast/flexinput/fragment/FilesFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
return-void
.end method