discord-jadx/app/src/main/java/c/a/z/a0.java

201 lines
9.1 KiB
Java

package c.a.z;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.os.BundleKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import c.a.i.d;
import com.discord.app.AppBottomSheet;
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.facebook.drawee.view.SimpleDraweeView;
import com.google.android.material.textview.MaterialTextView;
import d0.o;
import d0.z.d.k;
import d0.z.d.m;
import java.io.Serializable;
import java.util.List;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.reflect.KProperty;
/* compiled from: SelectorBottomSheet.kt */
public final class a0 extends AppBottomSheet implements h {
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.W(a0.class, "binding", "getBinding()Lcom/discord/databinding/BottomSheetSimpleSelectorBinding;", 0)};
public static final a j = new a(null);
public Function1<? super Integer, Unit> k;
public final FragmentViewBindingDelegate l = FragmentViewBindingDelegateKt.viewBinding$default(this, b.i, null, 2, null);
/* compiled from: SelectorBottomSheet.kt */
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
}
public final a0 a(FragmentManager fragmentManager, String str, List<b0> list, boolean z2, Function1<? super Integer, Unit> function1) {
m.checkNotNullParameter(fragmentManager, "fragmentManager");
m.checkNotNullParameter(str, "title");
m.checkNotNullParameter(list, "options");
m.checkNotNullParameter(function1, "onSelectedListener");
a0 a0Var = new a0();
a0Var.setArguments(BundleKt.bundleOf(o.to("simple_bottom_sheet_title", str), o.to("simple_bottom_sheet_options", list), o.to("simple_bottom_sheet_show_dividers", Boolean.valueOf(z2))));
a0Var.k = function1;
a0Var.show(fragmentManager, d0.z.d.a0.getOrCreateKotlinClass(a0.class).toString());
return a0Var;
}
}
/* compiled from: SelectorBottomSheet.kt */
public static final /* synthetic */ class b extends k implements Function1<View, c.a.i.c> {
public static final b i = new b();
public b() {
super(1, c.a.i.c.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/BottomSheetSimpleSelectorBinding;", 0);
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public c.a.i.c invoke(View view) {
View view2 = view;
m.checkNotNullParameter(view2, "p1");
int i2 = 2131365686;
ConstraintLayout constraintLayout = (ConstraintLayout) view2.findViewById(2131365686);
if (constraintLayout != null) {
i2 = 2131365687;
TextView textView = (TextView) view2.findViewById(2131365687);
if (textView != null) {
i2 = 2131365688;
MaxHeightRecyclerView maxHeightRecyclerView = (MaxHeightRecyclerView) view2.findViewById(2131365688);
if (maxHeightRecyclerView != null) {
return new c.a.i.c((ConstraintLayout) view2, constraintLayout, textView, maxHeightRecyclerView);
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
}
}
/* compiled from: SelectorBottomSheet.kt */
public static final class c extends d0.z.d.o implements Function2<LayoutInflater, ViewGroup, d0> {
public final /* synthetic */ a0 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public c(a0 a0Var) {
super(2);
this.this$0 = a0Var;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
@Override // kotlin.jvm.functions.Function2
public d0 invoke(LayoutInflater layoutInflater, ViewGroup viewGroup) {
LayoutInflater layoutInflater2 = layoutInflater;
ViewGroup viewGroup2 = viewGroup;
m.checkNotNullParameter(layoutInflater2, "inflater");
m.checkNotNullParameter(viewGroup2, "parent");
View inflate = layoutInflater2.inflate(2131558435, viewGroup2, false);
int i = 2131364609;
MaterialTextView materialTextView = (MaterialTextView) inflate.findViewById(2131364609);
if (materialTextView != null) {
i = 2131364612;
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) inflate.findViewById(2131364612);
if (simpleDraweeView != null) {
i = 2131364614;
MaterialTextView materialTextView2 = (MaterialTextView) inflate.findViewById(2131364614);
if (materialTextView2 != null) {
d dVar = new d((ConstraintLayout) inflate, materialTextView, simpleDraweeView, materialTextView2);
m.checkNotNullExpressionValue(dVar, "BottomSheetSimpleSelecto…(inflater, parent, false)");
a0 a0Var = this.this$0;
Dialog requireDialog = a0Var.requireDialog();
m.checkNotNullExpressionValue(requireDialog, "requireDialog()");
return new d0(a0Var, requireDialog, dVar);
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
}
public a0() {
super(false, 1, null);
}
@Override // c.a.z.h
public void c(int i2) {
Function1<? super Integer, Unit> function1 = this.k;
if (function1 != null) {
function1.invoke(Integer.valueOf(i2));
}
}
public final c.a.i.c g() {
return (c.a.i.c) this.l.getValue((Fragment) this, i[0]);
}
@Override // com.discord.app.AppBottomSheet
public int getContentViewResId() {
return 2131558434;
}
@Override // androidx.fragment.app.DialogFragment, android.content.DialogInterface.OnDismissListener
public void onDismiss(DialogInterface dialogInterface) {
m.checkNotNullParameter(dialogInterface, "dialog");
super.onDismiss(dialogInterface);
this.k = null;
}
@Override // com.discord.app.AppBottomSheet, androidx.fragment.app.Fragment
public void onPause() {
super.onPause();
dismiss();
}
@Override // com.discord.app.AppBottomSheet, androidx.fragment.app.Fragment
public void onViewCreated(View view, Bundle bundle) {
m.checkNotNullParameter(view, "view");
super.onViewCreated(view, bundle);
setBottomSheetCollapsedStateDisabled();
String string = getArgumentsOrDefault().getString("simple_bottom_sheet_title");
Serializable serializable = getArgumentsOrDefault().getSerializable("simple_bottom_sheet_options");
if (!(serializable instanceof List)) {
serializable = null;
}
List list = (List) serializable;
boolean z2 = getArgumentsOrDefault().getBoolean("simple_bottom_sheet_show_dividers");
TextView textView = g().f71c;
m.checkNotNullExpressionValue(textView, "binding.widgetSimpleBottomSheetSelectorPlaceholder");
textView.setText(string);
ConstraintLayout constraintLayout = g().b;
m.checkNotNullExpressionValue(constraintLayout, "binding.widgetSimpleBottomSheetSelectorHeader");
int i2 = 0;
if (!(!(string == null || string.length() == 0))) {
i2 = 8;
}
constraintLayout.setVisibility(i2);
if (list != null) {
MaxHeightRecyclerView maxHeightRecyclerView = g().d;
m.checkNotNullExpressionValue(maxHeightRecyclerView, "binding.widgetSimpleBottomSheetSelectorRecycler");
maxHeightRecyclerView.setAdapter(new SimpleRecyclerAdapter(list, new c(this)));
MaxHeightRecyclerView maxHeightRecyclerView2 = g().d;
RecyclerView.Adapter adapter = maxHeightRecyclerView2.getAdapter();
if (adapter != null) {
adapter.notifyDataSetChanged();
}
if (z2) {
SimpleRecyclerAdapter.Companion.addThemedDivider(maxHeightRecyclerView2);
}
}
}
}