2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.widgets.chat.input.sticker;
|
|
|
|
|
|
|
|
import android.view.View;
|
|
|
|
import android.widget.FrameLayout;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import com.discord.databinding.StickerCategoryItemPackBinding;
|
|
|
|
import com.discord.databinding.StickerCategoryItemRecentBinding;
|
|
|
|
import com.discord.rlottie.RLottieImageView;
|
|
|
|
import com.discord.views.sticker.StickerView;
|
|
|
|
import com.discord.widgets.chat.input.sticker.StickerCategoryItem;
|
|
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
/* compiled from: StickerCategoryViewHolder.kt */
|
|
|
|
public abstract class StickerCategoryViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
|
|
|
|
/* compiled from: StickerCategoryViewHolder.kt */
|
|
|
|
public static final class Pack extends StickerCategoryViewHolder {
|
|
|
|
private final StickerCategoryItemPackBinding binding;
|
|
|
|
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
|
|
public Pack(StickerCategoryItemPackBinding stickerCategoryItemPackBinding) {
|
|
|
|
super(r0, null);
|
|
|
|
m.checkNotNullParameter(stickerCategoryItemPackBinding, "binding");
|
|
|
|
FrameLayout frameLayout = stickerCategoryItemPackBinding.a;
|
|
|
|
m.checkNotNullExpressionValue(frameLayout, "binding.root");
|
|
|
|
this.binding = stickerCategoryItemPackBinding;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void configure(StickerCategoryItem.PackItem packItem, Function1<? super StickerCategoryItem.PackItem, Unit> function1) {
|
|
|
|
m.checkNotNullParameter(packItem, "packItem");
|
|
|
|
m.checkNotNullParameter(function1, "onPackClicked");
|
2021-06-27 20:53:42 +00:00
|
|
|
this.binding.f1630c.c(packItem.getPack().getCoverSticker(), 2);
|
|
|
|
this.binding.f1630c.setOnClickListener(new StickerCategoryViewHolder$Pack$configure$1(function1, packItem));
|
|
|
|
StickerView stickerView = this.binding.f1630c;
|
|
|
|
SimpleDraweeView simpleDraweeView = stickerView.i.b;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.stickerViewImageview");
|
|
|
|
simpleDraweeView.setImportantForAccessibility(4);
|
2021-06-27 20:53:42 +00:00
|
|
|
RLottieImageView rLottieImageView = stickerView.i.f99c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(rLottieImageView, "binding.stickerViewLottie");
|
|
|
|
rLottieImageView.setImportantForAccessibility(4);
|
2021-06-27 20:53:42 +00:00
|
|
|
ImageView imageView = stickerView.i.d;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(imageView, "binding.stickerViewPlaceholder");
|
|
|
|
imageView.setImportantForAccessibility(4);
|
2021-06-27 20:53:42 +00:00
|
|
|
StickerView stickerView2 = this.binding.f1630c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(stickerView2, "binding.stickerCategoryItemPackAvatar");
|
|
|
|
stickerView2.setContentDescription(packItem.getPack().getName());
|
|
|
|
View view = this.binding.b.b;
|
|
|
|
m.checkNotNullExpressionValue(view, "binding.overline.express…CategorySelectionOverline");
|
|
|
|
view.setVisibility(packItem.isSelected() ? 0 : 8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: StickerCategoryViewHolder.kt */
|
|
|
|
public static final class Recent extends StickerCategoryViewHolder {
|
|
|
|
private final StickerCategoryItemRecentBinding binding;
|
|
|
|
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
|
|
public Recent(StickerCategoryItemRecentBinding stickerCategoryItemRecentBinding) {
|
|
|
|
super(r0, null);
|
|
|
|
m.checkNotNullParameter(stickerCategoryItemRecentBinding, "binding");
|
|
|
|
FrameLayout frameLayout = stickerCategoryItemRecentBinding.a;
|
|
|
|
m.checkNotNullExpressionValue(frameLayout, "binding.root");
|
|
|
|
this.binding = stickerCategoryItemRecentBinding;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void configure(StickerCategoryItem.RecentItem recentItem, Function0<Unit> function0) {
|
|
|
|
m.checkNotNullParameter(recentItem, "categoryItem");
|
|
|
|
m.checkNotNullParameter(function0, "onRecentClicked");
|
|
|
|
View view = this.binding.b.b;
|
|
|
|
m.checkNotNullExpressionValue(view, "binding.overline.express…CategorySelectionOverline");
|
|
|
|
view.setVisibility(recentItem.isSelected() ? 0 : 8);
|
|
|
|
this.itemView.setOnClickListener(new StickerCategoryViewHolder$Recent$configure$1(function0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private StickerCategoryViewHolder(View view) {
|
|
|
|
super(view);
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ StickerCategoryViewHolder(View view, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(view);
|
|
|
|
}
|
|
|
|
}
|