2021-12-17 22:01:24 +00:00
|
|
|
package b.a.n;
|
2021-08-09 22:50:52 +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-01 07:19:03 +00:00
|
|
|
import d0.z.d.m;
|
2021-08-09 22:50:52 +00:00
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
/* compiled from: OverlayManager.kt */
|
|
|
|
public final class d implements View.OnClickListener {
|
2021-12-17 22:01:24 +00:00
|
|
|
public final /* synthetic */ OverlayManager j;
|
|
|
|
public final /* synthetic */ Function1 k;
|
|
|
|
public final /* synthetic */ OverlayBubbleWrap l;
|
|
|
|
public final /* synthetic */ Object m;
|
2021-08-09 22:50:52 +00:00
|
|
|
|
|
|
|
/* compiled from: OverlayManager.kt */
|
|
|
|
public static final class a implements View.OnAttachStateChangeListener {
|
2021-12-17 22:01:24 +00:00
|
|
|
public final /* synthetic */ d j;
|
2021-08-09 22:50:52 +00:00
|
|
|
|
|
|
|
/* compiled from: View.kt */
|
2021-12-17 22:01:24 +00:00
|
|
|
/* renamed from: b.a.n.d$a$a reason: collision with other inner class name */
|
|
|
|
public static final class View$OnLayoutChangeListenerC0028a implements View.OnLayoutChangeListener {
|
|
|
|
public final /* synthetic */ a j;
|
|
|
|
public final /* synthetic */ View k;
|
2021-08-09 22:50:52 +00:00
|
|
|
|
2021-12-17 22:01:24 +00:00
|
|
|
public View$OnLayoutChangeListenerC0028a(a aVar, View view) {
|
|
|
|
this.j = aVar;
|
|
|
|
this.k = view;
|
2021-08-09 22:50:52 +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-21 07:33:49 +00:00
|
|
|
m.checkNotNullParameter(view, "view");
|
2021-08-09 22:50:52 +00:00
|
|
|
view.removeOnLayoutChangeListener(this);
|
2021-12-17 22:01:24 +00:00
|
|
|
View findViewWithTag = this.k.findViewWithTag(this.j.j.m);
|
2021-08-09 22:50:52 +00:00
|
|
|
m.checkNotNullExpressionValue(findViewWithTag, "v.findViewWithTag(anchorViewTag)");
|
2021-12-17 22:01:24 +00:00
|
|
|
this.j.j.l.b(findViewWithTag);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public a(d dVar) {
|
2021-12-17 22:01:24 +00:00
|
|
|
this.j = dVar;
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
|
|
public void onViewAttachedToWindow(View view) {
|
|
|
|
m.checkNotNullParameter(view, "v");
|
|
|
|
if (!ViewCompat.isLaidOut(view) || view.isLayoutRequested()) {
|
2021-12-17 22:01:24 +00:00
|
|
|
view.addOnLayoutChangeListener(new View$OnLayoutChangeListenerC0028a(this, view));
|
2021-08-09 22:50:52 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-12-17 22:01:24 +00:00
|
|
|
View findViewWithTag = view.findViewWithTag(this.j.m);
|
2021-08-09 22:50:52 +00:00
|
|
|
m.checkNotNullExpressionValue(findViewWithTag, "v.findViewWithTag(anchorViewTag)");
|
2021-12-17 22:01:24 +00:00
|
|
|
this.j.l.b(findViewWithTag);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
|
|
public void onViewDetachedFromWindow(View view) {
|
2021-12-17 22:01:24 +00:00
|
|
|
if (ViewCompat.isAttachedToWindow(this.j.l)) {
|
|
|
|
this.j.l.setBubbleTouchable(true);
|
|
|
|
this.j.l.a(true);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public d(OverlayManager overlayManager, Function1 function1, OverlayBubbleWrap overlayBubbleWrap, Object obj) {
|
2021-12-17 22:01:24 +00:00
|
|
|
this.j = overlayManager;
|
|
|
|
this.k = function1;
|
|
|
|
this.l = overlayBubbleWrap;
|
|
|
|
this.m = obj;
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
|
|
public final void onClick(View view) {
|
2021-12-17 22:01:24 +00:00
|
|
|
OverlayBubbleWrap overlayBubbleWrap = (OverlayBubbleWrap) this.k.invoke(this.l);
|
2021-08-09 22:50:52 +00:00
|
|
|
overlayBubbleWrap.addOnAttachStateChangeListener(new a(this));
|
2021-12-17 22:01:24 +00:00
|
|
|
this.j.a(overlayBubbleWrap);
|
|
|
|
this.l.setBubbleTouchable(false);
|
|
|
|
this.j.f2713s.removeViewImmediate(this.l);
|
|
|
|
WindowManager windowManager = this.j.f2713s;
|
|
|
|
OverlayBubbleWrap overlayBubbleWrap2 = this.l;
|
2021-08-09 22:50:52 +00:00
|
|
|
windowManager.addView(overlayBubbleWrap2, overlayBubbleWrap2.getWindowLayoutParams());
|
|
|
|
}
|
|
|
|
}
|