2021-12-21 23:37:30 +00:00
|
|
|
package b.a.a;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-08-10 21:50:53 +00:00
|
|
|
import android.os.Bundle;
|
|
|
|
import android.view.LayoutInflater;
|
2021-06-27 20:44:35 +00:00
|
|
|
import android.view.View;
|
2021-08-10 21:50:53 +00:00
|
|
|
import android.view.ViewGroup;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
2021-12-21 23:37:30 +00:00
|
|
|
import b.a.i.l;
|
2021-08-10 21:50:53 +00:00
|
|
|
import com.discord.R;
|
|
|
|
import com.discord.app.AppDialog;
|
2021-08-18 19:46:22 +00:00
|
|
|
import com.discord.databinding.DialogSimpleSelectorItemBinding;
|
2021-08-10 21:50:53 +00:00
|
|
|
import com.discord.utilities.view.recycler.MaxHeightRecyclerView;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
|
|
import com.discord.utilities.views.SimpleRecyclerAdapter;
|
|
|
|
import com.google.android.material.button.MaterialButton;
|
2021-11-08 18:25:28 +00:00
|
|
|
import d0.t.j;
|
|
|
|
import d0.z.d.a0;
|
|
|
|
import d0.z.d.k;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
2021-06-27 20:44:35 +00:00
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
2021-08-10 21:50:53 +00:00
|
|
|
import kotlin.jvm.functions.Function2;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
2021-06-27 20:44:35 +00:00
|
|
|
/* compiled from: SelectorDialog.kt */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-08-10 21:50:53 +00:00
|
|
|
public final class n extends AppDialog {
|
2022-03-22 15:40:06 +00:00
|
|
|
public static final /* synthetic */ KProperty[] j = {b.d.b.a.a.c0(n.class, "binding", "getBinding()Lcom/discord/databinding/DialogSimpleSelectorBinding;", 0)};
|
2021-12-17 22:03:14 +00:00
|
|
|
public static final a k = new a(null);
|
|
|
|
public Function1<? super Integer, Unit> l;
|
|
|
|
public final FragmentViewBindingDelegate m = FragmentViewBindingDelegateKt.viewBinding$default(this, c.j, null, 2, null);
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-08-10 21:50:53 +00:00
|
|
|
/* compiled from: SelectorDialog.kt */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-08-10 21:50:53 +00:00
|
|
|
public static final class a {
|
|
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public final n a(FragmentManager fragmentManager, CharSequence charSequence, CharSequence[] charSequenceArr, Function1<? super Integer, Unit> function1) {
|
|
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
|
|
m.checkNotNullParameter(charSequence, "title");
|
|
|
|
m.checkNotNullParameter(charSequenceArr, "options");
|
|
|
|
m.checkNotNullParameter(function1, "onSelectedListener");
|
|
|
|
n nVar = new n();
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
bundle.putCharSequence("INTENT_DIALOG_TITLE", charSequence);
|
|
|
|
bundle.putCharSequenceArray("INTENT_DIALOG_OPTIONS", charSequenceArr);
|
|
|
|
nVar.setArguments(bundle);
|
2021-12-17 22:03:14 +00:00
|
|
|
nVar.l = function1;
|
2021-08-10 21:50:53 +00:00
|
|
|
nVar.show(fragmentManager, a0.getOrCreateKotlinClass(n.class).toString());
|
|
|
|
return nVar;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: SelectorDialog.kt */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-08-10 21:50:53 +00:00
|
|
|
public final class b extends SimpleRecyclerAdapter.ViewHolder<CharSequence> {
|
2021-08-18 19:46:22 +00:00
|
|
|
public final DialogSimpleSelectorItemBinding a;
|
2021-12-21 23:37:30 +00:00
|
|
|
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
2022-03-15 17:00:47 +00:00
|
|
|
public final /* synthetic */ n f49b;
|
2021-08-10 21:50:53 +00:00
|
|
|
|
2022-03-02 20:59:20 +00:00
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
|
|
/*
|
|
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
|
|
*/
|
2021-08-18 19:46:22 +00:00
|
|
|
public b(n nVar, DialogSimpleSelectorItemBinding dialogSimpleSelectorItemBinding) {
|
2021-08-10 21:50:53 +00:00
|
|
|
super(r2);
|
2021-08-18 19:46:22 +00:00
|
|
|
m.checkNotNullParameter(dialogSimpleSelectorItemBinding, "binding");
|
2022-03-15 17:00:47 +00:00
|
|
|
this.f49b = nVar;
|
2021-08-18 19:46:22 +00:00
|
|
|
TextView textView = dialogSimpleSelectorItemBinding.a;
|
2021-08-10 21:50:53 +00:00
|
|
|
m.checkNotNullExpressionValue(textView, "binding.root");
|
2021-08-18 19:46:22 +00:00
|
|
|
this.a = dialogSimpleSelectorItemBinding;
|
2021-08-10 21:50:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.utilities.views.SimpleRecyclerAdapter.ViewHolder
|
|
|
|
public void bind(CharSequence charSequence) {
|
|
|
|
CharSequence charSequence2 = charSequence;
|
|
|
|
m.checkNotNullParameter(charSequence2, "data");
|
|
|
|
TextView textView = this.a.a;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.root");
|
|
|
|
textView.setText(charSequence2);
|
|
|
|
this.a.a.setOnClickListener(new o(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: SelectorDialog.kt */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-08-10 21:50:53 +00:00
|
|
|
public static final /* synthetic */ class c extends k implements Function1<View, l> {
|
2021-12-17 22:03:14 +00:00
|
|
|
public static final c j = new c();
|
2021-08-10 21:50:53 +00:00
|
|
|
|
|
|
|
public c() {
|
|
|
|
super(1, l.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/DialogSimpleSelectorBinding;", 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public l invoke(View view) {
|
|
|
|
View view2 = view;
|
|
|
|
m.checkNotNullParameter(view2, "p1");
|
2021-12-17 22:03:14 +00:00
|
|
|
int i = R.id.dialog_cancel;
|
2021-08-10 21:50:53 +00:00
|
|
|
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.dialog_cancel);
|
|
|
|
if (materialButton != null) {
|
2021-12-17 22:03:14 +00:00
|
|
|
i = R.id.dialog_selections;
|
2021-08-10 21:50:53 +00:00
|
|
|
MaxHeightRecyclerView maxHeightRecyclerView = (MaxHeightRecyclerView) view2.findViewById(R.id.dialog_selections);
|
|
|
|
if (maxHeightRecyclerView != null) {
|
2021-12-17 22:03:14 +00:00
|
|
|
i = R.id.dialog_title;
|
2021-08-10 21:50:53 +00:00
|
|
|
TextView textView = (TextView) view2.findViewById(R.id.dialog_title);
|
|
|
|
if (textView != null) {
|
|
|
|
return new l((LinearLayout) view2, materialButton, maxHeightRecyclerView, textView);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-12-17 22:03:14 +00:00
|
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i)));
|
2021-08-10 21:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: SelectorDialog.kt */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-08-10 21:50:53 +00:00
|
|
|
public static final class d implements View.OnClickListener {
|
2022-03-02 20:59:20 +00:00
|
|
|
public d() {
|
2021-08-10 21:50:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
|
|
public final void onClick(View view) {
|
2022-03-02 20:59:20 +00:00
|
|
|
n.this.dismiss();
|
2021-08-10 21:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: SelectorDialog.kt */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-08-10 21:50:53 +00:00
|
|
|
public static final class e extends o implements Function2<LayoutInflater, ViewGroup, b> {
|
2022-03-02 20:59:20 +00:00
|
|
|
public e() {
|
2021-08-10 21:50:53 +00:00
|
|
|
super(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function2
|
|
|
|
public b invoke(LayoutInflater layoutInflater, ViewGroup viewGroup) {
|
|
|
|
LayoutInflater layoutInflater2 = layoutInflater;
|
|
|
|
ViewGroup viewGroup2 = viewGroup;
|
|
|
|
m.checkNotNullParameter(layoutInflater2, "inflater");
|
|
|
|
m.checkNotNullParameter(viewGroup2, "parent");
|
2021-08-18 19:46:22 +00:00
|
|
|
DialogSimpleSelectorItemBinding a = DialogSimpleSelectorItemBinding.a(layoutInflater2, viewGroup2, false);
|
|
|
|
m.checkNotNullExpressionValue(a, "DialogSimpleSelectorItem…(inflater, parent, false)");
|
2022-03-02 20:59:20 +00:00
|
|
|
return new b(n.this, a);
|
2021-08-10 21:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public n() {
|
|
|
|
super(R.layout.dialog_simple_selector);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final l g() {
|
2021-12-17 22:03:14 +00:00
|
|
|
return (l) this.m.getValue((Fragment) this, j[0]);
|
2021-08-10 21:50:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppDialog, androidx.fragment.app.Fragment
|
|
|
|
public void onPause() {
|
|
|
|
super.onPause();
|
|
|
|
dismiss();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
2021-08-10 21:50:53 +00:00
|
|
|
@Override // com.discord.app.AppDialog
|
|
|
|
public void onViewBound(View view) {
|
|
|
|
m.checkNotNullParameter(view, "view");
|
|
|
|
super.onViewBound(view);
|
|
|
|
TextView textView = g().d;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.dialogTitle");
|
|
|
|
textView.setText(getArgumentsOrDefault().getCharSequence("INTENT_DIALOG_TITLE", null));
|
2022-03-15 17:00:47 +00:00
|
|
|
g().f148b.setOnClickListener(new d());
|
2021-08-10 21:50:53 +00:00
|
|
|
CharSequence[] charSequenceArray = getArgumentsOrDefault().getCharSequenceArray("INTENT_DIALOG_OPTIONS");
|
|
|
|
if (charSequenceArray != null) {
|
2021-12-21 23:37:30 +00:00
|
|
|
MaxHeightRecyclerView maxHeightRecyclerView = g().c;
|
2021-08-10 21:50:53 +00:00
|
|
|
m.checkNotNullExpressionValue(maxHeightRecyclerView, "binding.dialogSelections");
|
2022-03-02 20:59:20 +00:00
|
|
|
maxHeightRecyclerView.setAdapter(new SimpleRecyclerAdapter(j.asList(charSequenceArray), new e()));
|
2021-12-21 23:37:30 +00:00
|
|
|
MaxHeightRecyclerView maxHeightRecyclerView2 = g().c;
|
2021-08-10 21:50:53 +00:00
|
|
|
RecyclerView.Adapter adapter = maxHeightRecyclerView2.getAdapter();
|
|
|
|
if (adapter != null) {
|
|
|
|
adapter.notifyDataSetChanged();
|
|
|
|
}
|
|
|
|
maxHeightRecyclerView2.setHasFixedSize(false);
|
|
|
|
maxHeightRecyclerView2.setNestedScrollingEnabled(false);
|
|
|
|
SimpleRecyclerAdapter.Companion companion = SimpleRecyclerAdapter.Companion;
|
2021-12-21 23:37:30 +00:00
|
|
|
MaxHeightRecyclerView maxHeightRecyclerView3 = g().c;
|
2021-08-10 21:50:53 +00:00
|
|
|
m.checkNotNullExpressionValue(maxHeightRecyclerView3, "binding.dialogSelections");
|
|
|
|
companion.addThemedDivider(maxHeightRecyclerView3);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|