338 lines
8.3 KiB
Smali
338 lines
8.3 KiB
Smali
.class public final Lcom/discord/utilities/images/MGImagesBitmap;
|
|
.super Ljava/lang/Object;
|
|
.source "MGImagesBitmap.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/images/MGImagesBitmap$ImageNotFoundException;,
|
|
Lcom/discord/utilities/images/MGImagesBitmap$DecodeException;,
|
|
Lcom/discord/utilities/images/MGImagesBitmap$MissingBitmapException;,
|
|
Lcom/discord/utilities/images/MGImagesBitmap$CloseableBitmaps;,
|
|
Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/images/MGImagesBitmap;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/images/MGImagesBitmap;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/images/MGImagesBitmap;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/images/MGImagesBitmap;->INSTANCE:Lcom/discord/utilities/images/MGImagesBitmap;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final isValidUri(Ljava/lang/String;)Z
|
|
.locals 3
|
|
|
|
invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "uri"
|
|
|
|
invoke-static {p1, v0}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroid/net/Uri;->getScheme()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-static {v0}, Lw/a0/n;->isBlank(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 v0, 0x1
|
|
|
|
:goto_1
|
|
if-nez v0, :cond_6
|
|
|
|
invoke-virtual {p1}, Landroid/net/Uri;->getHost()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-static {v0}, Lw/a0/n;->isBlank(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
:goto_2
|
|
const/4 v0, 0x1
|
|
|
|
:goto_3
|
|
if-nez v0, :cond_6
|
|
|
|
invoke-virtual {p1}, Landroid/net/Uri;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
invoke-static {p1}, Lw/a0/n;->isBlank(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
goto :goto_4
|
|
|
|
:cond_4
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_5
|
|
|
|
:cond_5
|
|
:goto_4
|
|
const/4 p1, 0x1
|
|
|
|
:goto_5
|
|
if-nez p1, :cond_6
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:cond_6
|
|
return v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getBitmap(Ljava/lang/String;IIZ)Lrx/Observable;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"IIZ)",
|
|
"Lrx/Observable<",
|
|
"Landroid/graphics/Bitmap;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/images/MGImagesBitmap;->isValidUri(Ljava/lang/String;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "invalid uri"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lrx/Observable;->a(Ljava/lang/Throwable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable.error(Illegal\u2026Exception(\"invalid uri\"))"
|
|
|
|
invoke-static {p1, p2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
invoke-static {}, Le/j/g/a/a/b;->a()Le/j/j/e/i;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {p1, p2, p3, v2}, Lcom/discord/utilities/images/MGImages;->getImageRequest(Ljava/lang/String;IIZ)Lcom/facebook/imagepipeline/request/ImageRequestBuilder;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
new-instance p4, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;
|
|
|
|
invoke-direct {p4, p2, p3}, Lcom/discord/utilities/images/MGImagesBitmap$CirclePostProcessor;-><init>(II)V
|
|
|
|
invoke-virtual {v2, p4}, Lcom/facebook/imagepipeline/request/ImageRequestBuilder;->a(Le/j/j/p/d;)Lcom/facebook/imagepipeline/request/ImageRequestBuilder;
|
|
|
|
:cond_1
|
|
invoke-virtual {v2}, Lcom/facebook/imagepipeline/request/ImageRequestBuilder;->a()Le/j/j/p/c;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {v1, p2, v0}, Le/j/j/e/i;->a(Le/j/j/p/c;Ljava/lang/Object;)Lcom/facebook/datasource/DataSource;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance p3, Lcom/discord/utilities/images/MGImagesBitmap$getBitmap$1;
|
|
|
|
invoke-direct {p3, p2, p1}, Lcom/discord/utilities/images/MGImagesBitmap$getBitmap$1;-><init>(Lcom/facebook/datasource/DataSource;Ljava/lang/String;)V
|
|
|
|
invoke-static {p3}, Lrx/Observable;->a(Lrx/Observable$a;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable.unsafeCreate \u2026y emits the bitmap.\n }"
|
|
|
|
invoke-static {p1, p2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_2
|
|
const-string p1, "imageUri"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final getBitmaps(Ljava/util/Set;IIZ)Lrx/Observable;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/String;",
|
|
">;IIZ)",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/utilities/images/MGImagesBitmap$CloseableBitmaps;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-static {p1}, Lw/q/l;->filterNotNull(Ljava/lang/Iterable;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
move-object v2, v1
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
invoke-static {v2}, Lw/a0/n;->isBlank(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v2
|
|
|
|
xor-int/lit8 v2, v2, 0x1
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-static {v0}, Lrx/Observable;->a(Ljava/lang/Iterable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lcom/discord/utilities/images/MGImagesBitmap$getBitmaps$1;
|
|
|
|
invoke-direct {v0, p2, p3, p4}, Lcom/discord/utilities/images/MGImagesBitmap$getBitmaps$1;-><init>(IIZ)V
|
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->d(Le0/l/i;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object p2, Lcom/discord/utilities/images/MGImagesBitmap$getBitmaps$2;->INSTANCE:Lcom/discord/utilities/images/MGImagesBitmap$getBitmaps$2;
|
|
|
|
sget-object p3, Lcom/discord/utilities/images/MGImagesBitmap$getBitmaps$3;->INSTANCE:Lcom/discord/utilities/images/MGImagesBitmap$getBitmaps$3;
|
|
|
|
invoke-virtual {p1, p2, p3}, Lrx/Observable;->a(Le0/l/i;Le0/l/i;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object p2, Lcom/discord/utilities/images/MGImagesBitmap$getBitmaps$4;->INSTANCE:Lcom/discord/utilities/images/MGImagesBitmap$getBitmaps$4;
|
|
|
|
invoke-virtual {p1, p2}, Lrx/Observable;->f(Le0/l/i;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {}, Le0/q/a;->b()Lrx/Scheduler;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, Lrx/Observable;->b(Lrx/Scheduler;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable\n .from\u2026Schedulers.computation())"
|
|
|
|
invoke-static {p1, p2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_2
|
|
const-string p1, "imageUris"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|