apkfuckery/com.discord/smali_classes2/com/lytefast/flexinput/adapters/PhotoCursorAdapter.smali
2020-05-11 21:22:21 +02:00

686 lines
19 KiB
Smali

.class public final Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;
.super Landroidx/recyclerview/widget/RecyclerView$Adapter;
.source "PhotoCursorAdapter.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;,
Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$a;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/recyclerview/widget/RecyclerView$Adapter<",
"Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;",
">;"
}
.end annotation
# static fields
.field public static i:Landroid/graphics/drawable/Drawable;
.field public static final j:Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$a;
# instance fields
.field public final a:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"*",
"Lcom/lytefast/flexinput/model/Photo;",
">;"
}
.end annotation
.end field
.field public b:Landroid/database/Cursor;
.field public c:I
.field public d:I
.field public e:I
.field public final f:Landroid/content/ContentResolver;
.field public final g:I
.field public final h:I
# direct methods
.method public static constructor <clinit>()V
.locals 2
new-instance v0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$a;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$a;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->j:Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$a;
return-void
.end method
.method public constructor <init>(Landroid/content/ContentResolver;Lcom/lytefast/flexinput/utils/SelectionCoordinator;II)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/ContentResolver;",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"*",
"Lcom/lytefast/flexinput/model/Photo;",
">;II)V"
}
.end annotation
const/4 v0, 0x0
if-eqz p1, :cond_1
if-eqz p2, :cond_0
invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;-><init>()V
iput-object p1, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->f:Landroid/content/ContentResolver;
iput p3, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->g:I
iput p4, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->h:I
invoke-virtual {p2, p0}, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->a(Landroidx/recyclerview/widget/RecyclerView$Adapter;)Lcom/lytefast/flexinput/utils/SelectionCoordinator;
move-result-object p1
iput-object p1, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
const/4 p1, 0x1
invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->setHasStableIds(Z)V
return-void
:cond_0
const-string p1, "selectionCoordinator"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
:cond_1
const-string p1, "contentResolver"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public static final synthetic a(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;)Lcom/lytefast/flexinput/utils/SelectionCoordinator;
.locals 0
iget-object p0, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a:Lcom/lytefast/flexinput/utils/SelectionCoordinator;
return-object p0
.end method
.method public static final synthetic d()Landroid/graphics/drawable/Drawable;
.locals 1
sget-object v0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->i:Landroid/graphics/drawable/Drawable;
return-object v0
.end method
# virtual methods
.method public final a()I
.locals 1
iget v0, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->h:I
return v0
.end method
.method public a(Landroid/view/ViewGroup;)Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;
.locals 3
if-eqz p1, :cond_0
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
move-result-object v0
sget v1, Lcom/lytefast/flexinput/R$f;->view_grid_image:I
const/4 v2, 0x0
invoke-virtual {v0, v1, p1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object p1
new-instance v0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;
const-string v1, "view"
invoke-static {p1, v1}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {v0, p0, p1}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;-><init>(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;Landroid/view/View;)V
return-object v0
:cond_0
const-string p1, "parent"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
const/4 p1, 0x0
throw p1
.end method
.method public final a(I)Lcom/lytefast/flexinput/model/Photo;
.locals 7
iget-object v0, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->b:Landroid/database/Cursor;
if-eqz v0, :cond_1
invoke-interface {v0, p1}, Landroid/database/Cursor;->moveToPosition(I)Z
iget p1, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->c:I
invoke-interface {v0, p1}, Landroid/database/Cursor;->getLong(I)J
move-result-wide v2
sget-object p1, Landroid/provider/MediaStore$Images$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;
invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v1
invoke-static {p1, v1}, Landroid/net/Uri;->withAppendedPath(Landroid/net/Uri;Ljava/lang/String;)Landroid/net/Uri;
move-result-object v4
new-instance p1, Lcom/lytefast/flexinput/model/Photo;
const-string v1, "fileUri"
invoke-static {v4, v1}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
iget v1, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->e:I
invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
move-result-object v1
if-eqz v1, :cond_0
goto :goto_0
:cond_0
const-string v1, "img-"
invoke-static {v1, v2, v3}, Lf/e/b/a/a;->a(Ljava/lang/String;J)Ljava/lang/String;
move-result-object v1
:goto_0
move-object v5, v1
iget v1, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->d:I
invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
move-result-object v6
move-object v1, p1
invoke-direct/range {v1 .. v6}, Lcom/lytefast/flexinput/model/Photo;-><init>(JLandroid/net/Uri;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_1
:cond_1
const/4 p1, 0x0
:goto_1
return-object p1
.end method
.method public a(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;)V
.locals 0
if-eqz p1, :cond_0
invoke-super {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->onViewRecycled(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;)V
invoke-virtual {p1}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->a()V
return-void
:cond_0
const-string p1, "holder"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
const/4 p1, 0x0
throw p1
.end method
.method public a(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;I)V
.locals 8
const/4 v0, 0x0
if-eqz p1, :cond_4
invoke-virtual {p0, p2}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a(I)Lcom/lytefast/flexinput/model/Photo;
move-result-object p2
iput-object p2, p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->f:Lcom/lytefast/flexinput/model/Photo;
const/4 v1, 0x0
if-eqz p2, :cond_0
iget-object v2, p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->n:Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;
invoke-static {v2}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;)Lcom/lytefast/flexinput/utils/SelectionCoordinator;
move-result-object v2
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->getAdapterPosition()I
move-result v3
invoke-virtual {v2, p2, v3}, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->a(Ljava/lang/Object;I)Z
move-result v2
invoke-virtual {p1, v2, v1}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->a(ZZ)V
:cond_0
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x1d
if-lt v2, v3, :cond_1
const/4 v1, 0x1
:cond_1
if-eqz v1, :cond_2
invoke-virtual {p1}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->a()V
iget-object v1, p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->d:Lcom/facebook/drawee/view/SimpleDraweeView;
invoke-virtual {v1}, Lcom/facebook/drawee/view/DraweeView;->getHierarchy()Lf/j/g/h/b;
move-result-object v1
check-cast v1, Lcom/facebook/drawee/generic/GenericDraweeHierarchy;
invoke-static {}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->d()Landroid/graphics/drawable/Drawable;
move-result-object v2
sget-object v3, Lcom/facebook/drawee/drawable/ScalingUtils$ScaleType;->e:Lcom/facebook/drawee/drawable/ScalingUtils$ScaleType;
invoke-virtual {v1, v2, v3}, Lcom/facebook/drawee/generic/GenericDraweeHierarchy;->b(Landroid/graphics/drawable/Drawable;Lcom/facebook/drawee/drawable/ScalingUtils$ScaleType;)V
new-instance v1, Landroid/os/CancellationSignal;
invoke-direct {v1}, Landroid/os/CancellationSignal;-><init>()V
iput-object v1, p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->k:Landroid/os/CancellationSignal;
sget-object v2, Lz/a/w0;->d:Lz/a/w0;
invoke-static {}, Lz/a/n0;->a()Lz/a/k1;
move-result-object v3
const/4 v4, 0x0
new-instance v5, Lf/b/a/b/f;
invoke-direct {v5, p1, p2, v0}, Lf/b/a/b/f;-><init>(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;Lcom/lytefast/flexinput/model/Photo;Lkotlin/coroutines/Continuation;)V
const/4 v6, 0x2
const/4 v7, 0x0
invoke-static/range {v2 .. v7}, Lf/o/a/j/a;->a(Lkotlinx/coroutines/CoroutineScope;Lkotlin/coroutines/CoroutineContext;Lz/a/c0;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
move-result-object p2
iput-object p2, p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->g:Lkotlinx/coroutines/Job;
goto :goto_0
:cond_2
if-eqz p2, :cond_3
iget-object v0, p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->n:Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;
iget-object v0, v0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->f:Landroid/content/ContentResolver;
invoke-virtual {p2, v0}, Lcom/lytefast/flexinput/model/Photo;->a(Landroid/content/ContentResolver;)Landroid/net/Uri;
move-result-object v0
:cond_3
iget-object p1, p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->d:Lcom/facebook/drawee/view/SimpleDraweeView;
invoke-virtual {p1}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;
move-result-object p2
invoke-virtual {p1, v0, p2}, Lcom/facebook/drawee/view/SimpleDraweeView;->a(Landroid/net/Uri;Ljava/lang/Object;)V
:goto_0
return-void
:cond_4
const-string p1, "holder"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public a(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;ILjava/util/List;)V
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;",
"I",
"Ljava/util/List<",
"Ljava/lang/Object;",
">;)V"
}
.end annotation
const/4 v0, 0x0
if-eqz p1, :cond_5
if-eqz p3, :cond_4
invoke-interface {p3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v1
:cond_0
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_1
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
instance-of v3, v2, Lcom/lytefast/flexinput/utils/SelectionCoordinator$b;
if-eqz v3, :cond_0
goto :goto_0
:cond_1
move-object v2, v0
:goto_0
if-eqz v2, :cond_3
instance-of v1, v2, Lcom/lytefast/flexinput/utils/SelectionCoordinator$b;
if-nez v1, :cond_2
goto :goto_1
:cond_2
move-object v0, v2
:goto_1
check-cast v0, Lcom/lytefast/flexinput/utils/SelectionCoordinator$b;
if-eqz v0, :cond_3
iget-boolean p2, v0, Lcom/lytefast/flexinput/utils/SelectionCoordinator$b;->b:Z
const/4 p3, 0x1
invoke-virtual {p1, p2, p3}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;->a(ZZ)V
return-void
:cond_3
invoke-super {p0, p1, p2, p3}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;ILjava/util/List;)V
return-void
:cond_4
const-string p1, "payloads"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
:cond_5
const-string p1, "holder"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public final b()I
.locals 1
iget v0, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->g:I
return v0
.end method
.method public final c()V
.locals 8
new-instance v0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$c;
invoke-direct {v0, p0}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$c;-><init>(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;)V
sget-object v3, Landroid/provider/MediaStore$Images$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;
const-string v1, "_id"
const-string v2, "_data"
const-string v4, "_display_name"
filled-new-array {v1, v2, v4}, [Ljava/lang/String;
move-result-object v4
const/4 v1, 0x1
const/4 v5, 0x0
const/4 v6, 0x0
const-string v7, "date_added DESC"
move-object v2, p0
invoke-virtual/range {v0 .. v7}, Landroid/content/AsyncQueryHandler;->startQuery(ILjava/lang/Object;Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
return-void
.end method
.method public getItemCount()I
.locals 1
iget-object v0, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->b:Landroid/database/Cursor;
if-eqz v0, :cond_0
invoke-interface {v0}, Landroid/database/Cursor;->getCount()I
move-result v0
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
.method public getItemId(I)J
.locals 2
invoke-virtual {p0, p1}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a(I)Lcom/lytefast/flexinput/model/Photo;
move-result-object p1
if-eqz p1, :cond_0
invoke-virtual {p1}, Lcom/lytefast/flexinput/model/Attachment;->getId()J
move-result-wide v0
goto :goto_0
:cond_0
const-wide/16 v0, -0x1
:goto_0
return-wide v0
.end method
.method public onAttachedToRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V
.locals 3
if-eqz p1, :cond_0
invoke-super {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->onAttachedToRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V
new-instance v0, Landroid/graphics/drawable/ColorDrawable;
sget-object v1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->j:Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$a;
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
move-result-object p1
const-string v2, "recyclerView.context"
invoke-static {p1, v2}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
sget v2, Lcom/lytefast/flexinput/R$b;->flexInputDialogBackground:I
invoke-virtual {v1, p1, v2}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$a;->a(Landroid/content/Context;I)I
move-result p1
invoke-direct {v0, p1}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V
sput-object v0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->i:Landroid/graphics/drawable/Drawable;
invoke-virtual {p0}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->c()V
return-void
:cond_0
const-string p1, "recyclerView"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
const/4 p1, 0x0
throw p1
.end method
.method public bridge synthetic onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V
.locals 0
check-cast p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;
invoke-virtual {p0, p1, p2}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;I)V
return-void
.end method
.method public bridge synthetic onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;ILjava/util/List;)V
.locals 0
check-cast p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;
invoke-virtual {p0, p1, p2, p3}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;ILjava/util/List;)V
return-void
.end method
.method public bridge synthetic onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.locals 0
invoke-virtual {p0, p1}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a(Landroid/view/ViewGroup;)Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;
move-result-object p1
return-object p1
.end method
.method public onDetachedFromRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V
.locals 1
if-eqz p1, :cond_1
iget-object v0, p0, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->b:Landroid/database/Cursor;
if-eqz v0, :cond_0
invoke-interface {v0}, Landroid/database/Cursor;->close()V
:cond_0
invoke-super {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->onDetachedFromRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V
return-void
:cond_1
const-string p1, "recyclerView"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
const/4 p1, 0x0
throw p1
.end method
.method public bridge synthetic onViewRecycled(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;)V
.locals 0
check-cast p1, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;
invoke-virtual {p0, p1}, Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter;->a(Lcom/lytefast/flexinput/adapters/PhotoCursorAdapter$b;)V
return-void
.end method