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