1678 lines
102 KiB
Java
1678 lines
102 KiB
Java
package com.discord.widgets.voice.fullscreen;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.res.Resources;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.Window;
|
|
import android.view.animation.AlphaAnimation;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import androidx.appcompat.widget.Toolbar;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
|
import androidx.core.app.ActivityOptionsCompat;
|
|
import androidx.core.content.ContextCompat;
|
|
import androidx.core.view.ViewCompat;
|
|
import androidx.core.view.WindowInsetsCompat;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentActivity;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import androidx.fragment.app.FragmentViewModelLazyKt;
|
|
import androidx.recyclerview.widget.GridLayoutManager;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import androidx.viewbinding.ViewBinding;
|
|
import b.a.a.j;
|
|
import b.a.a.m;
|
|
import b.a.d.f0;
|
|
import b.a.d.h0;
|
|
import b.a.i.i;
|
|
import b.a.i.j;
|
|
import b.a.j.a;
|
|
import b.a.k.b;
|
|
import b.c.a.a0.d;
|
|
import b.d.b.a.a;
|
|
import com.discord.R;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.channel.ChannelUtils;
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
|
import com.discord.api.permission.Permission;
|
|
import com.discord.app.AppActivity;
|
|
import com.discord.app.AppFragment;
|
|
import com.discord.app.AppLog;
|
|
import com.discord.app.AppTransitionActivity;
|
|
import com.discord.databinding.WidgetCallFullscreenBinding;
|
|
import com.discord.floating_view_manager.FloatingViewGravity;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.models.guild.UserGuildMember;
|
|
import com.discord.models.user.User;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.stores.StoreVoiceParticipants;
|
|
import com.discord.tooltips.DefaultTooltipCreator;
|
|
import com.discord.tooltips.TooltipManager;
|
|
import com.discord.utilities.KotlinExtensionsKt;
|
|
import com.discord.utilities.accessibility.AccessibilityUtils;
|
|
import com.discord.utilities.color.ColorCompat;
|
|
import com.discord.utilities.device.DeviceUtils;
|
|
import com.discord.utilities.dimen.DimenUtils;
|
|
import com.discord.utilities.drawable.DrawableCompat;
|
|
import com.discord.utilities.extensions.SimpleDraweeViewExtensionsKt;
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilities;
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilitiesKt;
|
|
import com.discord.utilities.icon.IconUtils;
|
|
import com.discord.utilities.mg_recycler.MGRecyclerAdapter;
|
|
import com.discord.utilities.permissions.PermissionUtils;
|
|
import com.discord.utilities.press.OnPressListener;
|
|
import com.discord.utilities.resources.StringResourceUtilsKt;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import com.discord.utilities.views.viewstub.LazyViewStubDelegate;
|
|
import com.discord.utilities.voice.VoiceViewUtils;
|
|
import com.discord.views.calls.CallEventsButtonView;
|
|
import com.discord.views.calls.StageCallVisitCommunityView;
|
|
import com.discord.views.calls.VideoCallParticipantView;
|
|
import com.discord.views.calls.VoiceCallActiveEventView;
|
|
import com.discord.views.user.UserSummaryView;
|
|
import com.discord.widgets.guildscheduledevent.GuildEventPromptListView;
|
|
import com.discord.widgets.guildscheduledevent.WidgetEndGuildScheduledEventBottomSheet;
|
|
import com.discord.widgets.notice.WidgetNoticeDialog;
|
|
import com.discord.widgets.settings.premium.WidgetSettingsPremium;
|
|
import com.discord.widgets.stage.StageRoles;
|
|
import com.discord.widgets.stage.model.StageCallModel;
|
|
import com.discord.widgets.stage.model.StageMediaParticipant;
|
|
import com.discord.widgets.stage.sheet.WidgetEndStageBottomSheet;
|
|
import com.discord.widgets.stage.start.StageEventsGuildsFeatureFlag;
|
|
import com.discord.widgets.status.WidgetGlobalStatusIndicatorState;
|
|
import com.discord.widgets.user.usersheet.WidgetUserSheet;
|
|
import com.discord.widgets.voice.controls.VoiceControlsOutputSelectorState;
|
|
import com.discord.widgets.voice.controls.VoiceControlsSheetSwipeTooltip;
|
|
import com.discord.widgets.voice.controls.VoiceControlsSheetView;
|
|
import com.discord.widgets.voice.feedback.call.CallFeedbackSheetNavigator;
|
|
import com.discord.widgets.voice.feedback.stream.StreamFeedbackSheetNavigator;
|
|
import com.discord.widgets.voice.fullscreen.CallParticipant;
|
|
import com.discord.widgets.voice.fullscreen.WidgetCallFullscreenViewModel;
|
|
import com.discord.widgets.voice.fullscreen.grid.VideoCallGridAdapter;
|
|
import com.discord.widgets.voice.fullscreen.grid.VideoCallGridLayoutManager;
|
|
import com.discord.widgets.voice.fullscreen.stage.StageCallAdapter;
|
|
import com.discord.widgets.voice.fullscreen.stage.StageCallBottomSheetManager;
|
|
import com.discord.widgets.voice.fullscreen.stage.StageCallItem;
|
|
import com.discord.widgets.voice.fullscreen.stage.StageCallParticipantItem;
|
|
import com.discord.widgets.voice.model.CallModel;
|
|
import com.discord.widgets.voice.model.CameraState;
|
|
import com.discord.widgets.voice.stream.StreamNavigator;
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
|
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
|
import com.google.android.material.button.MaterialButton;
|
|
import com.google.android.material.textview.MaterialTextView;
|
|
import d0.t.c0;
|
|
import d0.t.o;
|
|
import d0.t.u;
|
|
import d0.z.d.a0;
|
|
import d0.z.d.m;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.Set;
|
|
import java.util.concurrent.TimeUnit;
|
|
import kotlin.Lazy;
|
|
import kotlin.NoWhenBranchMatchedException;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.ranges.IntRange;
|
|
import kotlin.reflect.KProperty;
|
|
import rx.Observable;
|
|
import rx.Subscription;
|
|
/* compiled from: WidgetCallFullscreen.kt */
|
|
public final class WidgetCallFullscreen extends AppFragment {
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.b0(WidgetCallFullscreen.class, "binding", "getBinding()Lcom/discord/databinding/WidgetCallFullscreenBinding;", 0)};
|
|
public static final Companion Companion = new Companion(null);
|
|
private static final String END_EVENT_REQUEST_KEY = "END_EVENT_REQUEST_KEY";
|
|
private static final String END_STAGE_REQUEST_KEY = "END_STAGE_REQUEST_KEY";
|
|
private static final String INTENT_EXTRA_CONNECT_ON_LAUNCH = "INTENT_EXTRA_CONNECT_ON_LAUNCH";
|
|
public static final int MAX_SPEAKERS_PER_ROW = 3;
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding(this, WidgetCallFullscreen$binding$2.INSTANCE, new WidgetCallFullscreen$binding$3(this));
|
|
private BottomSheetBehavior<VoiceControlsSheetView> bottomSheetBehavior;
|
|
private final BottomSheetBehavior.BottomSheetCallback bottomSheetCallback = new WidgetCallFullscreen$bottomSheetCallback$1(this);
|
|
private Subscription connectedTimerSubscription;
|
|
private final DefaultTooltipCreator defaultTooltipCreator;
|
|
private final Lazy eventPromptOverlay$delegate;
|
|
private VideoCallGridAdapter gridAdapter;
|
|
private boolean hasVideoCallGridChildrenChanged;
|
|
private Integer lastMentionsCount;
|
|
private Set<? extends WidgetCallFullscreenViewModel.MenuItem> lastMenuItems;
|
|
private Integer lastUnreadsCount;
|
|
private StageCallAdapter stageAdapter;
|
|
private final StageCallBottomSheetManager stageCallBottomSheetManager;
|
|
private GridLayoutManager stageLayoutManager;
|
|
private final WidgetCallFullscreen$stageSpeakerPillManagingScrollListener$1 stageSpeakerPillManagingScrollListener = new WidgetCallFullscreen$stageSpeakerPillManagingScrollListener$1(this);
|
|
private WindowInsetsCompat systemWindowInsets;
|
|
private final TooltipManager tooltipManager;
|
|
private final Lazy viewModel$delegate = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(WidgetCallFullscreenViewModel.class), new WidgetCallFullscreen$appViewModels$$inlined$viewModels$1(new f0(this)), new h0(new WidgetCallFullscreen$viewModel$2(this)));
|
|
|
|
/* compiled from: WidgetCallFullscreen.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public static /* synthetic */ void launch$default(Companion companion, Context context, long j, boolean z2, String str, AppTransitionActivity.Transition transition, int i, Object obj) {
|
|
companion.launch(context, j, (i & 4) != 0 ? false : z2, (i & 8) != 0 ? null : str, (i & 16) != 0 ? null : transition);
|
|
}
|
|
|
|
public final int getUnreadIndicatorMarginDp(Resources resources) {
|
|
m.checkNotNullParameter(resources, "resources");
|
|
return resources.getConfiguration().orientation != 2 ? DeviceUtils.INSTANCE.isTablet(resources) ? 36 : 32 : DeviceUtils.INSTANCE.isTablet(resources) ? 36 : 28;
|
|
}
|
|
|
|
public final int getUnreadIndicatorMarginLeftDp(Resources resources) {
|
|
m.checkNotNullParameter(resources, "resources");
|
|
if (resources.getConfiguration().orientation != 2) {
|
|
if (DeviceUtils.INSTANCE.isTablet(resources)) {
|
|
return 40;
|
|
}
|
|
} else if (DeviceUtils.INSTANCE.isTablet(resources)) {
|
|
return 40;
|
|
}
|
|
return 32;
|
|
}
|
|
|
|
public final void launch(Context context, long j, boolean z2, String str, AppTransitionActivity.Transition transition) {
|
|
ActivityOptionsCompat activityOptions;
|
|
m.checkNotNullParameter(context, "context");
|
|
Intent intent = new Intent(context, AppActivity.Call.class);
|
|
intent.putExtra("com.discord.intent.extra.EXTRA_CHANNEL_ID", j);
|
|
intent.putExtra("com.discord.intent.extra.EXTRA_STREAM_KEY", str);
|
|
intent.putExtra(WidgetCallFullscreen.INTENT_EXTRA_CONNECT_ON_LAUNCH, z2);
|
|
context.startActivity(intent, (transition == null || (activityOptions = transition.toActivityOptions(context)) == null) ? null : activityOptions.toBundle());
|
|
}
|
|
}
|
|
|
|
public final /* synthetic */ class WhenMappings {
|
|
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
|
public static final /* synthetic */ int[] $EnumSwitchMapping$1;
|
|
|
|
static {
|
|
WidgetCallFullscreenViewModel.DisplayMode.values();
|
|
int[] iArr = new int[3];
|
|
$EnumSwitchMapping$0 = iArr;
|
|
WidgetCallFullscreenViewModel.DisplayMode displayMode = WidgetCallFullscreenViewModel.DisplayMode.STAGE;
|
|
iArr[displayMode.ordinal()] = 1;
|
|
WidgetCallFullscreenViewModel.DisplayMode displayMode2 = WidgetCallFullscreenViewModel.DisplayMode.GRID;
|
|
iArr[displayMode2.ordinal()] = 2;
|
|
WidgetCallFullscreenViewModel.DisplayMode.values();
|
|
int[] iArr2 = new int[3];
|
|
$EnumSwitchMapping$1 = iArr2;
|
|
iArr2[displayMode.ordinal()] = 1;
|
|
iArr2[displayMode2.ordinal()] = 2;
|
|
iArr2[WidgetCallFullscreenViewModel.DisplayMode.PRIVATE_CALL_PARTICIPANTS.ordinal()] = 3;
|
|
}
|
|
}
|
|
|
|
public WidgetCallFullscreen() {
|
|
super(R.layout.widget_call_fullscreen);
|
|
AppLog appLog = AppLog.g;
|
|
m.checkNotNullParameter(appLog, "logger");
|
|
WeakReference<b.a.j.a> weakReference = a.b.a;
|
|
TooltipManager tooltipManager = null;
|
|
b.a.j.a aVar = weakReference != null ? weakReference.get() : null;
|
|
if (aVar == null) {
|
|
aVar = new b.a.j.a(appLog);
|
|
a.b.a = new WeakReference<>(aVar);
|
|
}
|
|
TooltipManager.a aVar2 = TooltipManager.a.d;
|
|
m.checkNotNullParameter(aVar, "floatingViewManager");
|
|
WeakReference<TooltipManager> weakReference2 = TooltipManager.a.a;
|
|
tooltipManager = weakReference2 != null ? weakReference2.get() : tooltipManager;
|
|
if (tooltipManager == null) {
|
|
tooltipManager = new TooltipManager((b.a.v.a) TooltipManager.a.f2789b.getValue(), (Set) TooltipManager.a.c.getValue(), 0, aVar, 4);
|
|
TooltipManager.a.a = new WeakReference<>(tooltipManager);
|
|
}
|
|
this.tooltipManager = tooltipManager;
|
|
this.defaultTooltipCreator = new DefaultTooltipCreator(tooltipManager);
|
|
this.stageCallBottomSheetManager = new StageCallBottomSheetManager();
|
|
this.eventPromptOverlay$delegate = LazyViewStubDelegate.Companion.lazyViewStub(new WidgetCallFullscreen$eventPromptOverlay$2(this));
|
|
}
|
|
|
|
public static final /* synthetic */ void access$configureUI(WidgetCallFullscreen widgetCallFullscreen, WidgetCallFullscreenViewModel.ViewState viewState) {
|
|
widgetCallFullscreen.configureUI(viewState);
|
|
}
|
|
|
|
public static final /* synthetic */ void access$finishActivity(WidgetCallFullscreen widgetCallFullscreen, boolean z2, boolean z3) {
|
|
widgetCallFullscreen.finishActivity(z2, z3);
|
|
}
|
|
|
|
public static final /* synthetic */ WidgetCallFullscreenBinding access$getBinding$p(WidgetCallFullscreen widgetCallFullscreen) {
|
|
return widgetCallFullscreen.getBinding();
|
|
}
|
|
|
|
public static final /* synthetic */ long access$getChannelId(WidgetCallFullscreen widgetCallFullscreen) {
|
|
return widgetCallFullscreen.getChannelId();
|
|
}
|
|
|
|
public static final /* synthetic */ Subscription access$getConnectedTimerSubscription$p(WidgetCallFullscreen widgetCallFullscreen) {
|
|
return widgetCallFullscreen.connectedTimerSubscription;
|
|
}
|
|
|
|
public static final /* synthetic */ VideoCallGridAdapter access$getGridAdapter$p(WidgetCallFullscreen widgetCallFullscreen) {
|
|
VideoCallGridAdapter videoCallGridAdapter = widgetCallFullscreen.gridAdapter;
|
|
if (videoCallGridAdapter == null) {
|
|
m.throwUninitializedPropertyAccessException("gridAdapter");
|
|
}
|
|
return videoCallGridAdapter;
|
|
}
|
|
|
|
public static final /* synthetic */ boolean access$getHasVideoCallGridChildrenChanged$p(WidgetCallFullscreen widgetCallFullscreen) {
|
|
return widgetCallFullscreen.hasVideoCallGridChildrenChanged;
|
|
}
|
|
|
|
public static final /* synthetic */ WindowInsetsCompat access$getSystemWindowInsets$p(WidgetCallFullscreen widgetCallFullscreen) {
|
|
return widgetCallFullscreen.systemWindowInsets;
|
|
}
|
|
|
|
public static final /* synthetic */ TooltipManager access$getTooltipManager$p(WidgetCallFullscreen widgetCallFullscreen) {
|
|
return widgetCallFullscreen.tooltipManager;
|
|
}
|
|
|
|
public static final /* synthetic */ WidgetCallFullscreenViewModel access$getViewModel$p(WidgetCallFullscreen widgetCallFullscreen) {
|
|
return widgetCallFullscreen.getViewModel();
|
|
}
|
|
|
|
public static final /* synthetic */ List access$getVisibleParticipants(WidgetCallFullscreen widgetCallFullscreen, VideoCallGridLayoutManager videoCallGridLayoutManager) {
|
|
return widgetCallFullscreen.getVisibleParticipants(videoCallGridLayoutManager);
|
|
}
|
|
|
|
public static final /* synthetic */ boolean access$isStageUserVisible(WidgetCallFullscreen widgetCallFullscreen, long j) {
|
|
return widgetCallFullscreen.isStageUserVisible(j);
|
|
}
|
|
|
|
public static final /* synthetic */ void access$onViewBindingDestroy(WidgetCallFullscreen widgetCallFullscreen, WidgetCallFullscreenBinding widgetCallFullscreenBinding) {
|
|
widgetCallFullscreen.onViewBindingDestroy(widgetCallFullscreenBinding);
|
|
}
|
|
|
|
public static final /* synthetic */ void access$setConnectedTimerSubscription$p(WidgetCallFullscreen widgetCallFullscreen, Subscription subscription) {
|
|
widgetCallFullscreen.connectedTimerSubscription = subscription;
|
|
}
|
|
|
|
public static final /* synthetic */ void access$setGridAdapter$p(WidgetCallFullscreen widgetCallFullscreen, VideoCallGridAdapter videoCallGridAdapter) {
|
|
widgetCallFullscreen.gridAdapter = videoCallGridAdapter;
|
|
}
|
|
|
|
public static final /* synthetic */ void access$setHasVideoCallGridChildrenChanged$p(WidgetCallFullscreen widgetCallFullscreen, boolean z2) {
|
|
widgetCallFullscreen.hasVideoCallGridChildrenChanged = z2;
|
|
}
|
|
|
|
public static final /* synthetic */ void access$setSystemWindowInsets$p(WidgetCallFullscreen widgetCallFullscreen, WindowInsetsCompat windowInsetsCompat) {
|
|
widgetCallFullscreen.systemWindowInsets = windowInsetsCompat;
|
|
}
|
|
|
|
public static final /* synthetic */ void access$setVoiceControlsSheetPeekHeight(WidgetCallFullscreen widgetCallFullscreen) {
|
|
widgetCallFullscreen.setVoiceControlsSheetPeekHeight();
|
|
}
|
|
|
|
public static final /* synthetic */ void access$transitionActivity(WidgetCallFullscreen widgetCallFullscreen) {
|
|
widgetCallFullscreen.transitionActivity();
|
|
}
|
|
|
|
private final void collapseBottomSheet() {
|
|
BottomSheetBehavior<VoiceControlsSheetView> bottomSheetBehavior = this.bottomSheetBehavior;
|
|
if (bottomSheetBehavior == null) {
|
|
m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
}
|
|
bottomSheetBehavior.setState(4);
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:31:0x00cc */
|
|
/* JADX WARNING: Removed duplicated region for block: B:39:0x00f9 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:40:0x00fb */
|
|
/* JADX WARNING: Removed duplicated region for block: B:43:0x010b */
|
|
/* JADX WARNING: Removed duplicated region for block: B:44:0x010d */
|
|
/* JADX WARNING: Removed duplicated region for block: B:51:0x0143 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:59:0x0196 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:60:0x0198 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:67:0x01be */
|
|
/* JADX WARNING: Removed duplicated region for block: B:78:0x022c */
|
|
/* JADX WARNING: Removed duplicated region for block: B:79:0x022e */
|
|
/* JADX WARNING: Removed duplicated region for block: B:81:0x023f */
|
|
/* JADX WARNING: Removed duplicated region for block: B:83:0x0242 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:86:0x0248 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:89:0x025b */
|
|
private final void configureActionBar(WidgetCallFullscreenViewModel.ViewState.Valid valid) {
|
|
int i;
|
|
Guild guild;
|
|
boolean z2;
|
|
boolean z3;
|
|
String titleText;
|
|
Guild guild2;
|
|
boolean z4;
|
|
boolean z5;
|
|
boolean z6;
|
|
ViewExtensions.fadeBy(getBinding().d, valid.getShowControls(), 200);
|
|
int i2 = 0;
|
|
ViewExtensions.fadeBy(getBinding().h, valid.getShowControls() && valid.getMentionCount() > 0, 200);
|
|
TextView textView = getBinding().h;
|
|
m.checkNotNullExpressionValue(textView, "binding.callFullscreenMentions");
|
|
textView.setText(String.valueOf(valid.getMentionCount()));
|
|
Toolbar toolbar = getBinding().f2230b;
|
|
m.checkNotNullExpressionValue(toolbar, "binding.actionBarToolbar");
|
|
Context requireContext = requireContext();
|
|
if (!valid.isTextInVoiceEnabled() && valid.getDisplayMode() != WidgetCallFullscreenViewModel.DisplayMode.STAGE) {
|
|
TextView textView2 = getBinding().h;
|
|
m.checkNotNullExpressionValue(textView2, "binding.callFullscreenMentions");
|
|
if (textView2.getVisibility() == 0) {
|
|
i = R.drawable.ic_call_toolbar_icon_minimize_cutout;
|
|
toolbar.setNavigationIcon(ContextCompat.getDrawable(requireContext, i));
|
|
getBinding().f2230b.setNavigationOnClickListener(new WidgetCallFullscreen$configureActionBar$1(this, valid));
|
|
CallEventsButtonView callEventsButtonView = getBinding().w;
|
|
guild = valid.getCallModel().getGuild();
|
|
boolean hasLiveEvent = (guild != null && valid.getStageCallModel() != null && !valid.getStageCallModel().isLurking() && StageEventsGuildsFeatureFlag.Companion.getINSTANCE().canGuildAccessStageEvents(guild.getId())) ? !valid.getCallModel().canManageEvent() ? true : GuildScheduledEventUtilitiesKt.hasLiveEvent(valid.getCallModel().getGuildScheduledEvents()) : false;
|
|
callEventsButtonView.setVisibility(!hasLiveEvent ? 0 : 8);
|
|
if (guild != null && hasLiveEvent) {
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
callEventsButtonView.a(parentFragmentManager, guild.getId(), getChannelId(), valid.getCallModel().getGuildScheduledEvents());
|
|
}
|
|
VoiceCallActiveEventView voiceCallActiveEventView = getBinding().f2232x;
|
|
m.checkNotNullExpressionValue(voiceCallActiveEventView, "binding.toolbarVoiceActiveEvent");
|
|
if (valid.getStageCallModel() == null) {
|
|
GuildScheduledEvent activeEvent = valid.getActiveEvent();
|
|
if (activeEvent != null) {
|
|
VoiceCallActiveEventView voiceCallActiveEventView2 = getBinding().f2232x;
|
|
Channel channel = valid.getCallModel().getChannel();
|
|
Objects.requireNonNull(voiceCallActiveEventView2);
|
|
m.checkNotNullParameter(channel, "channel");
|
|
m.checkNotNullParameter(activeEvent, "guildScheduledEvent");
|
|
TextView textView3 = voiceCallActiveEventView2.j.f105b;
|
|
m.checkNotNullExpressionValue(textView3, "binding.channelName");
|
|
textView3.setText(channel.m());
|
|
TextView textView4 = voiceCallActiveEventView2.j.c;
|
|
m.checkNotNullExpressionValue(textView4, "binding.eventName");
|
|
textView4.setText(activeEvent.j());
|
|
voiceCallActiveEventView2.setOnClickListener(new WidgetCallFullscreen$configureActionBar$$inlined$let$lambda$1(activeEvent, this, valid));
|
|
z6 = true;
|
|
} else {
|
|
z6 = false;
|
|
}
|
|
if (z6) {
|
|
z2 = true;
|
|
voiceCallActiveEventView.setVisibility(z2 ? 0 : 8);
|
|
StageCallVisitCommunityView stageCallVisitCommunityView = getBinding().q;
|
|
m.checkNotNullExpressionValue(stageCallVisitCommunityView, "binding.callVisitCommunity");
|
|
StageCallModel stageCallModel = valid.getStageCallModel();
|
|
if (stageCallModel != null && stageCallModel.isLurking()) {
|
|
guild2 = valid.getStageCallModel().getGuild();
|
|
if (guild2 != null) {
|
|
StageCallVisitCommunityView stageCallVisitCommunityView2 = getBinding().q;
|
|
Objects.requireNonNull(stageCallVisitCommunityView2);
|
|
m.checkNotNullParameter(guild2, "guild");
|
|
String icon = guild2.getIcon();
|
|
if (icon != null) {
|
|
if (icon.length() > 0) {
|
|
z5 = true;
|
|
SimpleDraweeView simpleDraweeView = stageCallVisitCommunityView2.j.f202b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.visitCommunityIcon");
|
|
SimpleDraweeViewExtensionsKt.setGuildIcon$default(simpleDraweeView, true, guild2, (float) stageCallVisitCommunityView2.getResources().getDimensionPixelSize(R.dimen.guild_icon_radius), Integer.valueOf(IconUtils.getMediaProxySize(stageCallVisitCommunityView2.getResources().getDimensionPixelSize(R.dimen.avatar_size_medium))), null, null, null, false, null, 496, null);
|
|
TextView textView5 = stageCallVisitCommunityView2.j.c;
|
|
m.checkNotNullExpressionValue(textView5, "binding.visitCommunityIconText");
|
|
textView5.setText(!z5 ? null : guild2.getShortName());
|
|
stageCallVisitCommunityView2.setOnClickListener(new WidgetCallFullscreen$configureActionBar$$inlined$let$lambda$2(guild2, this));
|
|
z4 = true;
|
|
}
|
|
}
|
|
z5 = false;
|
|
SimpleDraweeView simpleDraweeView = stageCallVisitCommunityView2.j.f202b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.visitCommunityIcon");
|
|
SimpleDraweeViewExtensionsKt.setGuildIcon$default(simpleDraweeView, true, guild2, (float) stageCallVisitCommunityView2.getResources().getDimensionPixelSize(R.dimen.guild_icon_radius), Integer.valueOf(IconUtils.getMediaProxySize(stageCallVisitCommunityView2.getResources().getDimensionPixelSize(R.dimen.avatar_size_medium))), null, null, null, false, null, 496, null);
|
|
TextView textView5 = stageCallVisitCommunityView2.j.c;
|
|
m.checkNotNullExpressionValue(textView5, "binding.visitCommunityIconText");
|
|
textView5.setText(!z5 ? null : guild2.getShortName());
|
|
stageCallVisitCommunityView2.setOnClickListener(new WidgetCallFullscreen$configureActionBar$$inlined$let$lambda$2(guild2, this));
|
|
z4 = true;
|
|
} else {
|
|
z4 = false;
|
|
}
|
|
if (z4) {
|
|
z3 = true;
|
|
if (!z3) {
|
|
i2 = 8;
|
|
}
|
|
stageCallVisitCommunityView.setVisibility(i2);
|
|
int color = ColorCompat.getColor(this, (int) R.color.transparent);
|
|
titleText = valid.getTitleText();
|
|
if (titleText == null) {
|
|
titleText = "";
|
|
}
|
|
setActionBarTitle(titleText);
|
|
setActionBarTitleColor(-1);
|
|
ViewExtensions.fadeBy(getBinding().c, valid.getShowControls(), 200);
|
|
ColorCompat.setStatusBarTranslucent(this);
|
|
ColorCompat.setStatusBarColor((Fragment) this, color, true);
|
|
}
|
|
}
|
|
z3 = false;
|
|
if (!z3) {
|
|
}
|
|
stageCallVisitCommunityView.setVisibility(i2);
|
|
int color = ColorCompat.getColor(this, (int) R.color.transparent);
|
|
titleText = valid.getTitleText();
|
|
if (titleText == null) {
|
|
}
|
|
setActionBarTitle(titleText);
|
|
setActionBarTitleColor(-1);
|
|
ViewExtensions.fadeBy(getBinding().c, valid.getShowControls(), 200);
|
|
ColorCompat.setStatusBarTranslucent(this);
|
|
ColorCompat.setStatusBarColor((Fragment) this, color, true);
|
|
}
|
|
}
|
|
z2 = false;
|
|
voiceCallActiveEventView.setVisibility(z2 ? 0 : 8);
|
|
StageCallVisitCommunityView stageCallVisitCommunityView = getBinding().q;
|
|
m.checkNotNullExpressionValue(stageCallVisitCommunityView, "binding.callVisitCommunity");
|
|
StageCallModel stageCallModel = valid.getStageCallModel();
|
|
guild2 = valid.getStageCallModel().getGuild();
|
|
if (guild2 != null) {
|
|
}
|
|
if (z4) {
|
|
}
|
|
z3 = false;
|
|
if (!z3) {
|
|
}
|
|
stageCallVisitCommunityView.setVisibility(i2);
|
|
int color = ColorCompat.getColor(this, (int) R.color.transparent);
|
|
titleText = valid.getTitleText();
|
|
if (titleText == null) {
|
|
}
|
|
setActionBarTitle(titleText);
|
|
setActionBarTitleColor(-1);
|
|
ViewExtensions.fadeBy(getBinding().c, valid.getShowControls(), 200);
|
|
ColorCompat.setStatusBarTranslucent(this);
|
|
ColorCompat.setStatusBarColor((Fragment) this, color, true);
|
|
}
|
|
}
|
|
if (valid.isTextInVoiceEnabled() || valid.getDisplayMode() == WidgetCallFullscreenViewModel.DisplayMode.STAGE) {
|
|
TextView textView6 = getBinding().h;
|
|
m.checkNotNullExpressionValue(textView6, "binding.callFullscreenMentions");
|
|
i = textView6.getVisibility() == 0 ? R.drawable.ic_call_toolbar_stage_minimize_cutout_dark : R.drawable.ic_call_toolbar_stage_minimize_dark;
|
|
toolbar.setNavigationIcon(ContextCompat.getDrawable(requireContext, i));
|
|
getBinding().f2230b.setNavigationOnClickListener(new WidgetCallFullscreen$configureActionBar$1(this, valid));
|
|
CallEventsButtonView callEventsButtonView = getBinding().w;
|
|
guild = valid.getCallModel().getGuild();
|
|
if (guild != null) {
|
|
callEventsButtonView.setVisibility(!hasLiveEvent ? 0 : 8);
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
callEventsButtonView.a(parentFragmentManager, guild.getId(), getChannelId(), valid.getCallModel().getGuildScheduledEvents());
|
|
VoiceCallActiveEventView voiceCallActiveEventView = getBinding().f2232x;
|
|
m.checkNotNullExpressionValue(voiceCallActiveEventView, "binding.toolbarVoiceActiveEvent");
|
|
if (valid.getStageCallModel() == null) {
|
|
}
|
|
z2 = false;
|
|
voiceCallActiveEventView.setVisibility(z2 ? 0 : 8);
|
|
StageCallVisitCommunityView stageCallVisitCommunityView = getBinding().q;
|
|
m.checkNotNullExpressionValue(stageCallVisitCommunityView, "binding.callVisitCommunity");
|
|
StageCallModel stageCallModel = valid.getStageCallModel();
|
|
guild2 = valid.getStageCallModel().getGuild();
|
|
if (guild2 != null) {
|
|
}
|
|
if (z4) {
|
|
}
|
|
z3 = false;
|
|
if (!z3) {
|
|
}
|
|
stageCallVisitCommunityView.setVisibility(i2);
|
|
int color = ColorCompat.getColor(this, (int) R.color.transparent);
|
|
titleText = valid.getTitleText();
|
|
if (titleText == null) {
|
|
}
|
|
setActionBarTitle(titleText);
|
|
setActionBarTitleColor(-1);
|
|
ViewExtensions.fadeBy(getBinding().c, valid.getShowControls(), 200);
|
|
ColorCompat.setStatusBarTranslucent(this);
|
|
ColorCompat.setStatusBarColor((Fragment) this, color, true);
|
|
}
|
|
callEventsButtonView.setVisibility(!hasLiveEvent ? 0 : 8);
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
callEventsButtonView.a(parentFragmentManager, guild.getId(), getChannelId(), valid.getCallModel().getGuildScheduledEvents());
|
|
VoiceCallActiveEventView voiceCallActiveEventView = getBinding().f2232x;
|
|
m.checkNotNullExpressionValue(voiceCallActiveEventView, "binding.toolbarVoiceActiveEvent");
|
|
if (valid.getStageCallModel() == null) {
|
|
}
|
|
z2 = false;
|
|
voiceCallActiveEventView.setVisibility(z2 ? 0 : 8);
|
|
StageCallVisitCommunityView stageCallVisitCommunityView = getBinding().q;
|
|
m.checkNotNullExpressionValue(stageCallVisitCommunityView, "binding.callVisitCommunity");
|
|
StageCallModel stageCallModel = valid.getStageCallModel();
|
|
guild2 = valid.getStageCallModel().getGuild();
|
|
if (guild2 != null) {
|
|
}
|
|
if (z4) {
|
|
}
|
|
z3 = false;
|
|
if (!z3) {
|
|
}
|
|
stageCallVisitCommunityView.setVisibility(i2);
|
|
int color = ColorCompat.getColor(this, (int) R.color.transparent);
|
|
titleText = valid.getTitleText();
|
|
if (titleText == null) {
|
|
}
|
|
setActionBarTitle(titleText);
|
|
setActionBarTitleColor(-1);
|
|
ViewExtensions.fadeBy(getBinding().c, valid.getShowControls(), 200);
|
|
ColorCompat.setStatusBarTranslucent(this);
|
|
ColorCompat.setStatusBarColor((Fragment) this, color, true);
|
|
}
|
|
i = R.drawable.ic_call_toolbar_icon_minimize;
|
|
toolbar.setNavigationIcon(ContextCompat.getDrawable(requireContext, i));
|
|
getBinding().f2230b.setNavigationOnClickListener(new WidgetCallFullscreen$configureActionBar$1(this, valid));
|
|
CallEventsButtonView callEventsButtonView = getBinding().w;
|
|
guild = valid.getCallModel().getGuild();
|
|
if (guild != null) {
|
|
}
|
|
callEventsButtonView.setVisibility(!hasLiveEvent ? 0 : 8);
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
callEventsButtonView.a(parentFragmentManager, guild.getId(), getChannelId(), valid.getCallModel().getGuildScheduledEvents());
|
|
VoiceCallActiveEventView voiceCallActiveEventView = getBinding().f2232x;
|
|
m.checkNotNullExpressionValue(voiceCallActiveEventView, "binding.toolbarVoiceActiveEvent");
|
|
if (valid.getStageCallModel() == null) {
|
|
}
|
|
z2 = false;
|
|
voiceCallActiveEventView.setVisibility(z2 ? 0 : 8);
|
|
StageCallVisitCommunityView stageCallVisitCommunityView = getBinding().q;
|
|
m.checkNotNullExpressionValue(stageCallVisitCommunityView, "binding.callVisitCommunity");
|
|
StageCallModel stageCallModel = valid.getStageCallModel();
|
|
guild2 = valid.getStageCallModel().getGuild();
|
|
if (guild2 != null) {
|
|
}
|
|
if (z4) {
|
|
}
|
|
z3 = false;
|
|
if (!z3) {
|
|
}
|
|
stageCallVisitCommunityView.setVisibility(i2);
|
|
int color = ColorCompat.getColor(this, (int) R.color.transparent);
|
|
titleText = valid.getTitleText();
|
|
if (titleText == null) {
|
|
}
|
|
setActionBarTitle(titleText);
|
|
setActionBarTitleColor(-1);
|
|
ViewExtensions.fadeBy(getBinding().c, valid.getShowControls(), 200);
|
|
ColorCompat.setStatusBarTranslucent(this);
|
|
ColorCompat.setStatusBarColor((Fragment) this, color, true);
|
|
}
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:23:0x0109, code lost:
|
|
if ((r1.getVisibility() == 0) == false) goto L_0x010e;
|
|
*/
|
|
private final void configureBottomControls(WidgetCallFullscreenViewModel.ViewState.Valid valid) {
|
|
VoiceControlsSheetView voiceControlsSheetView = getBinding().f2233y;
|
|
m.checkNotNullExpressionValue(voiceControlsSheetView, "binding.voiceControlsSheetView");
|
|
voiceControlsSheetView.setVisibility(0);
|
|
VoiceControlsSheetView voiceControlsSheetView2 = getBinding().f2233y;
|
|
CallModel callModel = valid.getCallModel();
|
|
VoiceControlsOutputSelectorState outputSelectorState = valid.getOutputSelectorState();
|
|
boolean z2 = true;
|
|
boolean z3 = valid.getCameraState() != CameraState.CAMERA_DISABLED;
|
|
voiceControlsSheetView2.m58configureUI3jxq49Y(callModel, outputSelectorState, z3, valid.isPushToTalk(), valid.isDeafened(), valid.getStartedAsVideo(), valid.isStreamFocused(), !valid.isStreamFocused(), new WidgetCallFullscreen$configureBottomControls$2(this), new WidgetCallFullscreen$configureBottomControls$1(this, valid), new WidgetCallFullscreen$configureBottomControls$3(this), new WidgetCallFullscreen$configureBottomControls$4(this), new WidgetCallFullscreen$configureBottomControls$5(this), new WidgetCallFullscreen$configureBottomControls$7(this, valid), new WidgetCallFullscreen$configureBottomControls$6(this, valid), valid.getShowStreamVolume(), valid.getPerceptualStreamVolume(), new WidgetCallFullscreen$configureBottomControls$8(this), new WidgetCallFullscreen$configureBottomControls$9(this), valid.getRequestingToSpeakCount(), new WidgetCallFullscreen$configureBottomControls$10(this, valid), new WidgetCallFullscreen$configureBottomControls$11(this), valid.isUpdatingRequestToSpeak(), valid.m66getStageRolestwRsX0());
|
|
configureSwipeTooltip(valid.getStageCallModel() == null && valid.getShowControls());
|
|
if (!valid.isVideoCallGridVisible()) {
|
|
VoiceControlsSheetView voiceControlsSheetView3 = getBinding().f2233y;
|
|
m.checkNotNullExpressionValue(voiceControlsSheetView3, "binding.voiceControlsSheetView");
|
|
ViewExtensions.cancelFadeAnimations(voiceControlsSheetView3);
|
|
VoiceControlsSheetView voiceControlsSheetView4 = getBinding().f2233y;
|
|
m.checkNotNullExpressionValue(voiceControlsSheetView4, "binding.voiceControlsSheetView");
|
|
voiceControlsSheetView4.setAlpha(1.0f);
|
|
} else if (valid.getShowControls()) {
|
|
showControls();
|
|
} else {
|
|
hideControls();
|
|
}
|
|
MaterialButton materialButton = getBinding().g;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.callFloatingPushToTalk");
|
|
if (valid.isPushToTalk()) {
|
|
VoiceControlsSheetView voiceControlsSheetView5 = getBinding().f2233y;
|
|
m.checkNotNullExpressionValue(voiceControlsSheetView5, "binding.voiceControlsSheetView");
|
|
}
|
|
z2 = false;
|
|
materialButton.setVisibility(z2 ? 0 : 8);
|
|
}
|
|
|
|
private final void configureConnectionStatusText(CallModel callModel) {
|
|
Subscription subscription = this.connectedTimerSubscription;
|
|
if (subscription == null || subscription.isUnsubscribed()) {
|
|
Observable<Long> D = Observable.D(0, 1, TimeUnit.SECONDS);
|
|
m.checkNotNullExpressionValue(D, "Observable\n .in…0L, 1L, TimeUnit.SECONDS)");
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(D, this, null, 2, null), WidgetCallFullscreen.class, (Context) null, new WidgetCallFullscreen$configureConnectionStatusText$2(this), (Function1) null, (Function0) null, (Function0) null, new WidgetCallFullscreen$configureConnectionStatusText$1(this, callModel), 58, (Object) null);
|
|
}
|
|
}
|
|
|
|
private final void configureEventPrompt(WidgetCallFullscreenViewModel.ViewState.Valid valid) {
|
|
Guild guild = valid.getCallModel().getGuild();
|
|
WidgetCallFullscreen$configureEventPrompt$onCreateEventClick$1 widgetCallFullscreen$configureEventPrompt$onCreateEventClick$1 = new WidgetCallFullscreen$configureEventPrompt$onCreateEventClick$1(this, guild);
|
|
GuildScheduledEvent startableEvent = valid.getStartableEvent();
|
|
WidgetCallFullscreen$configureEventPrompt$onStartEvent$1 widgetCallFullscreen$configureEventPrompt$onStartEvent$1 = new WidgetCallFullscreen$configureEventPrompt$onStartEvent$1(this, startableEvent);
|
|
WidgetCallFullscreen$configureEventPrompt$onStartStage$1 widgetCallFullscreen$configureEventPrompt$onStartStage$1 = new WidgetCallFullscreen$configureEventPrompt$onStartStage$1(this);
|
|
GuildEventPromptListView guildEventPromptListView = (GuildEventPromptListView) getEventPromptOverlay().getMaybeView();
|
|
if (guildEventPromptListView != null) {
|
|
GuildEventPromptListView.ScheduledEventData scheduledEventData = (startableEvent != null && GuildScheduledEventUtilities.Companion.canStartEventInChannel(valid.getCallModel().getChannel(), valid.getChannelPermissions())) ? new GuildEventPromptListView.ScheduledEventData(startableEvent, widgetCallFullscreen$configureEventPrompt$onStartEvent$1) : null;
|
|
if (guild == null || valid.getStageCallModel() == null || !StageEventsGuildsFeatureFlag.Companion.getINSTANCE().canGuildAccessStageEvents(guild.getId()) || !PermissionUtils.can(Permission.START_STAGE_EVENT, valid.getChannelPermissions())) {
|
|
widgetCallFullscreen$configureEventPrompt$onCreateEventClick$1 = null;
|
|
}
|
|
if (valid.getStageCallModel() == null || !StageRoles.m26isModeratorimpl(valid.getStageCallModel().m36getMyStageRoles1LxfuJo())) {
|
|
widgetCallFullscreen$configureEventPrompt$onStartStage$1 = null;
|
|
}
|
|
guildEventPromptListView.configure(scheduledEventData, widgetCallFullscreen$configureEventPrompt$onCreateEventClick$1, widgetCallFullscreen$configureEventPrompt$onStartStage$1);
|
|
}
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:54:0x019d */
|
|
/* JADX WARNING: Removed duplicated region for block: B:57:0x01a7 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:60:0x01b0 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:61:0x01b2 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:64:0x01bd */
|
|
/* JADX WARNING: Removed duplicated region for block: B:65:0x01bf */
|
|
/* JADX WARNING: Removed duplicated region for block: B:68:0x01c4 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:79:0x01f9 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:82:0x0214 */
|
|
private final void configureGridUi(WidgetCallFullscreenViewModel.ViewState.Valid valid) {
|
|
boolean z2;
|
|
VideoCallGridAdapter videoCallGridAdapter;
|
|
VideoCallGridAdapter videoCallGridAdapter2;
|
|
FragmentActivity requireActivity = requireActivity();
|
|
m.checkNotNullExpressionValue(requireActivity, "requireActivity()");
|
|
requireActivity.setRequestedOrientation(-1);
|
|
RelativeLayout relativeLayout = getBinding().f2231s.d;
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.privateCall.privateCallContainer");
|
|
int i = 8;
|
|
relativeLayout.setVisibility(8);
|
|
RecyclerView recyclerView = getBinding().m;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callStageRecycler");
|
|
recyclerView.setVisibility(8);
|
|
ConstraintLayout constraintLayout = getBinding().t;
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.stageCallSpeakingChip");
|
|
constraintLayout.setVisibility(8);
|
|
getBinding().j.setOnClickListener(new WidgetCallFullscreen$configureGridUi$1(this));
|
|
LinearLayout linearLayout = getBinding().j;
|
|
m.checkNotNullExpressionValue(linearLayout, "binding.callParticipantsHidden");
|
|
linearLayout.setVisibility(valid.getShowParticipantsHiddenView() ? 0 : 8);
|
|
getBinding().o.setOnClickListener(new WidgetCallFullscreen$configureGridUi$2(this));
|
|
ConstraintLayout constraintLayout2 = getBinding().o;
|
|
m.checkNotNullExpressionValue(constraintLayout2, "binding.callStreamingActive");
|
|
constraintLayout2.setVisibility(valid.getCallModel().isStreaming() ? 0 : 8);
|
|
MaterialButton materialButton = getBinding().n;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.callStopStreamingButton");
|
|
Resources resources = getResources();
|
|
m.checkNotNullExpressionValue(resources, "resources");
|
|
boolean z3 = true;
|
|
materialButton.setVisibility(resources.getConfiguration().orientation != 2 ? 0 : 8);
|
|
getBinding().n.setOnClickListener(new WidgetCallFullscreen$configureGridUi$3(this));
|
|
getBinding().k.setOnClickListener(new WidgetCallFullscreen$configureGridUi$4(this));
|
|
RecyclerView recyclerView2 = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView2, "binding.callVideoRecycler");
|
|
boolean z4 = recyclerView2.getVisibility() == 0;
|
|
if (valid.isVideoCallGridVisible() != z4) {
|
|
RecyclerView recyclerView3 = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView3, "binding.callVideoRecycler");
|
|
recyclerView3.setVisibility(valid.isVideoCallGridVisible() ? 0 : 8);
|
|
if (valid.isVideoCallGridVisible() && !z4) {
|
|
RecyclerView recyclerView4 = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView4, "binding.callVideoRecycler");
|
|
recyclerView4.setVisibility(valid.isVideoCallGridVisible() ? 0 : 8);
|
|
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
|
|
alphaAnimation.setDuration(250);
|
|
getBinding().p.startAnimation(alphaAnimation);
|
|
}
|
|
}
|
|
VideoCallParticipantView videoCallParticipantView = getBinding().l;
|
|
m.checkNotNullExpressionValue(videoCallParticipantView, "binding.callPip");
|
|
videoCallParticipantView.setVisibility(valid.getPipParticipant() != null ? 0 : 8);
|
|
VideoCallParticipantView videoCallParticipantView2 = getBinding().l;
|
|
CallParticipant.UserOrStreamParticipant pipParticipant = valid.getPipParticipant();
|
|
VideoCallParticipantView.d(videoCallParticipantView2, pipParticipant != null ? pipParticipant.getParticipantData() : null, null, false, null, false, 30);
|
|
View view = getBinding().e.f145b;
|
|
m.checkNotNullExpressionValue(view, "binding.audioShare.callStreamingAudioShareWarning");
|
|
if (!VoiceViewUtils.INSTANCE.getIsSoundshareSupported()) {
|
|
VideoCallParticipantView videoCallParticipantView3 = getBinding().l;
|
|
m.checkNotNullExpressionValue(videoCallParticipantView3, "binding.callPip");
|
|
if (!(videoCallParticipantView3.getVisibility() == 0)) {
|
|
z2 = true;
|
|
if (z2) {
|
|
i = 0;
|
|
}
|
|
view.setVisibility(i);
|
|
videoCallGridAdapter = this.gridAdapter;
|
|
if (videoCallGridAdapter == null) {
|
|
m.throwUninitializedPropertyAccessException("gridAdapter");
|
|
}
|
|
boolean z5 = videoCallGridAdapter.getItemCount() != 1;
|
|
boolean z6 = valid.getVisibleVideoParticipants().size() != 1;
|
|
videoCallGridAdapter2 = this.gridAdapter;
|
|
if (videoCallGridAdapter2 == null) {
|
|
m.throwUninitializedPropertyAccessException("gridAdapter");
|
|
}
|
|
videoCallGridAdapter2.setData(valid.getVisibleVideoParticipants());
|
|
if (z5 && !z6) {
|
|
getBinding().p.scrollToPosition(0);
|
|
}
|
|
configureMenu(valid);
|
|
configureActionBar(valid);
|
|
if (valid.getStartableEvent() == null || GuildScheduledEventUtilitiesKt.hasLiveEvent(valid.getCallModel().getGuildScheduledEvents())) {
|
|
z3 = false;
|
|
}
|
|
if (!z3) {
|
|
ViewExtensions.fadeBy(getEventPromptOverlay().getForceInitializedView(), valid.getShowControls(), 200);
|
|
if (valid.getShowControls()) {
|
|
configureEventPrompt(valid);
|
|
}
|
|
} else {
|
|
getEventPromptOverlay().setVisible(false);
|
|
}
|
|
WidgetEndGuildScheduledEventBottomSheet.Companion.registerForResult(this, END_EVENT_REQUEST_KEY, new WidgetCallFullscreen$configureGridUi$5(this, valid));
|
|
enableWakeLock();
|
|
}
|
|
}
|
|
z2 = false;
|
|
if (z2) {
|
|
}
|
|
view.setVisibility(i);
|
|
videoCallGridAdapter = this.gridAdapter;
|
|
if (videoCallGridAdapter == null) {
|
|
}
|
|
if (videoCallGridAdapter.getItemCount() != 1) {
|
|
}
|
|
if (valid.getVisibleVideoParticipants().size() != 1) {
|
|
}
|
|
videoCallGridAdapter2 = this.gridAdapter;
|
|
if (videoCallGridAdapter2 == null) {
|
|
}
|
|
videoCallGridAdapter2.setData(valid.getVisibleVideoParticipants());
|
|
getBinding().p.scrollToPosition(0);
|
|
configureMenu(valid);
|
|
configureActionBar(valid);
|
|
z3 = false;
|
|
if (!z3) {
|
|
}
|
|
WidgetEndGuildScheduledEventBottomSheet.Companion.registerForResult(this, END_EVENT_REQUEST_KEY, new WidgetCallFullscreen$configureGridUi$5(this, valid));
|
|
enableWakeLock();
|
|
}
|
|
|
|
private final void configureMenu(WidgetCallFullscreenViewModel.ViewState.Valid valid) {
|
|
if (m.areEqual(valid.getMenuItems(), this.lastMenuItems)) {
|
|
int textInVoiceMentionCount = valid.getTextInVoiceMentionCount();
|
|
Integer num = this.lastMentionsCount;
|
|
if (num != null && textInVoiceMentionCount == num.intValue()) {
|
|
int textInVoiceUnreadCount = valid.getTextInVoiceUnreadCount();
|
|
Integer num2 = this.lastUnreadsCount;
|
|
if (num2 != null && textInVoiceUnreadCount == num2.intValue()) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
this.lastMenuItems = valid.getMenuItems();
|
|
this.lastMentionsCount = Integer.valueOf(valid.getTextInVoiceMentionCount());
|
|
this.lastUnreadsCount = Integer.valueOf(valid.getTextInVoiceUnreadCount());
|
|
setActionBarOptionsMenu(R.menu.menu_call_fullscreen, new WidgetCallFullscreen$configureMenu$1(this, valid), new WidgetCallFullscreen$configureMenu$2(this, valid));
|
|
}
|
|
|
|
private final void configurePrivateCallParticipantsUi(WidgetCallFullscreenViewModel.ViewState.Valid valid) {
|
|
String str;
|
|
LinearLayout linearLayout = getBinding().j;
|
|
m.checkNotNullExpressionValue(linearLayout, "binding.callParticipantsHidden");
|
|
int i = 0;
|
|
linearLayout.setVisibility(valid.getShowParticipantsHiddenView() ? 0 : 8);
|
|
RelativeLayout relativeLayout = getBinding().f2231s.d;
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.privateCall.privateCallContainer");
|
|
relativeLayout.setVisibility(0);
|
|
getBinding().f2231s.f152b.configure(valid.getPrivateCallUserListItems());
|
|
TextView textView = getBinding().f2231s.c;
|
|
m.checkNotNullExpressionValue(textView, "binding.privateCall.priv…CallConnectivityStatusBar");
|
|
if (!valid.getShowLowConnectivityBar()) {
|
|
i = 8;
|
|
}
|
|
textView.setVisibility(i);
|
|
getBinding().f2231s.f.configure(valid.getPrivateCallUserListItems());
|
|
VideoCallParticipantView videoCallParticipantView = getBinding().l;
|
|
m.checkNotNullExpressionValue(videoCallParticipantView, "binding.callPip");
|
|
videoCallParticipantView.setVisibility(8);
|
|
RecyclerView recyclerView = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callVideoRecycler");
|
|
recyclerView.setVisibility(8);
|
|
RecyclerView recyclerView2 = getBinding().m;
|
|
m.checkNotNullExpressionValue(recyclerView2, "binding.callStageRecycler");
|
|
recyclerView2.setVisibility(8);
|
|
ConstraintLayout constraintLayout = getBinding().t;
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.stageCallSpeakingChip");
|
|
constraintLayout.setVisibility(8);
|
|
configureMenu(valid);
|
|
configureActionBar(valid);
|
|
enableWakeLock();
|
|
getBinding().f2231s.i.setText(valid.getCallModel().isConnected() ? R.string.ongoing_call : R.string.voice_status_not_connected);
|
|
TextView textView2 = getBinding().f2231s.h;
|
|
m.checkNotNullExpressionValue(textView2, "binding.privateCall.privateCallStatusPrimary");
|
|
if (ChannelUtils.w(valid.getCallModel().getChannel())) {
|
|
str = ChannelUtils.c(valid.getCallModel().getChannel());
|
|
} else {
|
|
StoreVoiceParticipants.VoiceUser dmRecipient = valid.getCallModel().getDmRecipient();
|
|
str = dmRecipient != null ? dmRecipient.getDisplayName() : null;
|
|
}
|
|
textView2.setText(str);
|
|
configureConnectionStatusText(valid.getCallModel());
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:29:0x00e2 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:32:0x00e7 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:35:0x00f4 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:43:0x018e */
|
|
/* JADX WARNING: Removed duplicated region for block: B:49:0x01cf */
|
|
/* JADX WARNING: Removed duplicated region for block: B:52:0x01df */
|
|
/* JADX WARNING: Removed duplicated region for block: B:53:0x0215 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:67:0x027a */
|
|
/* JADX WARNING: Removed duplicated region for block: B:70:0x0295 */
|
|
private final void configureStageUi(WidgetCallFullscreenViewModel.ViewState.Valid valid) {
|
|
boolean z2;
|
|
ArrayList arrayList;
|
|
boolean isEmpty;
|
|
StageCallAdapter stageCallAdapter;
|
|
boolean z3;
|
|
StageCallModel stageCallModel = valid.getStageCallModel();
|
|
if (stageCallModel != null) {
|
|
if (getViewModel().getShowStageCallBottomSheet()) {
|
|
WidgetCallFullscreenViewModel viewModel = getViewModel();
|
|
StageCallBottomSheetManager stageCallBottomSheetManager = this.stageCallBottomSheetManager;
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
viewModel.setShowStageCallBottomSheet(!stageCallBottomSheetManager.configureBottomSheet(parentFragmentManager, valid.getCallModel().getChannel()));
|
|
}
|
|
RecyclerView recyclerView = getBinding().m;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callStageRecycler");
|
|
boolean z4 = false;
|
|
recyclerView.setVisibility(0);
|
|
RelativeLayout relativeLayout = getBinding().f2231s.d;
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.privateCall.privateCallContainer");
|
|
int i = 8;
|
|
relativeLayout.setVisibility(8);
|
|
VideoCallParticipantView videoCallParticipantView = getBinding().l;
|
|
m.checkNotNullExpressionValue(videoCallParticipantView, "binding.callPip");
|
|
videoCallParticipantView.setVisibility(8);
|
|
RecyclerView recyclerView2 = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView2, "binding.callVideoRecycler");
|
|
recyclerView2.setVisibility(8);
|
|
if (StageRoles.m26isModeratorimpl(stageCallModel.m36getMyStageRoles1LxfuJo())) {
|
|
boolean z5 = stageCallModel.getStageInstance() == null;
|
|
getEventPromptOverlay().setVisible(z5);
|
|
if (z5) {
|
|
configureEventPrompt(valid);
|
|
}
|
|
} else {
|
|
getEventPromptOverlay().setVisible(false);
|
|
}
|
|
Channel channel = valid.getCallModel().getChannel();
|
|
List<StoreVoiceParticipants.VoiceUser> speakingVoiceUsers = stageCallModel.getSpeakingVoiceUsers();
|
|
ConstraintLayout constraintLayout = getBinding().t;
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.stageCallSpeakingChip");
|
|
if (!speakingVoiceUsers.isEmpty()) {
|
|
if (!(speakingVoiceUsers instanceof Collection) || !speakingVoiceUsers.isEmpty()) {
|
|
Iterator<T> it = speakingVoiceUsers.iterator();
|
|
while (true) {
|
|
if (it.hasNext()) {
|
|
if (!isStageUserVisible(((StoreVoiceParticipants.VoiceUser) it.next()).getUser().getId())) {
|
|
z3 = true;
|
|
break;
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
if (z3) {
|
|
z2 = true;
|
|
if (z2) {
|
|
i = 0;
|
|
}
|
|
constraintLayout.setVisibility(i);
|
|
if (!speakingVoiceUsers.isEmpty()) {
|
|
UserSummaryView userSummaryView = getBinding().u;
|
|
ArrayList arrayList2 = new ArrayList(o.collectionSizeOrDefault(speakingVoiceUsers, 10));
|
|
for (StoreVoiceParticipants.VoiceUser voiceUser : speakingVoiceUsers) {
|
|
arrayList2.add(new UserGuildMember(voiceUser.getUser(), voiceUser.getGuildMember()));
|
|
}
|
|
userSummaryView.setMembers(arrayList2);
|
|
MaterialTextView materialTextView = getBinding().v;
|
|
m.checkNotNullExpressionValue(materialTextView, "binding.stageCallSpeakingUserSummaryLabel");
|
|
Resources resources = getResources();
|
|
m.checkNotNullExpressionValue(resources, "resources");
|
|
materialTextView.setText(b.e(this, R.string.stage_is_speaking_hook, new Object[]{speakingVoiceUsers.get(0).getDisplayName(), StringResourceUtilsKt.getQuantityString(resources, (int) R.plurals.stage_is_speaking_hook_count, (int) R.string.stage_is_speaking_zero_quantity_hook, speakingVoiceUsers.size() - 1, Integer.valueOf(speakingVoiceUsers.size() - 1))}, new WidgetCallFullscreen$configureStageUi$3(this)));
|
|
}
|
|
List<StageMediaParticipant> mediaParticipants = stageCallModel.getMediaParticipants();
|
|
ArrayList arrayList3 = new ArrayList(o.collectionSizeOrDefault(mediaParticipants, 10));
|
|
for (StageMediaParticipant stageMediaParticipant : mediaParticipants) {
|
|
CallParticipant.UserOrStreamParticipant userOrStreamParticipant = valid.getAllVideoParticipants().get(stageMediaParticipant.getId());
|
|
if (userOrStreamParticipant != null) {
|
|
arrayList3.add(new StageCallItem.MediaItem(stageMediaParticipant.getVoiceUser(), stageMediaParticipant.getChannel(), stageMediaParticipant.isModerator(), stageMediaParticipant.isBlocked(), stageMediaParticipant.getMediaType(), userOrStreamParticipant));
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
arrayList = new ArrayList();
|
|
if (stageCallModel.getNumSpeakers() > 0) {
|
|
z4 = true;
|
|
}
|
|
isEmpty = true ^ stageCallModel.getAudience().isEmpty();
|
|
if (stageCallModel.getStageInstance() == null) {
|
|
arrayList.add(new StageCallItem.DetailsItem(stageCallModel.getStageInstance().f(), ChannelUtils.c(channel), valid.getCallModel().getNumUsersConnected(), stageCallModel.getNumSpeakers(), stageCallModel.getAudience().size(), stageCallModel.getNumBlockedUsers(), d.W0(stageCallModel.getStageInstance())));
|
|
} else {
|
|
String string = StageRoles.m26isModeratorimpl(stageCallModel.m36getMyStageRoles1LxfuJo()) ? getString(R.string.stage_start_prompt_title_moderator) : getString(R.string.stage_start_prompt_title);
|
|
m.checkNotNullExpressionValue(string, "when {\n s…pt_title)\n }");
|
|
String string2 = StageRoles.m26isModeratorimpl(stageCallModel.m36getMyStageRoles1LxfuJo()) ? getString(R.string.stage_start_prompt_subtitle_mobile_moderator) : getString(R.string.stage_start_prompt_subtitle_mobile);
|
|
m.checkNotNullExpressionValue(string2, "when {\n s…e_mobile)\n }");
|
|
arrayList.add(new StageCallItem.PreStartDetailsItem(string, string2, stageCallModel.getNumSpeakers(), stageCallModel.getAudience().size()));
|
|
}
|
|
arrayList.addAll(arrayList3);
|
|
arrayList.addAll(stageCallModel.getSpeakerItems());
|
|
if (z4 && isEmpty) {
|
|
arrayList.add(StageCallItem.DividerItem.INSTANCE);
|
|
}
|
|
if (isEmpty) {
|
|
arrayList.add(new StageCallItem.AudienceHeaderItem(stageCallModel.getAudience().size()));
|
|
arrayList.addAll(stageCallModel.getAudience());
|
|
}
|
|
stageCallAdapter = this.stageAdapter;
|
|
if (stageCallAdapter == null) {
|
|
m.throwUninitializedPropertyAccessException("stageAdapter");
|
|
}
|
|
stageCallAdapter.setData(arrayList, stageCallModel.getSpeakerItems().size());
|
|
configureMenu(valid);
|
|
configureActionBar(valid);
|
|
enableWakeLock();
|
|
WidgetEndStageBottomSheet.Companion.registerForResult(this, END_STAGE_REQUEST_KEY, new WidgetCallFullscreen$configureStageUi$4(this, valid));
|
|
}
|
|
}
|
|
z3 = false;
|
|
if (z3) {
|
|
}
|
|
}
|
|
z2 = false;
|
|
if (z2) {
|
|
}
|
|
constraintLayout.setVisibility(i);
|
|
if (!speakingVoiceUsers.isEmpty()) {
|
|
}
|
|
List<StageMediaParticipant> mediaParticipants = stageCallModel.getMediaParticipants();
|
|
ArrayList arrayList3 = new ArrayList(o.collectionSizeOrDefault(mediaParticipants, 10));
|
|
while (r5.hasNext()) {
|
|
}
|
|
arrayList = new ArrayList();
|
|
if (stageCallModel.getNumSpeakers() > 0) {
|
|
}
|
|
isEmpty = true ^ stageCallModel.getAudience().isEmpty();
|
|
if (stageCallModel.getStageInstance() == null) {
|
|
}
|
|
arrayList.addAll(arrayList3);
|
|
arrayList.addAll(stageCallModel.getSpeakerItems());
|
|
arrayList.add(StageCallItem.DividerItem.INSTANCE);
|
|
if (isEmpty) {
|
|
}
|
|
stageCallAdapter = this.stageAdapter;
|
|
if (stageCallAdapter == null) {
|
|
}
|
|
stageCallAdapter.setData(arrayList, stageCallModel.getSpeakerItems().size());
|
|
configureMenu(valid);
|
|
configureActionBar(valid);
|
|
enableWakeLock();
|
|
WidgetEndStageBottomSheet.Companion.registerForResult(this, END_STAGE_REQUEST_KEY, new WidgetCallFullscreen$configureStageUi$4(this, valid));
|
|
}
|
|
}
|
|
|
|
private final void configureSwipeTooltip(boolean z2) {
|
|
ViewBinding viewBinding;
|
|
if (z2) {
|
|
DefaultTooltipCreator defaultTooltipCreator = this.defaultTooltipCreator;
|
|
VoiceControlsSheetView voiceControlsSheetView = getBinding().f2233y;
|
|
m.checkNotNullExpressionValue(voiceControlsSheetView, "binding.voiceControlsSheetView");
|
|
VoiceControlsSheetSwipeTooltip voiceControlsSheetSwipeTooltip = VoiceControlsSheetSwipeTooltip.INSTANCE;
|
|
String string = getResources().getString(R.string.voice_controls_sheet_tooltip_swipe_up);
|
|
m.checkNotNullExpressionValue(string, "resources.getString(R.st…s_sheet_tooltip_swipe_up)");
|
|
int dpToPixels = DimenUtils.dpToPixels(-12);
|
|
Observable<Unit> F = getUnsubscribeSignal().F(WidgetCallFullscreen$configureSwipeTooltip$1.INSTANCE);
|
|
m.checkNotNullExpressionValue(F, "this.unsubscribeSignal.map { }");
|
|
FloatingViewGravity floatingViewGravity = FloatingViewGravity.TOP;
|
|
Objects.requireNonNull(defaultTooltipCreator);
|
|
m.checkNotNullParameter(voiceControlsSheetView, "anchorView");
|
|
m.checkNotNullParameter(string, "tooltipText");
|
|
m.checkNotNullParameter(voiceControlsSheetSwipeTooltip, "tooltip");
|
|
m.checkNotNullParameter(floatingViewGravity, "tooltipGravity");
|
|
m.checkNotNullParameter(F, "componentPausedObservable");
|
|
if (defaultTooltipCreator.a.b(voiceControlsSheetSwipeTooltip, true)) {
|
|
LayoutInflater from = LayoutInflater.from(voiceControlsSheetView.getContext());
|
|
if (floatingViewGravity == floatingViewGravity) {
|
|
View rootView = voiceControlsSheetView.getRootView();
|
|
Objects.requireNonNull(rootView, "null cannot be cast to non-null type android.view.ViewGroup");
|
|
View inflate = from.inflate(R.layout.default_tooltip_view_top, (ViewGroup) rootView, false);
|
|
TextView textView = (TextView) inflate.findViewById(R.id.default_tooltip_text);
|
|
if (textView != null) {
|
|
viewBinding = new j((ConstraintLayout) inflate, textView);
|
|
m.checkNotNullExpressionValue(textView, "defaultTooltipText");
|
|
textView.setText(string);
|
|
m.checkNotNullExpressionValue(viewBinding, "DefaultTooltipViewTopBin…ext = tooltipText\n }");
|
|
} else {
|
|
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(R.id.default_tooltip_text)));
|
|
}
|
|
} else {
|
|
View rootView2 = voiceControlsSheetView.getRootView();
|
|
Objects.requireNonNull(rootView2, "null cannot be cast to non-null type android.view.ViewGroup");
|
|
View inflate2 = from.inflate(R.layout.default_tooltip_view_bottom, (ViewGroup) rootView2, false);
|
|
TextView textView2 = (TextView) inflate2.findViewById(R.id.default_tooltip_text);
|
|
if (textView2 != null) {
|
|
viewBinding = new i((ConstraintLayout) inflate2, textView2);
|
|
m.checkNotNullExpressionValue(textView2, "defaultTooltipText");
|
|
textView2.setText(string);
|
|
m.checkNotNullExpressionValue(viewBinding, "DefaultTooltipViewBottom…ext = tooltipText\n }");
|
|
} else {
|
|
throw new NullPointerException("Missing required view with ID: ".concat(inflate2.getResources().getResourceName(R.id.default_tooltip_text)));
|
|
}
|
|
}
|
|
viewBinding.getRoot().setOnClickListener(new b.a.v.b(defaultTooltipCreator, voiceControlsSheetSwipeTooltip));
|
|
TooltipManager tooltipManager = defaultTooltipCreator.a;
|
|
View root = viewBinding.getRoot();
|
|
m.checkNotNullExpressionValue(root, "tooltipView.root");
|
|
tooltipManager.d(voiceControlsSheetView, root, voiceControlsSheetSwipeTooltip, floatingViewGravity, 0, dpToPixels, true, F);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
this.tooltipManager.c(VoiceControlsSheetSwipeTooltip.INSTANCE);
|
|
}
|
|
|
|
private final void configureUI(WidgetCallFullscreenViewModel.ViewState viewState) {
|
|
if (m.areEqual(viewState, WidgetCallFullscreenViewModel.ViewState.Invalid.INSTANCE)) {
|
|
requireActivity().finish();
|
|
} else if (viewState instanceof WidgetCallFullscreenViewModel.ViewState.Valid) {
|
|
configureValidUI((WidgetCallFullscreenViewModel.ViewState.Valid) viewState);
|
|
}
|
|
}
|
|
|
|
private final void configureValidUI(WidgetCallFullscreenViewModel.ViewState.Valid valid) {
|
|
configureBottomControls(valid);
|
|
ConstraintLayout constraintLayout = getBinding().a;
|
|
int ordinal = valid.getDisplayMode().ordinal();
|
|
int i = R.color.primary_dark_800;
|
|
if (ordinal != 0) {
|
|
if (ordinal != 1) {
|
|
i = R.color.black;
|
|
}
|
|
} else if (!valid.isTextInVoiceEnabled()) {
|
|
ConstraintLayout constraintLayout2 = getBinding().a;
|
|
m.checkNotNullExpressionValue(constraintLayout2, "binding.root");
|
|
i = DrawableCompat.getThemedDrawableRes(constraintLayout2, (int) R.attr.colorBackgroundPrimary, 0);
|
|
}
|
|
constraintLayout.setBackgroundResource(i);
|
|
int ordinal2 = valid.getDisplayMode().ordinal();
|
|
if (ordinal2 == 0) {
|
|
configureGridUi(valid);
|
|
} else if (ordinal2 == 1) {
|
|
configureStageUi(valid);
|
|
} else if (ordinal2 == 2) {
|
|
configurePrivateCallParticipantsUi(valid);
|
|
}
|
|
}
|
|
|
|
private final void destroyAllRenderers(WidgetCallFullscreenBinding widgetCallFullscreenBinding) {
|
|
VideoCallParticipantView.d(widgetCallFullscreenBinding.l, null, null, false, null, false, 30);
|
|
RecyclerView recyclerView = widgetCallFullscreenBinding.p;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callVideoRecycler");
|
|
int childCount = recyclerView.getChildCount();
|
|
for (int i = 0; i < childCount; i++) {
|
|
View childAt = widgetCallFullscreenBinding.p.getChildAt(i);
|
|
if (childAt instanceof VideoCallParticipantView) {
|
|
VideoCallParticipantView.d((VideoCallParticipantView) childAt, null, null, false, null, false, 30);
|
|
}
|
|
}
|
|
}
|
|
|
|
private final void enableWakeLock() {
|
|
FragmentActivity requireActivity = requireActivity();
|
|
m.checkNotNullExpressionValue(requireActivity, "requireActivity()");
|
|
requireActivity.getWindow().addFlags(128);
|
|
}
|
|
|
|
private final void finishActivity(boolean z2, boolean z3) {
|
|
getViewModel().selectTextChannelAfterFinish();
|
|
if (z2) {
|
|
getViewModel().disconnect();
|
|
}
|
|
requireActivity().finish();
|
|
if (z3) {
|
|
requireAppActivity().overridePendingTransition(0, R.anim.anim_slide_out_down);
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void finishActivity$default(WidgetCallFullscreen widgetCallFullscreen, boolean z2, boolean z3, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
z2 = true;
|
|
}
|
|
widgetCallFullscreen.finishActivity(z2, z3);
|
|
}
|
|
|
|
private final WidgetCallFullscreenBinding getBinding() {
|
|
return (WidgetCallFullscreenBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
}
|
|
|
|
private final long getChannelId() {
|
|
return getMostRecentIntent().getLongExtra("com.discord.intent.extra.EXTRA_CHANNEL_ID", -1);
|
|
}
|
|
|
|
private final LazyViewStubDelegate getEventPromptOverlay() {
|
|
return (LazyViewStubDelegate) this.eventPromptOverlay$delegate.getValue();
|
|
}
|
|
|
|
private final WidgetCallFullscreenViewModel getViewModel() {
|
|
return (WidgetCallFullscreenViewModel) this.viewModel$delegate.getValue();
|
|
}
|
|
|
|
private final List<VideoCallParticipantView.ParticipantData> getVisibleParticipants(VideoCallGridLayoutManager videoCallGridLayoutManager) {
|
|
IntRange intRange = new IntRange(videoCallGridLayoutManager.findFirstVisibleItemPosition(), videoCallGridLayoutManager.findLastVisibleItemPosition());
|
|
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(intRange, 10));
|
|
Iterator<Integer> it = intRange.iterator();
|
|
while (it.hasNext()) {
|
|
View childAt = getBinding().p.getChildAt(((c0) it).nextInt());
|
|
arrayList.add(childAt instanceof VideoCallParticipantView ? ((VideoCallParticipantView) childAt).getData() : null);
|
|
}
|
|
return u.filterNotNull(arrayList);
|
|
}
|
|
|
|
private final void handleIdleStateChanged(WidgetCallFullscreenViewModel.Event.OnIdleStateChanged onIdleStateChanged) {
|
|
if (onIdleStateChanged.isIdle()) {
|
|
BottomSheetBehavior<VoiceControlsSheetView> bottomSheetBehavior = this.bottomSheetBehavior;
|
|
if (bottomSheetBehavior == null) {
|
|
m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
}
|
|
if (bottomSheetBehavior.getState() == 3) {
|
|
collapseBottomSheet();
|
|
}
|
|
}
|
|
}
|
|
|
|
private final void hideControls() {
|
|
ViewExtensions.fadeBy(getBinding().f2233y, false, 200);
|
|
VideoCallGridAdapter videoCallGridAdapter = this.gridAdapter;
|
|
if (videoCallGridAdapter == null) {
|
|
m.throwUninitializedPropertyAccessException("gridAdapter");
|
|
}
|
|
videoCallGridAdapter.notifyCallControlsVisibilityChanged(false);
|
|
FragmentActivity requireActivity = requireActivity();
|
|
m.checkNotNullExpressionValue(requireActivity, "requireActivity()");
|
|
Window window = requireActivity.getWindow();
|
|
m.checkNotNullExpressionValue(window, "requireActivity().window");
|
|
RecyclerView recyclerView = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callVideoRecycler");
|
|
m.checkNotNullParameter(window, "window");
|
|
m.checkNotNullParameter(recyclerView, "view");
|
|
if (Build.VERSION.SDK_INT >= 30) {
|
|
window.setDecorFitsSystemWindows(true);
|
|
}
|
|
recyclerView.setSystemUiVisibility(5894);
|
|
}
|
|
|
|
private final void initializeSystemUiListeners(ViewGroup viewGroup) {
|
|
ViewCompat.setOnApplyWindowInsetsListener(getBinding().f2233y, new WidgetCallFullscreen$initializeSystemUiListeners$1(this));
|
|
ViewCompat.setOnApplyWindowInsetsListener(getBinding().c, WidgetCallFullscreen$initializeSystemUiListeners$2.INSTANCE);
|
|
ViewCompat.setOnApplyWindowInsetsListener(getBinding().h, new WidgetCallFullscreen$initializeSystemUiListeners$3(this));
|
|
ViewCompat.setOnApplyWindowInsetsListener(getBinding().d, WidgetCallFullscreen$initializeSystemUiListeners$4.INSTANCE);
|
|
CoordinatorLayout coordinatorLayout = getBinding().f;
|
|
m.checkNotNullExpressionValue(coordinatorLayout, "binding.callControlsSheetContainer");
|
|
ViewExtensions.setForwardingWindowInsetsListener(coordinatorLayout);
|
|
ConstraintLayout constraintLayout = getBinding().i;
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.callNonVideoContainer");
|
|
ViewExtensions.setForwardingWindowInsetsListener(constraintLayout);
|
|
ViewCompat.setOnApplyWindowInsetsListener(viewGroup, new WidgetCallFullscreen$initializeSystemUiListeners$5(this));
|
|
}
|
|
|
|
private final boolean isPortraitMode() {
|
|
Resources resources = getResources();
|
|
m.checkNotNullExpressionValue(resources, "resources");
|
|
return resources.getConfiguration().orientation == 1;
|
|
}
|
|
|
|
private final boolean isStageUserVisible(long j) {
|
|
StoreVoiceParticipants.VoiceUser voiceUser;
|
|
User user;
|
|
RecyclerView recyclerView = getBinding().m;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callStageRecycler");
|
|
if (!(recyclerView.getVisibility() == 0)) {
|
|
return false;
|
|
}
|
|
GridLayoutManager gridLayoutManager = this.stageLayoutManager;
|
|
if (gridLayoutManager == null) {
|
|
m.throwUninitializedPropertyAccessException("stageLayoutManager");
|
|
}
|
|
int findFirstVisibleItemPosition = gridLayoutManager.findFirstVisibleItemPosition();
|
|
int findLastVisibleItemPosition = gridLayoutManager.findLastVisibleItemPosition();
|
|
if (findFirstVisibleItemPosition != -1 && findLastVisibleItemPosition != -1) {
|
|
StageCallAdapter stageCallAdapter = this.stageAdapter;
|
|
if (stageCallAdapter == null) {
|
|
m.throwUninitializedPropertyAccessException("stageAdapter");
|
|
}
|
|
if (findFirstVisibleItemPosition <= findLastVisibleItemPosition) {
|
|
while (true) {
|
|
StageCallItem item = stageCallAdapter.getItem(findFirstVisibleItemPosition);
|
|
if (!(item instanceof StageCallParticipantItem)) {
|
|
item = null;
|
|
}
|
|
StageCallParticipantItem stageCallParticipantItem = (StageCallParticipantItem) item;
|
|
if (stageCallParticipantItem == null || (voiceUser = stageCallParticipantItem.getVoiceUser()) == null || (user = voiceUser.getUser()) == null || user.getId() != j) {
|
|
if (findFirstVisibleItemPosition == findLastVisibleItemPosition) {
|
|
break;
|
|
}
|
|
findFirstVisibleItemPosition++;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static final void launch(Context context, long j, boolean z2, String str, AppTransitionActivity.Transition transition) {
|
|
Companion.launch(context, j, z2, str, transition);
|
|
}
|
|
|
|
private final void onViewBindingDestroy(WidgetCallFullscreenBinding widgetCallFullscreenBinding) {
|
|
BottomSheetBehavior<VoiceControlsSheetView> bottomSheetBehavior = this.bottomSheetBehavior;
|
|
if (bottomSheetBehavior == null) {
|
|
m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
}
|
|
bottomSheetBehavior.removeBottomSheetCallback(this.bottomSheetCallback);
|
|
destroyAllRenderers(widgetCallFullscreenBinding);
|
|
}
|
|
|
|
private final void setUpGridRecycler() {
|
|
VideoCallGridAdapter videoCallGridAdapter = new VideoCallGridAdapter(new WidgetCallFullscreen$setUpGridRecycler$1(this), new WidgetCallFullscreen$setUpGridRecycler$2(this), new WidgetCallFullscreen$setUpGridRecycler$3(this), new WidgetCallFullscreen$setUpGridRecycler$4(getViewModel()), new WidgetCallFullscreen$setUpGridRecycler$5(getViewModel()), 2);
|
|
this.gridAdapter = videoCallGridAdapter;
|
|
if (videoCallGridAdapter == null) {
|
|
m.throwUninitializedPropertyAccessException("gridAdapter");
|
|
}
|
|
videoCallGridAdapter.setHasStableIds(true);
|
|
Resources resources = getResources();
|
|
m.checkNotNullExpressionValue(resources, "resources");
|
|
int i = resources.getConfiguration().orientation != 2 ? 1 : 0;
|
|
WidgetCallFullscreen$setUpGridRecycler$layoutManager$1 widgetCallFullscreen$setUpGridRecycler$layoutManager$1 = new WidgetCallFullscreen$setUpGridRecycler$layoutManager$1(this, i);
|
|
WidgetCallFullscreen$setUpGridRecycler$layoutManager$2 widgetCallFullscreen$setUpGridRecycler$layoutManager$2 = new WidgetCallFullscreen$setUpGridRecycler$layoutManager$2(this);
|
|
RecyclerView recyclerView = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callVideoRecycler");
|
|
Context context = recyclerView.getContext();
|
|
m.checkNotNullExpressionValue(context, "binding.callVideoRecycler.context");
|
|
VideoCallGridLayoutManager videoCallGridLayoutManager = new VideoCallGridLayoutManager(widgetCallFullscreen$setUpGridRecycler$layoutManager$1, 2, widgetCallFullscreen$setUpGridRecycler$layoutManager$2, i, context);
|
|
getBinding().p.addOnScrollListener(new WidgetCallFullscreen$setUpGridRecycler$6(this, videoCallGridLayoutManager));
|
|
getBinding().p.addOnChildAttachStateChangeListener(new WidgetCallFullscreen$setUpGridRecycler$7(this));
|
|
VideoCallGridAdapter videoCallGridAdapter2 = this.gridAdapter;
|
|
if (videoCallGridAdapter2 == null) {
|
|
m.throwUninitializedPropertyAccessException("gridAdapter");
|
|
}
|
|
videoCallGridLayoutManager.setSpanSizeLookup(videoCallGridAdapter2.getSpanSizeLookup());
|
|
RecyclerView recyclerView2 = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView2, "binding.callVideoRecycler");
|
|
recyclerView2.setLayoutManager(videoCallGridLayoutManager);
|
|
RecyclerView recyclerView3 = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView3, "binding.callVideoRecycler");
|
|
recyclerView3.setItemAnimator(null);
|
|
RecyclerView recyclerView4 = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView4, "binding.callVideoRecycler");
|
|
VideoCallGridAdapter videoCallGridAdapter3 = this.gridAdapter;
|
|
if (videoCallGridAdapter3 == null) {
|
|
m.throwUninitializedPropertyAccessException("gridAdapter");
|
|
}
|
|
recyclerView4.setAdapter(videoCallGridAdapter3);
|
|
}
|
|
|
|
private final void setUpStageRecycler() {
|
|
MGRecyclerAdapter.Companion companion = MGRecyclerAdapter.Companion;
|
|
RecyclerView recyclerView = getBinding().m;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callStageRecycler");
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
this.stageAdapter = (StageCallAdapter) companion.configure(new StageCallAdapter(recyclerView, parentFragmentManager, WidgetCallFullscreen$setUpStageRecycler$1.INSTANCE, new WidgetCallFullscreen$setUpStageRecycler$2(this), new WidgetCallFullscreen$setUpStageRecycler$3(this), new WidgetCallFullscreen$setUpStageRecycler$4(getViewModel()), new WidgetCallFullscreen$setUpStageRecycler$5(getViewModel())));
|
|
RecyclerView recyclerView2 = getBinding().m;
|
|
m.checkNotNullExpressionValue(recyclerView2, "binding.callStageRecycler");
|
|
GridLayoutManager gridLayoutManager = new GridLayoutManager(recyclerView2.getContext(), 12);
|
|
StageCallAdapter stageCallAdapter = this.stageAdapter;
|
|
if (stageCallAdapter == null) {
|
|
m.throwUninitializedPropertyAccessException("stageAdapter");
|
|
}
|
|
gridLayoutManager.setSpanSizeLookup(stageCallAdapter.getSpanSizeLookup());
|
|
this.stageLayoutManager = gridLayoutManager;
|
|
RecyclerView recyclerView3 = getBinding().m;
|
|
GridLayoutManager gridLayoutManager2 = this.stageLayoutManager;
|
|
if (gridLayoutManager2 == null) {
|
|
m.throwUninitializedPropertyAccessException("stageLayoutManager");
|
|
}
|
|
recyclerView3.setLayoutManager(gridLayoutManager2);
|
|
StageCallAdapter stageCallAdapter2 = this.stageAdapter;
|
|
if (stageCallAdapter2 == null) {
|
|
m.throwUninitializedPropertyAccessException("stageAdapter");
|
|
}
|
|
recyclerView3.addItemDecoration(stageCallAdapter2.getItemDecoration());
|
|
recyclerView3.addOnScrollListener(this.stageSpeakerPillManagingScrollListener);
|
|
}
|
|
|
|
private final void setVoiceControlsSheetPeekHeight() {
|
|
WindowInsetsCompat windowInsetsCompat = this.systemWindowInsets;
|
|
int systemWindowInsetBottom = windowInsetsCompat != null ? windowInsetsCompat.getSystemWindowInsetBottom() : 0;
|
|
int peekHeight = getBinding().f2233y.getPeekHeight();
|
|
BottomSheetBehavior<VoiceControlsSheetView> bottomSheetBehavior = this.bottomSheetBehavior;
|
|
if (bottomSheetBehavior == null) {
|
|
m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
}
|
|
int i = systemWindowInsetBottom + peekHeight;
|
|
bottomSheetBehavior.setPeekHeight(i);
|
|
RecyclerView recyclerView = getBinding().m;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callStageRecycler");
|
|
recyclerView.setPadding(recyclerView.getPaddingLeft(), recyclerView.getPaddingTop(), recyclerView.getPaddingRight(), i);
|
|
ConstraintLayout constraintLayout = getBinding().o;
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.callStreamingActive");
|
|
constraintLayout.setPadding(constraintLayout.getPaddingLeft(), constraintLayout.getPaddingTop(), constraintLayout.getPaddingRight(), peekHeight);
|
|
LinearLayout linearLayout = getBinding().f2231s.e;
|
|
m.checkNotNullExpressionValue(linearLayout, "binding.privateCall.privateCallContainerContent");
|
|
linearLayout.setPadding(linearLayout.getPaddingLeft(), linearLayout.getPaddingTop(), linearLayout.getPaddingRight(), peekHeight);
|
|
}
|
|
|
|
private final void showControls() {
|
|
ViewExtensions.fadeBy(getBinding().f2233y, true, 200);
|
|
VideoCallGridAdapter videoCallGridAdapter = this.gridAdapter;
|
|
if (videoCallGridAdapter == null) {
|
|
m.throwUninitializedPropertyAccessException("gridAdapter");
|
|
}
|
|
videoCallGridAdapter.notifyCallControlsVisibilityChanged(true);
|
|
FragmentActivity requireActivity = requireActivity();
|
|
m.checkNotNullExpressionValue(requireActivity, "requireActivity()");
|
|
Window window = requireActivity.getWindow();
|
|
m.checkNotNullExpressionValue(window, "requireActivity().window");
|
|
RecyclerView recyclerView = getBinding().p;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.callVideoRecycler");
|
|
m.checkNotNullParameter(window, "window");
|
|
m.checkNotNullParameter(recyclerView, "view");
|
|
if (Build.VERSION.SDK_INT >= 30) {
|
|
window.setDecorFitsSystemWindows(true);
|
|
}
|
|
recyclerView.setSystemUiVisibility(1792);
|
|
}
|
|
|
|
private final void showNoScreenSharePermissionDialog() {
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
Context requireContext = requireContext();
|
|
m.checkNotNullParameter(parentFragmentManager, "fragmentManager");
|
|
m.checkNotNullParameter(requireContext, "context");
|
|
WidgetNoticeDialog.Companion companion = WidgetNoticeDialog.Companion;
|
|
String string = requireContext.getString(R.string.no_video_permission_dialog_title);
|
|
String string2 = requireContext.getString(R.string.no_screenshare_permission_dialog_body);
|
|
m.checkNotNullExpressionValue(string2, "context.getString(R.stri…e_permission_dialog_body)");
|
|
WidgetNoticeDialog.Companion.show$default(companion, parentFragmentManager, string, string2, requireContext.getString(R.string.okay), null, null, null, null, null, null, null, null, 0, null, 16368, null);
|
|
}
|
|
|
|
private final void showNoVadPermissionDialog() {
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
Context requireContext = requireContext();
|
|
m.checkNotNullParameter(parentFragmentManager, "fragmentManager");
|
|
m.checkNotNullParameter(requireContext, "context");
|
|
WidgetNoticeDialog.Companion companion = WidgetNoticeDialog.Companion;
|
|
String string = requireContext.getString(R.string.vad_permission_title);
|
|
String string2 = requireContext.getString(R.string.vad_permission_body);
|
|
m.checkNotNullExpressionValue(string2, "context.getString(R.string.vad_permission_body)");
|
|
WidgetNoticeDialog.Companion.show$default(companion, parentFragmentManager, string, string2, requireContext.getString(R.string.okay), null, null, null, null, null, null, null, null, 0, null, 16368, null);
|
|
}
|
|
|
|
private final void showNoVideoPermissionDialog() {
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
Context requireContext = requireContext();
|
|
m.checkNotNullParameter(parentFragmentManager, "fragmentManager");
|
|
m.checkNotNullParameter(requireContext, "context");
|
|
WidgetNoticeDialog.Companion companion = WidgetNoticeDialog.Companion;
|
|
String string = requireContext.getString(R.string.no_video_permission_dialog_title);
|
|
String string2 = requireContext.getString(R.string.no_video_permission_dialog_body);
|
|
m.checkNotNullExpressionValue(string2, "context.getString(R.stri…o_permission_dialog_body)");
|
|
WidgetNoticeDialog.Companion.show$default(companion, parentFragmentManager, string, string2, requireContext.getString(R.string.okay), null, null, null, null, null, null, null, null, 0, null, 16368, null);
|
|
}
|
|
|
|
private final void showServerDeafenedDialog() {
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
Context requireContext = requireContext();
|
|
m.checkNotNullParameter(parentFragmentManager, "fragmentManager");
|
|
m.checkNotNullParameter(requireContext, "context");
|
|
WidgetNoticeDialog.Companion companion = WidgetNoticeDialog.Companion;
|
|
String string = requireContext.getString(R.string.server_deafened_dialog_title);
|
|
String string2 = requireContext.getString(R.string.server_deafened_dialog_body);
|
|
m.checkNotNullExpressionValue(string2, "context.getString(R.stri…ver_deafened_dialog_body)");
|
|
WidgetNoticeDialog.Companion.show$default(companion, parentFragmentManager, string, string2, requireContext.getString(R.string.okay), null, null, null, null, null, null, null, null, 0, null, 16368, null);
|
|
}
|
|
|
|
private final void showServerMutedDialog() {
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
Context requireContext = requireContext();
|
|
m.checkNotNullParameter(parentFragmentManager, "fragmentManager");
|
|
m.checkNotNullParameter(requireContext, "context");
|
|
WidgetNoticeDialog.Companion companion = WidgetNoticeDialog.Companion;
|
|
String string = requireContext.getString(R.string.server_muted_dialog_title);
|
|
String string2 = requireContext.getString(R.string.server_muted_dialog_body);
|
|
m.checkNotNullExpressionValue(string2, "context.getString(R.stri…server_muted_dialog_body)");
|
|
WidgetNoticeDialog.Companion.show$default(companion, parentFragmentManager, string, string2, requireContext.getString(R.string.okay), null, null, null, null, null, null, null, null, 0, null, 16368, null);
|
|
}
|
|
|
|
private final void showSuppressedDialog() {
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
Context requireContext = requireContext();
|
|
m.checkNotNullParameter(parentFragmentManager, "fragmentManager");
|
|
m.checkNotNullParameter(requireContext, "context");
|
|
WidgetNoticeDialog.Companion companion = WidgetNoticeDialog.Companion;
|
|
String string = requireContext.getString(R.string.suppressed);
|
|
String string2 = requireContext.getString(R.string.suppressed_permission_body);
|
|
m.checkNotNullExpressionValue(string2, "context.getString(R.stri…ppressed_permission_body)");
|
|
WidgetNoticeDialog.Companion.show$default(companion, parentFragmentManager, string, string2, requireContext.getString(R.string.okay), null, null, null, null, null, null, null, null, 0, null, 16368, null);
|
|
}
|
|
|
|
private final void transitionActivity() {
|
|
requireAppActivity().finish();
|
|
requireAppActivity().overridePendingTransition(R.anim.activity_slide_horizontal_open_in, R.anim.activity_slide_horizontal_open_out);
|
|
}
|
|
|
|
public final void handleEvent(WidgetCallFullscreenViewModel.Event event) {
|
|
Unit unit;
|
|
m.checkNotNullParameter(event, "event");
|
|
if (m.areEqual(event, WidgetCallFullscreenViewModel.Event.ShowSuppressedDialog.INSTANCE)) {
|
|
showSuppressedDialog();
|
|
unit = Unit.a;
|
|
} else if (m.areEqual(event, WidgetCallFullscreenViewModel.Event.ShowServerMutedDialog.INSTANCE)) {
|
|
showServerMutedDialog();
|
|
unit = Unit.a;
|
|
} else if (m.areEqual(event, WidgetCallFullscreenViewModel.Event.ShowServerDeafenedDialog.INSTANCE)) {
|
|
showServerDeafenedDialog();
|
|
unit = Unit.a;
|
|
} else if (m.areEqual(event, WidgetCallFullscreenViewModel.Event.ShowNoVideoPermissionDialog.INSTANCE)) {
|
|
showNoVideoPermissionDialog();
|
|
unit = Unit.a;
|
|
} else if (m.areEqual(event, WidgetCallFullscreenViewModel.Event.ShowNoVadPermissionDialog.INSTANCE)) {
|
|
showNoVadPermissionDialog();
|
|
unit = Unit.a;
|
|
} else if (m.areEqual(event, WidgetCallFullscreenViewModel.Event.ShowGuildVideoAtCapacityDialog.INSTANCE)) {
|
|
m.a aVar = b.a.a.m.k;
|
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
|
d0.z.d.m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
|
aVar.a(parentFragmentManager);
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.ShowCameraCapacityDialog) {
|
|
j.a aVar2 = b.a.a.j.k;
|
|
FragmentManager parentFragmentManager2 = getParentFragmentManager();
|
|
d0.z.d.m.checkNotNullExpressionValue(parentFragmentManager2, "parentFragmentManager");
|
|
aVar2.a(parentFragmentManager2, ((WidgetCallFullscreenViewModel.Event.ShowCameraCapacityDialog) event).getGuildMaxVideoChannelUsers());
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.ShowUserSheet) {
|
|
WidgetUserSheet.Companion companion = WidgetUserSheet.Companion;
|
|
WidgetCallFullscreenViewModel.Event.ShowUserSheet showUserSheet = (WidgetCallFullscreenViewModel.Event.ShowUserSheet) event;
|
|
long userId = showUserSheet.getUserId();
|
|
Long valueOf = Long.valueOf(showUserSheet.getChannelId());
|
|
FragmentManager parentFragmentManager3 = getParentFragmentManager();
|
|
d0.z.d.m.checkNotNullExpressionValue(parentFragmentManager3, "parentFragmentManager");
|
|
WidgetUserSheet.Companion.show$default(companion, userId, valueOf, parentFragmentManager3, null, Boolean.TRUE, WidgetUserSheet.StreamPreviewClickBehavior.TARGET_AND_DISMISS, null, 72, null);
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.ShowRequestCameraPermissionsDialog) {
|
|
requestVideoCallPermissions(new WidgetCallFullscreen$handleEvent$1(this));
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.AccessibilityAnnouncement) {
|
|
AccessibilityUtils accessibilityUtils = AccessibilityUtils.INSTANCE;
|
|
Context requireContext = requireContext();
|
|
String string = getString(((WidgetCallFullscreenViewModel.Event.AccessibilityAnnouncement) event).getMessageResId());
|
|
d0.z.d.m.checkNotNullExpressionValue(string, "getString(event.messageResId)");
|
|
accessibilityUtils.sendAnnouncement(requireContext, string);
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.EnqueueStreamFeedbackSheet) {
|
|
WidgetCallFullscreenViewModel.Event.EnqueueStreamFeedbackSheet enqueueStreamFeedbackSheet = (WidgetCallFullscreenViewModel.Event.EnqueueStreamFeedbackSheet) event;
|
|
StreamFeedbackSheetNavigator.INSTANCE.enqueueNotice(enqueueStreamFeedbackSheet.getStreamKey(), enqueueStreamFeedbackSheet.getMediaSessionId(), enqueueStreamFeedbackSheet.getTriggerRateDenominator());
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.EnqueueCallFeedbackSheet) {
|
|
WidgetCallFullscreenViewModel.Event.EnqueueCallFeedbackSheet enqueueCallFeedbackSheet = (WidgetCallFullscreenViewModel.Event.EnqueueCallFeedbackSheet) event;
|
|
CallFeedbackSheetNavigator.INSTANCE.enqueueNotice(enqueueCallFeedbackSheet.getChannelId(), enqueueCallFeedbackSheet.getRtcConnectionId(), enqueueCallFeedbackSheet.getMediaSessionId(), Long.valueOf(enqueueCallFeedbackSheet.getCallDuration()), enqueueCallFeedbackSheet.getTriggerRateDenominator());
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.ShowNoScreenSharePermissionDialog) {
|
|
showNoScreenSharePermissionDialog();
|
|
unit = Unit.a;
|
|
} else if (d0.z.d.m.areEqual(event, WidgetCallFullscreenViewModel.Event.RequestStartStream.INSTANCE)) {
|
|
BottomSheetBehavior<VoiceControlsSheetView> bottomSheetBehavior = this.bottomSheetBehavior;
|
|
if (bottomSheetBehavior == null) {
|
|
d0.z.d.m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
}
|
|
bottomSheetBehavior.setState(4);
|
|
StreamNavigator.requestStartStream(this);
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.OnIdleStateChanged) {
|
|
handleIdleStateChanged((WidgetCallFullscreenViewModel.Event.OnIdleStateChanged) event);
|
|
unit = Unit.a;
|
|
} else if (event instanceof WidgetCallFullscreenViewModel.Event.NavigateToPremiumSettings) {
|
|
WidgetSettingsPremium.Companion.launch$default(WidgetSettingsPremium.Companion, requireContext(), null, null, 6, null);
|
|
unit = Unit.a;
|
|
} else if (d0.z.d.m.areEqual(event, WidgetCallFullscreenViewModel.Event.ShowActivitiesDesktopOnlyDialog.INSTANCE)) {
|
|
FragmentManager parentFragmentManager4 = getParentFragmentManager();
|
|
d0.z.d.m.checkNotNullExpressionValue(parentFragmentManager4, "parentFragmentManager");
|
|
Context requireContext2 = requireContext();
|
|
d0.z.d.m.checkNotNullParameter(parentFragmentManager4, "fragmentManager");
|
|
d0.z.d.m.checkNotNullParameter(requireContext2, "context");
|
|
WidgetNoticeDialog.Companion companion2 = WidgetNoticeDialog.Companion;
|
|
String string2 = requireContext2.getString(R.string.embedded_activities_desktop_only_modal_title);
|
|
String string3 = requireContext2.getString(R.string.embedded_activities_desktop_only_modal_description);
|
|
d0.z.d.m.checkNotNullExpressionValue(string3, "context.getString(R.stri…p_only_modal_description)");
|
|
WidgetNoticeDialog.Companion.show$default(companion2, parentFragmentManager4, string2, string3, requireContext2.getString(R.string.okay), null, null, null, null, null, null, null, null, 0, null, 16368, null);
|
|
unit = Unit.a;
|
|
} else {
|
|
throw new NoWhenBranchMatchedException();
|
|
}
|
|
KotlinExtensionsKt.getExhaustive(unit);
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment, androidx.fragment.app.Fragment
|
|
public void onActivityResult(int i, int i2, Intent intent) {
|
|
super.onActivityResult(i, i2, intent);
|
|
StreamNavigator.handleActivityResult(i, i2, intent, new WidgetCallFullscreen$onActivityResult$1(this));
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
|
d0.z.d.m.checkNotNullParameter(layoutInflater, "inflater");
|
|
FragmentActivity requireActivity = requireActivity();
|
|
d0.z.d.m.checkNotNullExpressionValue(requireActivity, "requireActivity()");
|
|
Window window = requireActivity.getWindow();
|
|
d0.z.d.m.checkNotNullExpressionValue(window, "requireActivity().window");
|
|
d0.z.d.m.checkNotNullParameter(window, "window");
|
|
if (Build.VERSION.SDK_INT >= 28) {
|
|
window.getAttributes().layoutInDisplayCutoutMode = 1;
|
|
}
|
|
getViewModel().setTargetChannelId(getChannelId());
|
|
return super.onCreateView(layoutInflater, viewGroup, bundle);
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public void onDestroy() {
|
|
super.onDestroy();
|
|
Subscription subscription = this.connectedTimerSubscription;
|
|
if (subscription != null) {
|
|
subscription.unsubscribe();
|
|
}
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment, androidx.fragment.app.Fragment
|
|
public void onPause() {
|
|
super.onPause();
|
|
WidgetGlobalStatusIndicatorState.updateState$default(WidgetGlobalStatusIndicatorState.Provider.get(), false, false, false, 3, null);
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
public void onViewBound(View view) {
|
|
d0.z.d.m.checkNotNullParameter(view, "view");
|
|
super.onViewBound(view);
|
|
ViewGroup viewGroup = (ViewGroup) view;
|
|
initializeSystemUiListeners(viewGroup);
|
|
Context context = viewGroup.getContext();
|
|
d0.z.d.m.checkNotNullExpressionValue(context, "view.context");
|
|
setActionBarDisplayHomeAsUpEnabled(true, Integer.valueOf(DrawableCompat.getThemedDrawableRes$default(context, (int) R.attr.ic_action_bar_down, 0, 2, (Object) null)), Integer.valueOf((int) R.string.dismiss));
|
|
AppTransitionActivity.a aVar = requireAppActivity().k;
|
|
setUpGridRecycler();
|
|
setUpStageRecycler();
|
|
ViewCompat.setAccessibilityDelegate(view, new WidgetCallFullscreen$onViewBound$1(this));
|
|
BottomSheetBehavior<VoiceControlsSheetView> from = BottomSheetBehavior.from(getBinding().f2233y);
|
|
d0.z.d.m.checkNotNullExpressionValue(from, "BottomSheetBehavior.from…g.voiceControlsSheetView)");
|
|
this.bottomSheetBehavior = from;
|
|
if (from == null) {
|
|
d0.z.d.m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
}
|
|
from.setGestureInsetBottomIgnored(true);
|
|
BottomSheetBehavior<VoiceControlsSheetView> bottomSheetBehavior = this.bottomSheetBehavior;
|
|
if (bottomSheetBehavior == null) {
|
|
d0.z.d.m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
}
|
|
bottomSheetBehavior.addBottomSheetCallback(this.bottomSheetCallback);
|
|
VoiceControlsSheetView voiceControlsSheetView = getBinding().f2233y;
|
|
d0.z.d.m.checkNotNullExpressionValue(voiceControlsSheetView, "binding.voiceControlsSheetView");
|
|
ViewExtensions.addOnHeightChangedListener(voiceControlsSheetView, new WidgetCallFullscreen$onViewBound$2(this));
|
|
OnPressListener onPressListener = new OnPressListener(new WidgetCallFullscreen$onViewBound$listener$1(getViewModel()));
|
|
getBinding().g.setOnTouchListener(onPressListener);
|
|
getBinding().f2233y.setOnPTTListener(onPressListener);
|
|
Channel channel = StoreStream.Companion.getChannels().getChannel(getChannelId());
|
|
if (channel != null && ChannelUtils.z(channel)) {
|
|
requireAppActivity().k = AppTransitionActivity.Transition.TYPE_SLIDE_VERTICAL_WITH_FADE.getAnimations();
|
|
}
|
|
if (getMostRecentIntent().getBooleanExtra(INTENT_EXTRA_CONNECT_ON_LAUNCH, false)) {
|
|
if (channel == null || !ChannelUtils.z(channel)) {
|
|
requestMicrophone(new WidgetCallFullscreen$onViewBound$3(this, channel), new WidgetCallFullscreen$onViewBound$4(this));
|
|
} else {
|
|
getViewModel().tryConnectToVoice();
|
|
}
|
|
}
|
|
AppFragment.setOnBackPressed$default(this, new WidgetCallFullscreen$onViewBound$5(this, channel), 0, 2, null);
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
public void onViewBoundOrOnResume() {
|
|
super.onViewBoundOrOnResume();
|
|
WidgetGlobalStatusIndicatorState.updateState$default(WidgetGlobalStatusIndicatorState.Provider.get(), false, false, true, 3, null);
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle$default(getViewModel().observeViewState(), this, null, 2, null), WidgetCallFullscreen.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetCallFullscreen$onViewBoundOrOnResume$1(this), 62, (Object) null);
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle$default(getViewModel().observeEvents(), this, null, 2, null), WidgetCallFullscreen.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetCallFullscreen$onViewBoundOrOnResume$2(this), 62, (Object) null);
|
|
}
|
|
}
|