discord-jadx/app/src/main/java/b/a/y/w.java

158 lines
6.4 KiB
Java
Raw Normal View History

2021-12-17 22:01:24 +00:00
package b.a.y;
2021-08-10 10:47:20 +00:00
import android.content.Context;
import android.content.res.Configuration;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
2021-12-17 22:01:24 +00:00
import b.a.i.y0;
2021-08-10 10:47:20 +00:00
import com.discord.R;
import com.discord.app.AppComponent;
import com.discord.overlay.views.OverlayBubbleWrap;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreVoiceParticipants;
import com.discord.utilities.icon.IconUtils;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.facebook.drawee.view.SimpleDraweeView;
2021-11-01 07:19:03 +00:00
import d0.z.d.m;
import d0.z.d.o;
2021-12-17 22:01:24 +00:00
import j0.l.e.k;
2021-08-10 10:47:20 +00:00
import java.util.Objects;
import kotlin.Unit;
2021-08-10 10:47:20 +00:00
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.Subject;
/* compiled from: OverlayVoiceBubble.kt */
public final class w extends OverlayBubbleWrap implements AppComponent {
2021-08-10 10:47:20 +00:00
/* renamed from: x reason: collision with root package name */
2022-01-24 08:17:14 +00:00
public static final /* synthetic */ int f310x = 0;
2021-08-10 10:47:20 +00:00
/* renamed from: y reason: collision with root package name */
2022-01-24 08:17:14 +00:00
public final y0 f311y;
2021-12-17 22:01:24 +00:00
/* renamed from: z reason: collision with root package name */
2022-01-24 08:17:14 +00:00
public final Subject<Void, Void> f312z;
2021-08-10 10:47:20 +00:00
/* compiled from: OverlayVoiceBubble.kt */
2021-11-01 07:19:03 +00:00
public static final class a<T, R> implements j0.k.b<Long, Observable<? extends StoreVoiceParticipants.VoiceUser>> {
2021-12-17 22:01:24 +00:00
public static final a j = new a();
2021-08-10 10:47:20 +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] */
2021-11-01 07:19:03 +00:00
@Override // j0.k.b
2021-08-10 10:47:20 +00:00
public Observable<? extends StoreVoiceParticipants.VoiceUser> call(Long l) {
Long l2 = l;
if (l2 != null && l2.longValue() == 0) {
2021-12-17 22:01:24 +00:00
return new k(null);
2021-08-10 10:47:20 +00:00
}
StoreVoiceParticipants voiceParticipants = StoreStream.Companion.getVoiceParticipants();
m.checkNotNullExpressionValue(l2, "channelId");
2021-12-17 22:01:24 +00:00
return voiceParticipants.get(l2.longValue()).F(v.j).q();
2021-08-10 10:47:20 +00:00
}
}
/* compiled from: OverlayVoiceBubble.kt */
public static final class b extends o implements Function1<StoreVoiceParticipants.VoiceUser, Unit> {
public final /* synthetic */ w this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public b(w wVar) {
super(1);
this.this$0 = wVar;
}
2021-08-10 10:47:20 +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
public Unit invoke(StoreVoiceParticipants.VoiceUser voiceUser) {
StoreVoiceParticipants.VoiceUser voiceUser2 = voiceUser;
w wVar = this.this$0;
2022-01-24 08:17:14 +00:00
int i = w.f310x;
2021-08-10 10:47:20 +00:00
if (voiceUser2 == null) {
wVar.h();
} else {
2021-08-18 07:29:27 +00:00
IconUtils.setIcon$default(wVar.getImageView$app_productionBetaRelease(), voiceUser2.getUser(), 0, null, null, voiceUser2.getGuildMember(), 28, null);
2021-08-10 10:47:20 +00:00
wVar.g();
}
return Unit.a;
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public w(Context context) {
super(context);
m.checkNotNullParameter(context, "context");
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.overlay_voice_bubble, (ViewGroup) this, false);
addView(inflate);
Objects.requireNonNull(inflate, "rootView");
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) inflate;
2021-12-17 22:01:24 +00:00
y0 y0Var = new y0(simpleDraweeView, simpleDraweeView);
m.checkNotNullExpressionValue(y0Var, "OverlayVoiceBubbleBindin…rom(context), this, true)");
2022-01-24 08:17:14 +00:00
this.f311y = y0Var;
2021-10-22 07:30:30 +00:00
PublishSubject k0 = PublishSubject.k0();
m.checkNotNullExpressionValue(k0, "PublishSubject.create()");
2022-01-24 08:17:14 +00:00
this.f312z = k0;
2021-08-10 10:47:20 +00:00
}
@Override // com.discord.overlay.views.OverlayBubbleWrap
public void a(boolean z2) {
h();
super.a(z2);
}
@Override // com.discord.overlay.views.OverlayBubbleWrap
public void b(View view) {
m.checkNotNullParameter(view, "targetView");
super.b(view);
g();
}
public final void g() {
getImageView$app_productionBetaRelease().animate().setDuration(100).alpha(1.0f).start();
}
public final SimpleDraweeView getImageView$app_productionBetaRelease() {
2022-01-24 08:17:14 +00:00
SimpleDraweeView simpleDraweeView = this.f311y.f226b;
2021-08-10 10:47:20 +00:00
m.checkNotNullExpressionValue(simpleDraweeView, "binding.overlayBubbleIv");
return simpleDraweeView;
}
@Override // com.discord.app.AppComponent
public Subject<Void, Void> getUnsubscribeSignal() {
2022-01-24 08:17:14 +00:00
return this.f312z;
2021-08-10 10:47:20 +00:00
}
public final void h() {
getImageView$app_productionBetaRelease().animate().setDuration(200).alpha(0.5f).start();
}
@Override // android.view.View, android.view.ViewGroup
public void onAttachedToWindow() {
super.onAttachedToWindow();
2021-12-17 22:01:24 +00:00
Observable<R> Y = StoreStream.Companion.getVoiceChannelSelected().observeSelectedVoiceChannelId().Y(a.j);
2021-10-22 07:30:30 +00:00
m.checkNotNullExpressionValue(Y, "StoreStream\n .get…d()\n }\n }");
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(Y), this, null, 2, null), w.class, getContext(), (Function1) null, (Function1) null, (Function0) null, (Function0) null, new b(this), 60, (Object) null);
2021-08-10 10:47:20 +00:00
}
@Override // com.discord.overlay.views.OverlayBubbleWrap, android.view.View
public void onConfigurationChanged(Configuration configuration) {
int i = getWindowLayoutParams().x;
Context context = getContext();
m.checkNotNullExpressionValue(context, "context");
int i2 = i > e(context).centerX() ? Integer.MAX_VALUE : Integer.MIN_VALUE;
super.onConfigurationChanged(configuration);
OverlayBubbleWrap.c(this, i2, getWindowLayoutParams().y, null, 4, null);
getSpringAnimationX().skipToEnd();
getSpringAnimationY().skipToEnd();
}
@Override // android.view.View, android.view.ViewGroup
public void onDetachedFromWindow() {
getUnsubscribeSignal().onNext(null);
super.onDetachedFromWindow();
}
}