199 lines
9 KiB
Java
199 lines
9 KiB
Java
package com.discord.widgets.voice.controls;
|
|
|
|
import android.content.DialogInterface;
|
|
import android.content.Intent;
|
|
import android.content.SharedPreferences;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import c.d.b.a.a;
|
|
import com.discord.app.AppBottomSheet;
|
|
import com.discord.databinding.WidgetScreenShareNfxSheetBinding;
|
|
import com.discord.utilities.cache.SharedPreferencesProvider;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import com.discord.widgets.voice.sheet.WidgetVoiceBottomSheet;
|
|
import com.discord.widgets.voice.stream.StreamNavigator;
|
|
import d0.z.d.m;
|
|
import java.io.Serializable;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
/* compiled from: WidgetScreenShareNfxSheet.kt */
|
|
public final class WidgetScreenShareNfxSheet extends AppBottomSheet {
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.V(WidgetScreenShareNfxSheet.class, "binding", "getBinding()Lcom/discord/databinding/WidgetScreenShareNfxSheetBinding;", 0)};
|
|
private static final String ARG_VOICE_BOTTOM_SHEET_PARAMS = "ARG_VOICE_BOTTOM_SHEET_PARAMS";
|
|
public static final Companion Companion = new Companion(null);
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetScreenShareNfxSheet$binding$2.INSTANCE, null, 2, null);
|
|
|
|
/* compiled from: WidgetScreenShareNfxSheet.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public static /* synthetic */ void show$default(Companion companion, FragmentManager fragmentManager, long j, VoiceBottomSheetParams voiceBottomSheetParams, int i, Object obj) {
|
|
if ((i & 4) != 0) {
|
|
voiceBottomSheetParams = null;
|
|
}
|
|
companion.show(fragmentManager, j, voiceBottomSheetParams);
|
|
}
|
|
|
|
public final boolean canShow() {
|
|
return !SharedPreferencesProvider.INSTANCE.get().getBoolean("CACHE_KEY_SCREEN_SHARE_NFX_SHEET_SHOWN", false);
|
|
}
|
|
|
|
public final void show(FragmentManager fragmentManager, long j, VoiceBottomSheetParams voiceBottomSheetParams) {
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
WidgetScreenShareNfxSheet widgetScreenShareNfxSheet = new WidgetScreenShareNfxSheet();
|
|
Bundle bundle = new Bundle();
|
|
bundle.putLong("com.discord.intent.extra.EXTRA_CHANNEL_ID", j);
|
|
bundle.putSerializable("ARG_VOICE_BOTTOM_SHEET_PARAMS", voiceBottomSheetParams);
|
|
widgetScreenShareNfxSheet.setArguments(bundle);
|
|
widgetScreenShareNfxSheet.show(fragmentManager, WidgetScreenShareNfxSheet.class.getName());
|
|
SharedPreferences.Editor edit = SharedPreferencesProvider.INSTANCE.get().edit();
|
|
m.checkExpressionValueIsNotNull(edit, "editor");
|
|
edit.putBoolean("CACHE_KEY_SCREEN_SHARE_NFX_SHEET_SHOWN", true);
|
|
edit.apply();
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetScreenShareNfxSheet.kt */
|
|
public static final class VoiceBottomSheetParams implements Serializable {
|
|
private final WidgetVoiceBottomSheet.FeatureContext featureContext;
|
|
private final boolean forwardToFullscreenIfVideoActivated;
|
|
|
|
public VoiceBottomSheetParams(boolean z2, WidgetVoiceBottomSheet.FeatureContext featureContext) {
|
|
m.checkNotNullParameter(featureContext, "featureContext");
|
|
this.forwardToFullscreenIfVideoActivated = z2;
|
|
this.featureContext = featureContext;
|
|
}
|
|
|
|
public static /* synthetic */ VoiceBottomSheetParams copy$default(VoiceBottomSheetParams voiceBottomSheetParams, boolean z2, WidgetVoiceBottomSheet.FeatureContext featureContext, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
z2 = voiceBottomSheetParams.forwardToFullscreenIfVideoActivated;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
featureContext = voiceBottomSheetParams.featureContext;
|
|
}
|
|
return voiceBottomSheetParams.copy(z2, featureContext);
|
|
}
|
|
|
|
public final boolean component1() {
|
|
return this.forwardToFullscreenIfVideoActivated;
|
|
}
|
|
|
|
public final WidgetVoiceBottomSheet.FeatureContext component2() {
|
|
return this.featureContext;
|
|
}
|
|
|
|
public final VoiceBottomSheetParams copy(boolean z2, WidgetVoiceBottomSheet.FeatureContext featureContext) {
|
|
m.checkNotNullParameter(featureContext, "featureContext");
|
|
return new VoiceBottomSheetParams(z2, featureContext);
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof VoiceBottomSheetParams)) {
|
|
return false;
|
|
}
|
|
VoiceBottomSheetParams voiceBottomSheetParams = (VoiceBottomSheetParams) obj;
|
|
return this.forwardToFullscreenIfVideoActivated == voiceBottomSheetParams.forwardToFullscreenIfVideoActivated && m.areEqual(this.featureContext, voiceBottomSheetParams.featureContext);
|
|
}
|
|
|
|
public final WidgetVoiceBottomSheet.FeatureContext getFeatureContext() {
|
|
return this.featureContext;
|
|
}
|
|
|
|
public final boolean getForwardToFullscreenIfVideoActivated() {
|
|
return this.forwardToFullscreenIfVideoActivated;
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public int hashCode() {
|
|
boolean z2 = this.forwardToFullscreenIfVideoActivated;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i = z2 ? 1 : 0;
|
|
int i2 = z2 ? 1 : 0;
|
|
int i3 = z2 ? 1 : 0;
|
|
int i4 = i * 31;
|
|
WidgetVoiceBottomSheet.FeatureContext featureContext = this.featureContext;
|
|
return i4 + (featureContext != null ? featureContext.hashCode() : 0);
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public String toString() {
|
|
StringBuilder K = a.K("VoiceBottomSheetParams(forwardToFullscreenIfVideoActivated=");
|
|
K.append(this.forwardToFullscreenIfVideoActivated);
|
|
K.append(", featureContext=");
|
|
K.append(this.featureContext);
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
public WidgetScreenShareNfxSheet() {
|
|
super(false, 1, null);
|
|
}
|
|
|
|
public static final /* synthetic */ void access$maybeNavigateToVoiceBottomSheet(WidgetScreenShareNfxSheet widgetScreenShareNfxSheet) {
|
|
widgetScreenShareNfxSheet.maybeNavigateToVoiceBottomSheet();
|
|
}
|
|
|
|
private final WidgetScreenShareNfxSheetBinding getBinding() {
|
|
return (WidgetScreenShareNfxSheetBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
}
|
|
|
|
private final long getChannelId() {
|
|
return requireArguments().getLong("com.discord.intent.extra.EXTRA_CHANNEL_ID");
|
|
}
|
|
|
|
private final VoiceBottomSheetParams getVoiceBottomSheetParams() {
|
|
return (VoiceBottomSheetParams) requireArguments().getSerializable("ARG_VOICE_BOTTOM_SHEET_PARAMS");
|
|
}
|
|
|
|
private final void maybeNavigateToVoiceBottomSheet() {
|
|
VoiceBottomSheetParams voiceBottomSheetParams = getVoiceBottomSheetParams();
|
|
if (voiceBottomSheetParams != null) {
|
|
WidgetVoiceBottomSheet.Companion companion = WidgetVoiceBottomSheet.Companion;
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
companion.show(parentFragmentManager, getChannelId(), voiceBottomSheetParams.getForwardToFullscreenIfVideoActivated(), voiceBottomSheetParams.getFeatureContext());
|
|
}
|
|
}
|
|
|
|
@Override // com.discord.app.AppBottomSheet
|
|
public int getContentViewResId() {
|
|
return 2131559145;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public void onActivityResult(int i, int i2, Intent intent) {
|
|
super.onActivityResult(i, i2, intent);
|
|
StreamNavigator.handleActivityResult(i, i2, intent, new WidgetScreenShareNfxSheet$onActivityResult$1(this));
|
|
}
|
|
|
|
@Override // androidx.fragment.app.DialogFragment, android.content.DialogInterface.OnCancelListener
|
|
public void onCancel(DialogInterface dialogInterface) {
|
|
m.checkNotNullParameter(dialogInterface, "dialog");
|
|
super.onCancel(dialogInterface);
|
|
maybeNavigateToVoiceBottomSheet();
|
|
}
|
|
|
|
@Override // com.discord.app.AppBottomSheet, androidx.fragment.app.Fragment
|
|
public void onViewCreated(View view, Bundle bundle) {
|
|
m.checkNotNullParameter(view, "view");
|
|
super.onViewCreated(view, bundle);
|
|
getBinding().f1870c.setOnClickListener(new WidgetScreenShareNfxSheet$onViewCreated$1(this));
|
|
getBinding().b.setOnClickListener(new WidgetScreenShareNfxSheet$onViewCreated$2(this));
|
|
}
|
|
}
|