discord-jadx/app/src/main/java/b/a/y/f0.java

102 lines
4.7 KiB
Java

package b.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 b.a.i.d;
import b.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 f0 extends SimpleRecyclerAdapter.ViewHolder<d0> {
public final i a;
/* renamed from: b reason: collision with root package name */
public final DialogInterface f306b;
public final d c;
/* JADX WARNING: Illegal instructions before constructor call */
public f0(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.f306b = dialogInterface;
this.c = 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(d0 d0Var) {
int i;
Drawable drawable;
d0 d0Var2 = d0Var;
m.checkNotNullParameter(d0Var2, "data");
MaterialTextView materialTextView = this.c.d;
m.checkNotNullExpressionValue(materialTextView, "itemBinding.selectComponentSheetItemTitle");
b.a(materialTextView, d0Var2.e());
MaterialTextView materialTextView2 = this.c.f93b;
m.checkNotNullExpressionValue(materialTextView2, "itemBinding.selectComponentSheetItemDescription");
ViewExtensions.setTextAndVisibilityBy(materialTextView2, d0Var2.a());
SimpleDraweeView simpleDraweeView = this.c.c;
m.checkNotNullExpressionValue(simpleDraweeView, "itemBinding.selectComponentSheetItemIcon");
int i2 = 0;
if (!((d0Var2.d() == null && d0Var2.b() == null) ? false : true)) {
i2 = 8;
}
simpleDraweeView.setVisibility(i2);
String d = d0Var2.d();
if (d != null) {
SimpleDraweeView simpleDraweeView2 = this.c.c;
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 b2 = d0Var2.b();
if (b2 != null) {
this.c.c.setImageResource(b2.intValue());
}
}
Integer c = d0Var2.c();
if (c != null) {
this.c.c.setColorFilter(c.intValue());
}
MaterialTextView materialTextView3 = this.c.d;
materialTextView3.setText(d0Var2.e());
Integer g = d0Var2.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 = d0Var2.f();
if (f != null) {
f.intValue();
Drawable drawable2 = ContextCompat.getDrawable(materialTextView3.getContext(), d0Var2.f().intValue());
if (drawable2 != null) {
MaterialTextView materialTextView4 = this.c.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.c.a.setOnClickListener(new e0(this));
}
}
drawable = null;
com.discord.utilities.drawable.DrawableCompat.setCompoundDrawablesCompat$default(materialTextView3, (Drawable) null, (Drawable) null, drawable, (Drawable) null, 11, (Object) null);
this.c.a.setOnClickListener(new e0(this));
}
}