discord-jadx/app/src/main/java/c/a/y/e0.java

102 lines
4.7 KiB
Java

package c.a.y;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import c.a.i.d;
import c.a.k.b;
import com.discord.R;
import com.discord.utilities.color.ColorCompat;
import com.discord.utilities.images.MGImages;
import com.discord.utilities.view.extensions.ViewExtensions;
import com.discord.utilities.views.SimpleRecyclerAdapter;
import com.facebook.drawee.view.SimpleDraweeView;
import com.google.android.material.textview.MaterialTextView;
import d0.z.d.m;
/* compiled from: SelectorBottomSheet.kt */
public final class e0 extends SimpleRecyclerAdapter.ViewHolder<c0> {
public final i a;
public final DialogInterface b;
/* renamed from: c reason: collision with root package name */
public final d f246c;
/* JADX WARNING: Illegal instructions before constructor call */
public e0(i iVar, DialogInterface dialogInterface, d dVar) {
super(r0);
m.checkNotNullParameter(iVar, "onSelectedListener");
m.checkNotNullParameter(dialogInterface, "dialogInterface");
m.checkNotNullParameter(dVar, "itemBinding");
ConstraintLayout constraintLayout = dVar.a;
m.checkNotNullExpressionValue(constraintLayout, "itemBinding.root");
this.a = iVar;
this.b = dialogInterface;
this.f246c = dVar;
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // com.discord.utilities.views.SimpleRecyclerAdapter.ViewHolder
public void bind(c0 c0Var) {
int i;
Drawable drawable;
c0 c0Var2 = c0Var;
m.checkNotNullParameter(c0Var2, "data");
MaterialTextView materialTextView = this.f246c.d;
m.checkNotNullExpressionValue(materialTextView, "itemBinding.selectComponentSheetItemTitle");
b.a(materialTextView, c0Var2.e());
MaterialTextView materialTextView2 = this.f246c.b;
m.checkNotNullExpressionValue(materialTextView2, "itemBinding.selectComponentSheetItemDescription");
ViewExtensions.setTextAndVisibilityBy(materialTextView2, c0Var2.a());
SimpleDraweeView simpleDraweeView = this.f246c.f80c;
m.checkNotNullExpressionValue(simpleDraweeView, "itemBinding.selectComponentSheetItemIcon");
int i2 = 0;
if (!((c0Var2.d() == null && c0Var2.b() == null) ? false : true)) {
i2 = 8;
}
simpleDraweeView.setVisibility(i2);
String d = c0Var2.d();
if (d != null) {
SimpleDraweeView simpleDraweeView2 = this.f246c.f80c;
m.checkNotNullExpressionValue(simpleDraweeView2, "itemBinding.selectComponentSheetItemIcon");
MGImages.setImage$default(simpleDraweeView2, d, R.dimen.emoji_size, R.dimen.emoji_size, true, null, null, 96, null);
} else {
Integer b = c0Var2.b();
if (b != null) {
this.f246c.f80c.setImageResource(b.intValue());
}
}
Integer c2 = c0Var2.c();
if (c2 != null) {
this.f246c.f80c.setColorFilter(c2.intValue());
}
MaterialTextView materialTextView3 = this.f246c.d;
materialTextView3.setText(c0Var2.e());
Integer g = c0Var2.g();
if (g != null) {
i = g.intValue();
} else {
m.checkNotNullExpressionValue(materialTextView3, "this");
i = ColorCompat.getThemedColor(materialTextView3, (int) R.attr.colorHeaderPrimary);
}
materialTextView3.setTextColor(i);
Integer f = c0Var2.f();
if (f != null) {
f.intValue();
Drawable drawable2 = ContextCompat.getDrawable(materialTextView3.getContext(), c0Var2.f().intValue());
if (drawable2 != null) {
MaterialTextView materialTextView4 = this.f246c.d;
m.checkNotNullExpressionValue(materialTextView4, "itemBinding.selectComponentSheetItemTitle");
DrawableCompat.setTint(drawable2, ColorCompat.getThemedColor(materialTextView4, (int) R.attr.colorHeaderPrimary));
drawable = drawable2;
com.discord.utilities.drawable.DrawableCompat.setCompoundDrawablesCompat$default(materialTextView3, (Drawable) null, (Drawable) null, drawable, (Drawable) null, 11, (Object) null);
this.f246c.a.setOnClickListener(new d0(this));
}
}
drawable = null;
com.discord.utilities.drawable.DrawableCompat.setCompoundDrawablesCompat$default(materialTextView3, (Drawable) null, (Drawable) null, drawable, (Drawable) null, 11, (Object) null);
this.f246c.a.setOnClickListener(new d0(this));
}
}