2021-12-17 21:59:34 +00:00
|
|
|
package b.a.n;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.WindowManager;
|
|
|
|
import androidx.core.view.ViewCompat;
|
|
|
|
import com.discord.overlay.OverlayManager;
|
|
|
|
import com.discord.overlay.views.OverlayBubbleWrap;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
2021-07-24 02:37:17 +00:00
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
/* compiled from: OverlayManager.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-07-24 02:37:17 +00:00
|
|
|
public final class d implements View.OnClickListener {
|
2021-12-02 18:53:44 +00:00
|
|
|
public final /* synthetic */ OverlayManager j;
|
|
|
|
public final /* synthetic */ Function1 k;
|
|
|
|
public final /* synthetic */ OverlayBubbleWrap l;
|
|
|
|
public final /* synthetic */ Object m;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
|
|
|
/* compiled from: OverlayManager.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2021-07-24 02:37:17 +00:00
|
|
|
public static final class a implements View.OnAttachStateChangeListener {
|
|
|
|
|
|
|
|
/* compiled from: View.kt */
|
2021-12-17 21:59:34 +00:00
|
|
|
/* renamed from: b.a.n.d$a$a reason: collision with other inner class name */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
|
|
|
public static final class View$OnLayoutChangeListenerC0035a implements View.OnLayoutChangeListener {
|
2021-12-02 18:53:44 +00:00
|
|
|
public final /* synthetic */ View k;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
public View$OnLayoutChangeListenerC0035a(View view) {
|
2021-12-02 18:53:44 +00:00
|
|
|
this.k = view;
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnLayoutChangeListener
|
|
|
|
public void onLayoutChange(View view, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullParameter(view, "view");
|
2021-07-24 02:37:17 +00:00
|
|
|
view.removeOnLayoutChangeListener(this);
|
2022-03-07 09:34:54 +00:00
|
|
|
View findViewWithTag = this.k.findViewWithTag(d.this.m);
|
2021-07-24 02:37:17 +00:00
|
|
|
m.checkNotNullExpressionValue(findViewWithTag, "v.findViewWithTag(anchorViewTag)");
|
2022-03-07 09:34:54 +00:00
|
|
|
d.this.l.b(findViewWithTag);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
public a() {
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
|
|
public void onViewAttachedToWindow(View view) {
|
|
|
|
m.checkNotNullParameter(view, "v");
|
|
|
|
if (!ViewCompat.isLaidOut(view) || view.isLayoutRequested()) {
|
2022-03-07 09:34:54 +00:00
|
|
|
view.addOnLayoutChangeListener(new View$OnLayoutChangeListenerC0035a(view));
|
2021-07-24 02:37:17 +00:00
|
|
|
return;
|
|
|
|
}
|
2022-03-07 09:34:54 +00:00
|
|
|
View findViewWithTag = view.findViewWithTag(d.this.m);
|
2021-07-24 02:37:17 +00:00
|
|
|
m.checkNotNullExpressionValue(findViewWithTag, "v.findViewWithTag(anchorViewTag)");
|
2022-03-07 09:34:54 +00:00
|
|
|
d.this.l.b(findViewWithTag);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
|
|
public void onViewDetachedFromWindow(View view) {
|
2022-03-07 09:34:54 +00:00
|
|
|
if (ViewCompat.isAttachedToWindow(d.this.l)) {
|
|
|
|
d.this.l.setBubbleTouchable(true);
|
|
|
|
d.this.l.a(true);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public d(OverlayManager overlayManager, Function1 function1, OverlayBubbleWrap overlayBubbleWrap, Object obj) {
|
2021-12-02 18:53:44 +00:00
|
|
|
this.j = overlayManager;
|
|
|
|
this.k = function1;
|
|
|
|
this.l = overlayBubbleWrap;
|
|
|
|
this.m = obj;
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
|
|
public final void onClick(View view) {
|
2021-12-02 18:53:44 +00:00
|
|
|
OverlayBubbleWrap overlayBubbleWrap = (OverlayBubbleWrap) this.k.invoke(this.l);
|
2022-03-07 09:34:54 +00:00
|
|
|
overlayBubbleWrap.addOnAttachStateChangeListener(new a());
|
2021-12-02 18:53:44 +00:00
|
|
|
this.j.a(overlayBubbleWrap);
|
|
|
|
this.l.setBubbleTouchable(false);
|
2022-04-04 09:20:14 +00:00
|
|
|
this.j.f2749s.removeViewImmediate(this.l);
|
|
|
|
WindowManager windowManager = this.j.f2749s;
|
2021-12-02 18:53:44 +00:00
|
|
|
OverlayBubbleWrap overlayBubbleWrap2 = this.l;
|
2021-07-24 02:37:17 +00:00
|
|
|
windowManager.addView(overlayBubbleWrap2, overlayBubbleWrap2.getWindowLayoutParams());
|
|
|
|
}
|
|
|
|
}
|