discord-jadx/app/src/main/java/com/discord/widgets/chat/input/gifpicker/WidgetGifPickerSheet.java

136 lines
5.8 KiB
Java

package com.discord.widgets.chat.input.gifpicker;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.discord.app.AppBottomSheet;
import d0.z.d.m;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: WidgetGifPickerSheet.kt */
public final class WidgetGifPickerSheet extends AppBottomSheet {
public static final Companion Companion = new Companion(null);
private View container;
private WidgetGifPickerSearch gifPickerFragment;
private Function0<Unit> onCancel;
private Function0<Unit> onGifSelected;
/* compiled from: WidgetGifPickerSheet.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
/* JADX DEBUG: Multi-variable search result rejected for r1v0, resolved type: com.discord.widgets.chat.input.gifpicker.WidgetGifPickerSheet$Companion */
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ void show$default(Companion companion, FragmentManager fragmentManager, Function0 function0, Function0 function02, int i, Object obj) {
if ((i & 2) != 0) {
function0 = null;
}
if ((i & 4) != 0) {
function02 = null;
}
companion.show(fragmentManager, function0, function02);
}
public final void show(FragmentManager fragmentManager, Function0<Unit> function0, Function0<Unit> function02) {
m.checkNotNullParameter(fragmentManager, "fragmentManager");
WidgetGifPickerSheet widgetGifPickerSheet = new WidgetGifPickerSheet();
widgetGifPickerSheet.show(fragmentManager, WidgetGifPickerSheet.class.getSimpleName());
widgetGifPickerSheet.setOnGifSelected(function0);
widgetGifPickerSheet.setOnCancel(function02);
}
}
public WidgetGifPickerSheet() {
super(false, 1, null);
}
public static final /* synthetic */ View access$getContainer$p(WidgetGifPickerSheet widgetGifPickerSheet) {
View view = widgetGifPickerSheet.container;
if (view == null) {
m.throwUninitializedPropertyAccessException("container");
}
return view;
}
public static final /* synthetic */ Function0 access$getOnGifSelected$p(WidgetGifPickerSheet widgetGifPickerSheet) {
return widgetGifPickerSheet.onGifSelected;
}
public static final /* synthetic */ void access$setContainer$p(WidgetGifPickerSheet widgetGifPickerSheet, View view) {
widgetGifPickerSheet.container = view;
}
public static final /* synthetic */ void access$setOnGifSelected$p(WidgetGifPickerSheet widgetGifPickerSheet, Function0 function0) {
widgetGifPickerSheet.onGifSelected = function0;
}
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.chat.input.gifpicker.WidgetGifPickerSheet */
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ void setOnCancel$default(WidgetGifPickerSheet widgetGifPickerSheet, Function0 function0, int i, Object obj) {
if ((i & 1) != 0) {
function0 = null;
}
widgetGifPickerSheet.setOnCancel(function0);
}
@Override // com.discord.app.AppBottomSheet
public int getContentViewResId() {
return 2131559022;
}
@Override // androidx.fragment.app.DialogFragment, android.content.DialogInterface.OnCancelListener
public void onCancel(DialogInterface dialogInterface) {
m.checkNotNullParameter(dialogInterface, "dialog");
super.onCancel(dialogInterface);
WidgetGifPickerSearch widgetGifPickerSearch = this.gifPickerFragment;
if (widgetGifPickerSearch == null) {
m.throwUninitializedPropertyAccessException("gifPickerFragment");
}
widgetGifPickerSearch.clearSearchBar();
Function0<Unit> function0 = this.onCancel;
if (function0 != null) {
function0.mo1invoke();
}
}
@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();
this.container = view;
WidgetGifPickerSearch widgetGifPickerSearch = new WidgetGifPickerSearch();
this.gifPickerFragment = widgetGifPickerSearch;
if (widgetGifPickerSearch == null) {
m.throwUninitializedPropertyAccessException("gifPickerFragment");
}
widgetGifPickerSearch.setOnGifSelected(new WidgetGifPickerSheet$onViewCreated$1(this));
FragmentTransaction beginTransaction = getChildFragmentManager().beginTransaction();
WidgetGifPickerSearch widgetGifPickerSearch2 = this.gifPickerFragment;
if (widgetGifPickerSearch2 == null) {
m.throwUninitializedPropertyAccessException("gifPickerFragment");
}
WidgetGifPickerSearch widgetGifPickerSearch3 = this.gifPickerFragment;
if (widgetGifPickerSearch3 == null) {
m.throwUninitializedPropertyAccessException("gifPickerFragment");
}
beginTransaction.replace(2131363307, widgetGifPickerSearch2, widgetGifPickerSearch3.getClass().getSimpleName()).runOnCommit(new WidgetGifPickerSheet$onViewCreated$2(this)).commit();
}
public final void setOnCancel(Function0<Unit> function0) {
this.onCancel = function0;
}
public final void setOnGifSelected(Function0<Unit> function0) {
this.onGifSelected = function0;
}
}