271 lines
12 KiB
Java
271 lines
12 KiB
Java
package com.discord.widgets.voice.call;
|
|
|
|
import android.content.Context;
|
|
import android.view.View;
|
|
import androidx.core.view.ViewCompat;
|
|
import androidx.core.view.ViewKt;
|
|
import androidx.fragment.app.Fragment;
|
|
import c.a.o.b;
|
|
import c.d.b.a.a;
|
|
import com.discord.R;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.app.AppFragment;
|
|
import com.discord.databinding.WidgetVoiceCallInlineBinding;
|
|
import com.discord.rtcconnection.mediaengine.MediaEngineConnection;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.utilities.press.OnPressListener;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.streams.StreamContext;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import com.discord.utilities.views.ViewVisibilityObserver;
|
|
import com.discord.utilities.views.ViewVisibilityObserverProvider;
|
|
import com.google.android.material.button.MaterialButton;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
import rx.Observable;
|
|
/* compiled from: WidgetVoiceCallInline.kt */
|
|
public final class WidgetVoiceCallInline extends AppFragment {
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.b0(WidgetVoiceCallInline.class, "binding", "getBinding()Lcom/discord/databinding/WidgetVoiceCallInlineBinding;", 0)};
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding(this, WidgetVoiceCallInline$binding$2.INSTANCE, new WidgetVoiceCallInline$binding$3(this));
|
|
private final ViewVisibilityObserver inlineVoiceVisibilityObserver = ViewVisibilityObserverProvider.INSTANCE.get(ViewVisibilityObserverProvider.INLINE_VOICE_FEATURE);
|
|
|
|
/* compiled from: WidgetVoiceCallInline.kt */
|
|
public static final class Model {
|
|
public static final Companion Companion = new Companion(null);
|
|
private final VoiceConnected voiceConnected;
|
|
|
|
/* compiled from: WidgetVoiceCallInline.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final Observable<Model> get() {
|
|
Observable<R> F = VoiceConnected.Companion.get().F(WidgetVoiceCallInline$Model$Companion$get$1.INSTANCE);
|
|
m.checkNotNullExpressionValue(F, "VoiceConnected\n …eConnected)\n }");
|
|
return F;
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetVoiceCallInline.kt */
|
|
public static final class VoiceConnected {
|
|
public static final Companion Companion = new Companion(null);
|
|
private final MediaEngineConnection.InputMode inputMode;
|
|
private final Channel selectedVoiceChannel;
|
|
private final StreamContext streamContext;
|
|
|
|
/* compiled from: WidgetVoiceCallInline.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final Observable<VoiceConnected> get() {
|
|
Observable<R> Y = StoreStream.Companion.getVoiceChannelSelected().observeSelectedChannel().Y(WidgetVoiceCallInline$Model$VoiceConnected$Companion$get$1.INSTANCE);
|
|
m.checkNotNullExpressionValue(Y, "StoreStream\n … }\n }");
|
|
return ObservableExtensionsKt.computationLatest(Y);
|
|
}
|
|
}
|
|
|
|
public VoiceConnected(Channel channel, MediaEngineConnection.InputMode inputMode, StreamContext streamContext) {
|
|
m.checkNotNullParameter(channel, "selectedVoiceChannel");
|
|
m.checkNotNullParameter(inputMode, "inputMode");
|
|
this.selectedVoiceChannel = channel;
|
|
this.inputMode = inputMode;
|
|
this.streamContext = streamContext;
|
|
}
|
|
|
|
public static /* synthetic */ VoiceConnected copy$default(VoiceConnected voiceConnected, Channel channel, MediaEngineConnection.InputMode inputMode, StreamContext streamContext, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
channel = voiceConnected.selectedVoiceChannel;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
inputMode = voiceConnected.inputMode;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
streamContext = voiceConnected.streamContext;
|
|
}
|
|
return voiceConnected.copy(channel, inputMode, streamContext);
|
|
}
|
|
|
|
public final Channel component1() {
|
|
return this.selectedVoiceChannel;
|
|
}
|
|
|
|
public final MediaEngineConnection.InputMode component2() {
|
|
return this.inputMode;
|
|
}
|
|
|
|
public final StreamContext component3() {
|
|
return this.streamContext;
|
|
}
|
|
|
|
public final VoiceConnected copy(Channel channel, MediaEngineConnection.InputMode inputMode, StreamContext streamContext) {
|
|
m.checkNotNullParameter(channel, "selectedVoiceChannel");
|
|
m.checkNotNullParameter(inputMode, "inputMode");
|
|
return new VoiceConnected(channel, inputMode, streamContext);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof VoiceConnected)) {
|
|
return false;
|
|
}
|
|
VoiceConnected voiceConnected = (VoiceConnected) obj;
|
|
return m.areEqual(this.selectedVoiceChannel, voiceConnected.selectedVoiceChannel) && m.areEqual(this.inputMode, voiceConnected.inputMode) && m.areEqual(this.streamContext, voiceConnected.streamContext);
|
|
}
|
|
|
|
public final MediaEngineConnection.InputMode getInputMode() {
|
|
return this.inputMode;
|
|
}
|
|
|
|
public final Channel getSelectedVoiceChannel() {
|
|
return this.selectedVoiceChannel;
|
|
}
|
|
|
|
public final StreamContext getStreamContext() {
|
|
return this.streamContext;
|
|
}
|
|
|
|
public int hashCode() {
|
|
Channel channel = this.selectedVoiceChannel;
|
|
int i = 0;
|
|
int hashCode = (channel != null ? channel.hashCode() : 0) * 31;
|
|
MediaEngineConnection.InputMode inputMode = this.inputMode;
|
|
int hashCode2 = (hashCode + (inputMode != null ? inputMode.hashCode() : 0)) * 31;
|
|
StreamContext streamContext = this.streamContext;
|
|
if (streamContext != null) {
|
|
i = streamContext.hashCode();
|
|
}
|
|
return hashCode2 + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("VoiceConnected(selectedVoiceChannel=");
|
|
R.append(this.selectedVoiceChannel);
|
|
R.append(", inputMode=");
|
|
R.append(this.inputMode);
|
|
R.append(", streamContext=");
|
|
R.append(this.streamContext);
|
|
R.append(")");
|
|
return R.toString();
|
|
}
|
|
}
|
|
|
|
public Model(VoiceConnected voiceConnected) {
|
|
this.voiceConnected = voiceConnected;
|
|
}
|
|
|
|
public static /* synthetic */ Model copy$default(Model model, VoiceConnected voiceConnected, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
voiceConnected = model.voiceConnected;
|
|
}
|
|
return model.copy(voiceConnected);
|
|
}
|
|
|
|
public final VoiceConnected component1() {
|
|
return this.voiceConnected;
|
|
}
|
|
|
|
public final Model copy(VoiceConnected voiceConnected) {
|
|
return new Model(voiceConnected);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof Model) && m.areEqual(this.voiceConnected, ((Model) obj).voiceConnected);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final VoiceConnected getVoiceConnected() {
|
|
return this.voiceConnected;
|
|
}
|
|
|
|
public int hashCode() {
|
|
VoiceConnected voiceConnected = this.voiceConnected;
|
|
if (voiceConnected != null) {
|
|
return voiceConnected.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("Model(voiceConnected=");
|
|
R.append(this.voiceConnected);
|
|
R.append(")");
|
|
return R.toString();
|
|
}
|
|
}
|
|
|
|
public WidgetVoiceCallInline() {
|
|
super(R.layout.widget_voice_call_inline);
|
|
}
|
|
|
|
public static final /* synthetic */ void access$configureUI(WidgetVoiceCallInline widgetVoiceCallInline, Model model) {
|
|
widgetVoiceCallInline.configureUI(model);
|
|
}
|
|
|
|
public static final /* synthetic */ void access$onViewBindingDestroy(WidgetVoiceCallInline widgetVoiceCallInline, WidgetVoiceCallInlineBinding widgetVoiceCallInlineBinding) {
|
|
widgetVoiceCallInline.onViewBindingDestroy(widgetVoiceCallInlineBinding);
|
|
}
|
|
|
|
private final void configureUI(Model model) {
|
|
Model.VoiceConnected voiceConnected;
|
|
boolean z2 = ((model == null || (voiceConnected = model.getVoiceConnected()) == null) ? null : voiceConnected.getInputMode()) == MediaEngineConnection.InputMode.PUSH_TO_TALK;
|
|
View view = getView();
|
|
if (view != null) {
|
|
ViewKt.setVisible(view, z2);
|
|
}
|
|
this.inlineVoiceVisibilityObserver.updateVisibility(z2);
|
|
if (model == null) {
|
|
}
|
|
}
|
|
|
|
private final WidgetVoiceCallInlineBinding getBinding() {
|
|
return (WidgetVoiceCallInlineBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
}
|
|
|
|
private final void onViewBindingDestroy(WidgetVoiceCallInlineBinding widgetVoiceCallInlineBinding) {
|
|
b a = b.C0033b.a();
|
|
MaterialButton materialButton = widgetVoiceCallInlineBinding.f2128c;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.voiceConnectedPtt");
|
|
a.c(materialButton);
|
|
}
|
|
|
|
private final void setWindowInsetsListeners() {
|
|
ViewCompat.setOnApplyWindowInsetsListener(getBinding().b, WidgetVoiceCallInline$setWindowInsetsListeners$1.INSTANCE);
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
public void onViewBound(View view) {
|
|
m.checkNotNullParameter(view, "view");
|
|
super.onViewBound(view);
|
|
getBinding().f2128c.setOnClickListener(WidgetVoiceCallInline$onViewBound$1.INSTANCE);
|
|
getBinding().f2128c.setOnTouchListener(new OnPressListener(WidgetVoiceCallInline$onViewBound$2.INSTANCE));
|
|
b a = b.C0033b.a();
|
|
MaterialButton materialButton = getBinding().f2128c;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.voiceConnectedPtt");
|
|
a.b(materialButton);
|
|
setWindowInsetsListeners();
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
public void onViewBoundOrOnResume() {
|
|
super.onViewBoundOrOnResume();
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(Model.Companion.get(), this, null, 2, null), WidgetVoiceCallInline.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetVoiceCallInline$onViewBoundOrOnResume$1(this), 62, (Object) null);
|
|
}
|
|
}
|