2021-08-03 07:33:18 +00:00
|
|
|
package c.a.a.f.a;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.view.View;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.RadioGroup;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentViewModelLazyKt;
|
2021-08-03 07:33:18 +00:00
|
|
|
import c.a.a.f.a.d;
|
2021-08-18 07:29:27 +00:00
|
|
|
import c.a.d.f0;
|
|
|
|
import c.a.d.h0;
|
2021-08-09 22:50:52 +00:00
|
|
|
import com.discord.R;
|
2021-07-24 02:37:17 +00:00
|
|
|
import com.discord.app.AppDialog;
|
|
|
|
import com.discord.app.AppViewModel;
|
|
|
|
import com.discord.rtcconnection.audio.DiscordAudioManager;
|
|
|
|
import com.discord.utilities.color.ColorCompat;
|
|
|
|
import com.discord.utilities.color.ColorCompatKt;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
|
|
import com.google.android.material.radiobutton.MaterialRadioButton;
|
2021-11-01 07:19:03 +00:00
|
|
|
import d0.z.d.a0;
|
|
|
|
import d0.z.d.k;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
2021-07-24 02:37:17 +00:00
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import kotlin.Lazy;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: AudioOutputSelectionDialog.kt */
|
|
|
|
public final class a extends AppDialog {
|
2021-11-05 21:05:33 +00:00
|
|
|
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.b0(a.class, "binding", "getBinding()Lcom/discord/databinding/AudioOutputSelectionDialogBinding;", 0)};
|
2021-07-24 02:37:17 +00:00
|
|
|
public static final b j = new b(null);
|
|
|
|
public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, c.i, null, 2, null);
|
|
|
|
public final Lazy l;
|
|
|
|
|
|
|
|
/* compiled from: java-style lambda group */
|
2021-08-03 07:33:18 +00:00
|
|
|
/* renamed from: c.a.a.f.a.a$a reason: collision with other inner class name */
|
2021-11-05 21:05:33 +00:00
|
|
|
public static final class View$OnClickListenerC0015a implements View.OnClickListener {
|
2021-07-24 02:37:17 +00:00
|
|
|
public final /* synthetic */ int i;
|
|
|
|
public final /* synthetic */ Object j;
|
|
|
|
|
2021-11-05 21:05:33 +00:00
|
|
|
public View$OnClickListenerC0015a(int i, Object obj) {
|
2021-07-24 02:37:17 +00:00
|
|
|
this.i = i;
|
|
|
|
this.j = obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
|
|
public final void onClick(View view) {
|
|
|
|
int i = this.i;
|
|
|
|
if (i == 0) {
|
2021-08-03 07:33:18 +00:00
|
|
|
a.h((a) this.j).i.selectOutputDevice(DiscordAudioManager.DeviceTypes.BLUETOOTH_HEADSET);
|
2021-07-24 02:37:17 +00:00
|
|
|
a.g((a) this.j);
|
|
|
|
} else if (i == 1) {
|
2021-08-03 07:33:18 +00:00
|
|
|
a.h((a) this.j).i.selectOutputDevice(DiscordAudioManager.DeviceTypes.SPEAKERPHONE);
|
2021-07-24 02:37:17 +00:00
|
|
|
a.g((a) this.j);
|
|
|
|
} else if (i == 2) {
|
2021-08-03 07:33:18 +00:00
|
|
|
a.h((a) this.j).i.selectOutputDevice(DiscordAudioManager.DeviceTypes.WIRED_HEADSET);
|
2021-07-24 02:37:17 +00:00
|
|
|
a.g((a) this.j);
|
|
|
|
} else if (i == 3) {
|
2021-08-03 07:33:18 +00:00
|
|
|
a.h((a) this.j).i.selectOutputDevice(DiscordAudioManager.DeviceTypes.EARPIECE);
|
2021-07-24 02:37:17 +00:00
|
|
|
a.g((a) this.j);
|
|
|
|
} else {
|
|
|
|
throw null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: AudioOutputSelectionDialog.kt */
|
|
|
|
public static final class b {
|
|
|
|
public b(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: AudioOutputSelectionDialog.kt */
|
2021-08-18 07:29:27 +00:00
|
|
|
public static final /* synthetic */ class c extends k implements Function1<View, c.a.i.b> {
|
2021-07-24 02:37:17 +00:00
|
|
|
public static final c i = new c();
|
|
|
|
|
|
|
|
public c() {
|
2021-08-18 07:29:27 +00:00
|
|
|
super(1, c.a.i.b.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/AudioOutputSelectionDialogBinding;", 0);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
2021-08-18 07:29:27 +00:00
|
|
|
public c.a.i.b invoke(View view) {
|
2021-07-24 02:37:17 +00:00
|
|
|
View view2 = view;
|
|
|
|
m.checkNotNullParameter(view2, "p1");
|
2021-08-09 22:50:52 +00:00
|
|
|
int i2 = R.id.audio_output_selection_bluetooth_radio;
|
|
|
|
MaterialRadioButton materialRadioButton = (MaterialRadioButton) view2.findViewById(R.id.audio_output_selection_bluetooth_radio);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (materialRadioButton != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.audio_output_selection_dialog_header;
|
|
|
|
TextView textView = (TextView) view2.findViewById(R.id.audio_output_selection_dialog_header);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (textView != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.audio_output_selection_dialog_radio_group;
|
|
|
|
RadioGroup radioGroup = (RadioGroup) view2.findViewById(R.id.audio_output_selection_dialog_radio_group);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (radioGroup != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.audio_output_selection_earpiece_radio;
|
|
|
|
MaterialRadioButton materialRadioButton2 = (MaterialRadioButton) view2.findViewById(R.id.audio_output_selection_earpiece_radio);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (materialRadioButton2 != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.audio_output_selection_speaker_radio;
|
|
|
|
MaterialRadioButton materialRadioButton3 = (MaterialRadioButton) view2.findViewById(R.id.audio_output_selection_speaker_radio);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (materialRadioButton3 != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.audio_output_selection_wired_radio;
|
|
|
|
MaterialRadioButton materialRadioButton4 = (MaterialRadioButton) view2.findViewById(R.id.audio_output_selection_wired_radio);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (materialRadioButton4 != null) {
|
2021-08-18 07:29:27 +00:00
|
|
|
return new c.a.i.b((LinearLayout) view2, materialRadioButton, textView, radioGroup, materialRadioButton2, materialRadioButton3, materialRadioButton4);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: AudioOutputSelectionDialog.kt */
|
2021-08-03 07:33:18 +00:00
|
|
|
public static final class d extends o implements Function1<d.a, Unit> {
|
2021-07-24 02:37:17 +00:00
|
|
|
public final /* synthetic */ a this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public d(a aVar) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = aVar;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
2021-08-03 07:33:18 +00:00
|
|
|
public Unit invoke(d.a aVar) {
|
2021-07-24 02:37:17 +00:00
|
|
|
int i;
|
2021-08-03 07:33:18 +00:00
|
|
|
d.a aVar2 = aVar;
|
|
|
|
m.checkNotNullParameter(aVar2, "viewState");
|
|
|
|
a aVar3 = this.this$0;
|
|
|
|
Objects.requireNonNull(aVar3);
|
|
|
|
m.checkNotNullParameter(aVar2, "viewState");
|
2021-11-05 21:05:33 +00:00
|
|
|
if (!(aVar2 instanceof d.a.b) && (aVar2 instanceof d.a.C0016a)) {
|
|
|
|
d.a.C0016a aVar4 = (d.a.C0016a) aVar2;
|
2021-08-03 07:33:18 +00:00
|
|
|
int ordinal = aVar4.a.ordinal();
|
|
|
|
if (ordinal == 2) {
|
|
|
|
MaterialRadioButton materialRadioButton = aVar3.i().e;
|
|
|
|
m.checkNotNullExpressionValue(materialRadioButton, "binding.audioOutputSelectionSpeakerRadio");
|
2021-07-24 02:37:17 +00:00
|
|
|
i = materialRadioButton.getId();
|
2021-08-03 07:33:18 +00:00
|
|
|
} else if (ordinal == 3) {
|
|
|
|
MaterialRadioButton materialRadioButton2 = aVar3.i().f;
|
|
|
|
m.checkNotNullExpressionValue(materialRadioButton2, "binding.audioOutputSelectionWiredRadio");
|
2021-07-24 02:37:17 +00:00
|
|
|
i = materialRadioButton2.getId();
|
2021-08-03 07:33:18 +00:00
|
|
|
} else if (ordinal == 4) {
|
|
|
|
MaterialRadioButton materialRadioButton3 = aVar3.i().d;
|
|
|
|
m.checkNotNullExpressionValue(materialRadioButton3, "binding.audioOutputSelectionEarpieceRadio");
|
2021-07-24 02:37:17 +00:00
|
|
|
i = materialRadioButton3.getId();
|
2021-08-03 07:33:18 +00:00
|
|
|
} else if (ordinal == 5) {
|
|
|
|
MaterialRadioButton materialRadioButton4 = aVar3.i().b;
|
|
|
|
m.checkNotNullExpressionValue(materialRadioButton4, "binding.audioOutputSelectionBluetoothRadio");
|
2021-07-24 02:37:17 +00:00
|
|
|
i = materialRadioButton4.getId();
|
|
|
|
}
|
2021-11-22 08:31:21 +00:00
|
|
|
aVar3.i().f66c.check(i);
|
2021-08-03 07:33:18 +00:00
|
|
|
MaterialRadioButton materialRadioButton5 = aVar3.i().b;
|
2021-07-24 02:37:17 +00:00
|
|
|
m.checkNotNullExpressionValue(materialRadioButton5, "binding.audioOutputSelectionBluetoothRadio");
|
|
|
|
int i2 = 0;
|
2021-08-03 07:33:18 +00:00
|
|
|
materialRadioButton5.setVisibility(aVar4.b ? 0 : 8);
|
|
|
|
MaterialRadioButton materialRadioButton6 = aVar3.i().b;
|
2021-07-24 02:37:17 +00:00
|
|
|
m.checkNotNullExpressionValue(materialRadioButton6, "binding.audioOutputSelectionBluetoothRadio");
|
2021-08-31 07:21:49 +00:00
|
|
|
String str = aVar4.f40c;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (str == null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
str = aVar3.getString(R.string.audio_devices_bluetooth);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
materialRadioButton6.setText(str);
|
2021-08-03 07:33:18 +00:00
|
|
|
MaterialRadioButton materialRadioButton7 = aVar3.i().e;
|
2021-07-24 02:37:17 +00:00
|
|
|
m.checkNotNullExpressionValue(materialRadioButton7, "binding.audioOutputSelectionSpeakerRadio");
|
2021-08-03 07:33:18 +00:00
|
|
|
materialRadioButton7.setVisibility(aVar4.d ? 0 : 8);
|
|
|
|
MaterialRadioButton materialRadioButton8 = aVar3.i().f;
|
2021-07-24 02:37:17 +00:00
|
|
|
m.checkNotNullExpressionValue(materialRadioButton8, "binding.audioOutputSelectionWiredRadio");
|
2021-08-03 07:33:18 +00:00
|
|
|
materialRadioButton8.setVisibility(aVar4.e ? 0 : 8);
|
|
|
|
MaterialRadioButton materialRadioButton9 = aVar3.i().d;
|
2021-07-24 02:37:17 +00:00
|
|
|
m.checkNotNullExpressionValue(materialRadioButton9, "binding.audioOutputSelectionEarpieceRadio");
|
2021-08-03 07:33:18 +00:00
|
|
|
if (!aVar4.f) {
|
2021-07-24 02:37:17 +00:00
|
|
|
i2 = 8;
|
|
|
|
}
|
|
|
|
materialRadioButton9.setVisibility(i2);
|
|
|
|
}
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: AudioOutputSelectionDialog.kt */
|
2021-08-03 07:33:18 +00:00
|
|
|
public static final class e extends o implements Function0<AppViewModel<d.a>> {
|
2021-07-24 02:37:17 +00:00
|
|
|
public static final e i = new e();
|
|
|
|
|
|
|
|
public e() {
|
|
|
|
super(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
|
|
/* renamed from: invoke */
|
2021-11-01 07:19:03 +00:00
|
|
|
public AppViewModel<d.a> mo1invoke() {
|
2021-08-03 07:33:18 +00:00
|
|
|
return new d(null, null, 3);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public a() {
|
2021-08-09 22:50:52 +00:00
|
|
|
super(R.layout.audio_output_selection_dialog);
|
2021-07-24 02:37:17 +00:00
|
|
|
e eVar = e.i;
|
2021-08-18 07:29:27 +00:00
|
|
|
f0 f0Var = new f0(this);
|
2021-11-01 07:19:03 +00:00
|
|
|
this.l = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(d.class), new m(5, f0Var), new h0(eVar));
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final void g(a aVar) {
|
|
|
|
Objects.requireNonNull(aVar);
|
2021-10-22 07:30:30 +00:00
|
|
|
Observable<Long> d02 = Observable.d0(300, TimeUnit.MILLISECONDS);
|
|
|
|
m.checkNotNullExpressionValue(d02, "Observable\n .time…S, TimeUnit.MILLISECONDS)");
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(d02, aVar, null, 2, null), a.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new b(aVar), 62, (Object) null);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
2021-08-03 07:33:18 +00:00
|
|
|
public static final d h(a aVar) {
|
|
|
|
return (d) aVar.l.getValue();
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
2021-08-18 07:29:27 +00:00
|
|
|
public final c.a.i.b i() {
|
|
|
|
return (c.a.i.b) this.k.getValue((Fragment) this, i[0]);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppDialog
|
|
|
|
public void onViewBound(View view) {
|
|
|
|
m.checkNotNullParameter(view, "view");
|
|
|
|
super.onViewBound(view);
|
2021-08-09 22:50:52 +00:00
|
|
|
int themedColor = ColorCompat.getThemedColor(view, (int) R.attr.colorInteractiveNormal);
|
2021-07-24 02:37:17 +00:00
|
|
|
MaterialRadioButton materialRadioButton = i().b;
|
|
|
|
m.checkNotNullExpressionValue(materialRadioButton, "binding.audioOutputSelectionBluetoothRadio");
|
|
|
|
ColorCompatKt.setDrawableColor(materialRadioButton, themedColor);
|
|
|
|
MaterialRadioButton materialRadioButton2 = i().e;
|
|
|
|
m.checkNotNullExpressionValue(materialRadioButton2, "binding.audioOutputSelectionSpeakerRadio");
|
|
|
|
ColorCompatKt.setDrawableColor(materialRadioButton2, themedColor);
|
|
|
|
MaterialRadioButton materialRadioButton3 = i().f;
|
|
|
|
m.checkNotNullExpressionValue(materialRadioButton3, "binding.audioOutputSelectionWiredRadio");
|
|
|
|
ColorCompatKt.setDrawableColor(materialRadioButton3, themedColor);
|
|
|
|
MaterialRadioButton materialRadioButton4 = i().d;
|
|
|
|
m.checkNotNullExpressionValue(materialRadioButton4, "binding.audioOutputSelectionEarpieceRadio");
|
|
|
|
ColorCompatKt.setDrawableColor(materialRadioButton4, themedColor);
|
2021-11-05 21:05:33 +00:00
|
|
|
i().b.setOnClickListener(new View$OnClickListenerC0015a(0, this));
|
|
|
|
i().e.setOnClickListener(new View$OnClickListenerC0015a(1, this));
|
|
|
|
i().f.setOnClickListener(new View$OnClickListenerC0015a(2, this));
|
|
|
|
i().d.setOnClickListener(new View$OnClickListenerC0015a(3, this));
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppDialog
|
|
|
|
public void onViewBoundOrOnResume() {
|
|
|
|
super.onViewBoundOrOnResume();
|
2021-08-31 07:21:49 +00:00
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle$default(((d) this.l.getValue()).observeViewState(), this, null, 2, null), a.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new d(this), 62, (Object) null);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|