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

102 lines
4.7 KiB
Java
Raw Normal View History

2021-12-17 22:01:24 +00:00
package b.a.y;
2021-08-10 10:47:20 +00:00
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
2021-08-10 10:47:20 +00:00
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
2021-08-10 10:47:20 +00:00
import androidx.core.graphics.drawable.DrawableCompat;
2021-12-17 22:01:24 +00:00
import b.a.i.d;
import b.a.k.b;
import com.discord.R;
import com.discord.utilities.color.ColorCompat;
2021-08-10 10:47:20 +00:00
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;
2021-11-01 07:19:03 +00:00
import d0.z.d.m;
2021-08-10 10:47:20 +00:00
/* compiled from: SelectorBottomSheet.kt */
2021-12-17 22:01:24 +00:00
public final class f0 extends SimpleRecyclerAdapter.ViewHolder<d0> {
2021-08-10 10:47:20 +00:00
public final i a;
2021-12-17 22:01:24 +00:00
/* renamed from: b reason: collision with root package name */
2022-01-24 08:17:14 +00:00
public final DialogInterface f306b;
2021-12-17 22:01:24 +00:00
public final d c;
2021-08-10 10:47:20 +00:00
/* JADX WARNING: Illegal instructions before constructor call */
2021-12-17 22:01:24 +00:00
public f0(i iVar, DialogInterface dialogInterface, d dVar) {
2021-08-10 10:47:20 +00:00
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;
2022-01-24 08:17:14 +00:00
this.f306b = dialogInterface;
2021-12-17 22:01:24 +00:00
this.c = dVar;
}
2021-08-10 10:47:20 +00:00
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // com.discord.utilities.views.SimpleRecyclerAdapter.ViewHolder
2021-12-17 22:01:24 +00:00
public void bind(d0 d0Var) {
2021-08-10 10:47:20 +00:00
int i;
Drawable drawable;
2021-12-17 22:01:24 +00:00
d0 d0Var2 = d0Var;
m.checkNotNullParameter(d0Var2, "data");
MaterialTextView materialTextView = this.c.d;
2021-08-10 10:47:20 +00:00
m.checkNotNullExpressionValue(materialTextView, "itemBinding.selectComponentSheetItemTitle");
2021-12-17 22:01:24 +00:00
b.a(materialTextView, d0Var2.e());
MaterialTextView materialTextView2 = this.c.f93b;
2021-08-10 10:47:20 +00:00
m.checkNotNullExpressionValue(materialTextView2, "itemBinding.selectComponentSheetItemDescription");
2021-12-17 22:01:24 +00:00
ViewExtensions.setTextAndVisibilityBy(materialTextView2, d0Var2.a());
SimpleDraweeView simpleDraweeView = this.c.c;
2021-08-10 10:47:20 +00:00
m.checkNotNullExpressionValue(simpleDraweeView, "itemBinding.selectComponentSheetItemIcon");
int i2 = 0;
2021-12-17 22:01:24 +00:00
if (!((d0Var2.d() == null && d0Var2.b() == null) ? false : true)) {
2021-08-10 10:47:20 +00:00
i2 = 8;
}
simpleDraweeView.setVisibility(i2);
2021-12-17 22:01:24 +00:00
String d = d0Var2.d();
2021-08-10 10:47:20 +00:00
if (d != null) {
2021-12-17 22:01:24 +00:00
SimpleDraweeView simpleDraweeView2 = this.c.c;
2021-08-10 10:47:20 +00:00
m.checkNotNullExpressionValue(simpleDraweeView2, "itemBinding.selectComponentSheetItemIcon");
MGImages.setImage$default(simpleDraweeView2, d, R.dimen.emoji_size, R.dimen.emoji_size, true, null, null, 96, null);
} else {
2021-12-17 22:01:24 +00:00
Integer b2 = d0Var2.b();
if (b2 != null) {
this.c.c.setImageResource(b2.intValue());
2021-08-10 10:47:20 +00:00
}
}
2021-12-17 22:01:24 +00:00
Integer c = d0Var2.c();
if (c != null) {
this.c.c.setColorFilter(c.intValue());
2021-08-10 10:47:20 +00:00
}
2021-12-17 22:01:24 +00:00
MaterialTextView materialTextView3 = this.c.d;
materialTextView3.setText(d0Var2.e());
Integer g = d0Var2.g();
2021-08-10 10:47:20 +00:00
if (g != null) {
i = g.intValue();
} else {
m.checkNotNullExpressionValue(materialTextView3, "this");
i = ColorCompat.getThemedColor(materialTextView3, (int) R.attr.colorHeaderPrimary);
}
materialTextView3.setTextColor(i);
2021-12-17 22:01:24 +00:00
Integer f = d0Var2.f();
2021-08-10 10:47:20 +00:00
if (f != null) {
f.intValue();
2021-12-17 22:01:24 +00:00
Drawable drawable2 = ContextCompat.getDrawable(materialTextView3.getContext(), d0Var2.f().intValue());
2021-08-10 10:47:20 +00:00
if (drawable2 != null) {
2021-12-17 22:01:24 +00:00
MaterialTextView materialTextView4 = this.c.d;
2021-08-10 10:47:20 +00:00
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);
2021-12-17 22:01:24 +00:00
this.c.a.setOnClickListener(new e0(this));
2021-08-10 10:47:20 +00:00
}
}
2021-08-10 10:47:20 +00:00
drawable = null;
com.discord.utilities.drawable.DrawableCompat.setCompoundDrawablesCompat$default(materialTextView3, (Drawable) null, (Drawable) null, drawable, (Drawable) null, 11, (Object) null);
2021-12-17 22:01:24 +00:00
this.c.a.setOnClickListener(new e0(this));
}
}