176 lines
7.8 KiB
Java
176 lines
7.8 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.fragment.app.Fragment;
|
|
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.z.d.k;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
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) {
|
|
}
|
|
}
|
|
|
|
/* 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 = 2131365619;
|
|
ConstraintLayout constraintLayout = (ConstraintLayout) view2.findViewById(2131365619);
|
|
if (constraintLayout != null) {
|
|
i2 = 2131365620;
|
|
TextView textView = (TextView) view2.findViewById(2131365620);
|
|
if (textView != null) {
|
|
i2 = 2131365621;
|
|
MaxHeightRecyclerView maxHeightRecyclerView = (MaxHeightRecyclerView) view2.findViewById(2131365621);
|
|
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 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 = 2131364567;
|
|
MaterialTextView materialTextView = (MaterialTextView) inflate.findViewById(2131364567);
|
|
if (materialTextView != null) {
|
|
i = 2131364570;
|
|
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) inflate.findViewById(2131364570);
|
|
if (simpleDraweeView != null) {
|
|
i = 2131364572;
|
|
MaterialTextView materialTextView2 = (MaterialTextView) inflate.findViewById(2131364572);
|
|
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;
|
|
TextView textView = g().b;
|
|
m.checkNotNullExpressionValue(textView, "binding.widgetSimpleBottomSheetSelectorPlaceholder");
|
|
textView.setText(string);
|
|
if (list != null) {
|
|
MaxHeightRecyclerView maxHeightRecyclerView = g().f70c;
|
|
m.checkNotNullExpressionValue(maxHeightRecyclerView, "binding.widgetSimpleBottomSheetSelectorRecycler");
|
|
maxHeightRecyclerView.setAdapter(new SimpleRecyclerAdapter(list, new c(this)));
|
|
MaxHeightRecyclerView maxHeightRecyclerView2 = g().f70c;
|
|
RecyclerView.Adapter adapter = maxHeightRecyclerView2.getAdapter();
|
|
if (adapter != null) {
|
|
adapter.notifyDataSetChanged();
|
|
}
|
|
SimpleRecyclerAdapter.Companion.addThemedDivider(maxHeightRecyclerView2);
|
|
}
|
|
}
|
|
}
|