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

96 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.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;
import kotlin.text.Regex;
/* compiled from: SelectorBottomSheet.kt */
public final class d0 extends SimpleRecyclerAdapter.ViewHolder<b0> {
public final h a;
public final DialogInterface b;
/* renamed from: c reason: collision with root package name */
public final d f237c;
/* JADX WARNING: Illegal instructions before constructor call */
public d0(h hVar, DialogInterface dialogInterface, d dVar) {
super(r0);
m.checkNotNullParameter(hVar, "onSelectedListener");
m.checkNotNullParameter(dialogInterface, "dialogInterface");
m.checkNotNullParameter(dVar, "itemBinding");
ConstraintLayout constraintLayout = dVar.a;
m.checkNotNullExpressionValue(constraintLayout, "itemBinding.root");
this.a = hVar;
this.b = dialogInterface;
this.f237c = 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(b0 b0Var) {
int i;
Drawable drawable;
b0 b0Var2 = b0Var;
m.checkNotNullParameter(b0Var2, "data");
MaterialTextView materialTextView = this.f237c.d;
m.checkNotNullExpressionValue(materialTextView, "itemBinding.selectComponentSheetItemTitle");
String c2 = b0Var2.c();
Regex regex = b.a;
m.checkNotNullParameter(materialTextView, "$this$bindText");
materialTextView.setText(c2);
materialTextView.setVisibility((c2 == null || c2.length() == 0) ^ true ? 0 : 8);
MaterialTextView materialTextView2 = this.f237c.b;
m.checkNotNullExpressionValue(materialTextView2, "itemBinding.selectComponentSheetItemDescription");
ViewExtensions.setTextAndVisibilityBy(materialTextView2, b0Var2.a());
if (b0Var2.b() != null) {
SimpleDraweeView simpleDraweeView = this.f237c.f75c;
m.checkNotNullExpressionValue(simpleDraweeView, "itemBinding.selectComponentSheetItemIcon");
simpleDraweeView.setVisibility(0);
SimpleDraweeView simpleDraweeView2 = this.f237c.f75c;
m.checkNotNullExpressionValue(simpleDraweeView2, "itemBinding.selectComponentSheetItemIcon");
MGImages.setImage$default(simpleDraweeView2, b0Var2.b(), 2131165397, 2131165397, true, null, null, 96, null);
} else {
SimpleDraweeView simpleDraweeView3 = this.f237c.f75c;
m.checkNotNullExpressionValue(simpleDraweeView3, "itemBinding.selectComponentSheetItemIcon");
simpleDraweeView3.setVisibility(8);
}
MaterialTextView materialTextView3 = this.f237c.d;
materialTextView3.setText(b0Var2.c());
Integer e = b0Var2.e();
if (e != null) {
i = e.intValue();
} else {
m.checkNotNullExpressionValue(materialTextView3, "this");
i = ColorCompat.getThemedColor(materialTextView3, 2130968932);
}
materialTextView3.setTextColor(i);
Integer d = b0Var2.d();
if (d != null) {
d.intValue();
Drawable drawable2 = ContextCompat.getDrawable(materialTextView3.getContext(), b0Var2.d().intValue());
if (drawable2 != null) {
MaterialTextView materialTextView4 = this.f237c.d;
m.checkNotNullExpressionValue(materialTextView4, "itemBinding.selectComponentSheetItemTitle");
DrawableCompat.setTint(drawable2, ColorCompat.getThemedColor(materialTextView4, 2130968932));
drawable = drawable2;
com.discord.utilities.drawable.DrawableCompat.setCompoundDrawablesCompat$default(materialTextView3, (Drawable) null, (Drawable) null, drawable, (Drawable) null, 11, (Object) null);
this.f237c.a.setOnClickListener(new c0(this));
}
}
drawable = null;
com.discord.utilities.drawable.DrawableCompat.setCompoundDrawablesCompat$default(materialTextView3, (Drawable) null, (Drawable) null, drawable, (Drawable) null, 11, (Object) null);
this.f237c.a.setOnClickListener(new c0(this));
}
}