discord-jadx/app/src/main/java/c/a/z/o0/d.java

83 lines
4.6 KiB
Java

package c.a.z.o0;
import android.widget.ImageView;
import com.discord.api.sticker.BaseSticker;
import com.discord.api.sticker.Sticker;
import com.discord.api.sticker.StickerType;
import com.discord.utilities.dsti.StickerUtils;
import com.discord.utilities.file.DownloadUtils;
import com.discord.utilities.images.MGImages;
import com.discord.utilities.view.extensions.ViewExtensions;
import com.discord.views.sticker.StickerView;
import com.facebook.drawee.view.SimpleDraweeView;
import d0.z.d.m;
import d0.z.d.o;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/* compiled from: StickerView.kt */
public final class d extends o implements Function1<Pair<? extends DownloadUtils.DownloadState, ? extends Integer>, Unit> {
public final /* synthetic */ Sticker $fullSticker;
public final /* synthetic */ Integer $localAnimationSettings;
public final /* synthetic */ BaseSticker $sticker;
public final /* synthetic */ StickerView this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public d(StickerView stickerView, Integer num, BaseSticker baseSticker, Sticker sticker) {
super(1);
this.this$0 = stickerView;
this.$localAnimationSettings = num;
this.$sticker = baseSticker;
this.$fullSticker = sticker;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public Unit invoke(Pair<? extends DownloadUtils.DownloadState, ? extends Integer> pair) {
Pair<? extends DownloadUtils.DownloadState, ? extends Integer> pair2 = pair;
DownloadUtils.DownloadState downloadState = (DownloadUtils.DownloadState) pair2.component1();
Integer num = (Integer) pair2.component2();
if (downloadState instanceof DownloadUtils.DownloadState.Completed) {
Integer num2 = this.$localAnimationSettings;
if (num2 != null) {
num = num2;
}
ImageView imageView = this.this$0.i.d;
m.checkNotNullExpressionValue(imageView, "binding.stickerViewPlaceholder");
imageView.setVisibility(8);
SimpleDraweeView simpleDraweeView = this.this$0.i.b;
m.checkNotNullExpressionValue(simpleDraweeView, "binding.stickerViewImageview");
simpleDraweeView.setContentDescription(this.this$0.b(this.$sticker));
StickerType stickerType = null;
if (num != null && num.intValue() == 0) {
Sticker sticker = this.$fullSticker;
if (sticker != null) {
stickerType = sticker.k();
}
if (stickerType == StickerType.STANDARD) {
StickerView stickerView = this.this$0;
stickerView.l = StickerView.a(stickerView, ((DownloadUtils.DownloadState.Completed) downloadState).getFile(), true);
} else {
SimpleDraweeView simpleDraweeView2 = this.this$0.i.b;
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.stickerViewImageview");
MGImages.setImage$default(simpleDraweeView2, StickerUtils.getCDNAssetUrl$default(StickerUtils.INSTANCE, this.$sticker, null, false, 2, null), 0, 0, false, null, null, 124, null);
}
} else if (num != null && num.intValue() == 1) {
SimpleDraweeView simpleDraweeView3 = this.this$0.i.b;
m.checkNotNullExpressionValue(simpleDraweeView3, "binding.stickerViewImageview");
MGImages.setImage$default(simpleDraweeView3, StickerUtils.getCDNAssetUrl$default(StickerUtils.INSTANCE, this.$sticker, null, false, 2, null), 0, 0, false, null, null, 124, null);
SimpleDraweeView simpleDraweeView4 = this.this$0.i.b;
m.checkNotNullExpressionValue(simpleDraweeView4, "binding.stickerViewImageview");
ViewExtensions.setOnLongClickListenerConsumeClick(simpleDraweeView4, new c(this, downloadState));
} else if (num != null && num.intValue() == 2) {
SimpleDraweeView simpleDraweeView5 = this.this$0.i.b;
m.checkNotNullExpressionValue(simpleDraweeView5, "binding.stickerViewImageview");
MGImages.setImage$default(simpleDraweeView5, StickerUtils.getCDNAssetUrl$default(StickerUtils.INSTANCE, this.$sticker, null, false, 2, null), 0, 0, false, null, null, 124, null);
this.this$0.i.b.setOnLongClickListener(null);
}
}
return Unit.a;
}
}