2021-07-19 19:45:22 +00:00
package c.a.y ;
2021-06-27 20:44:35 +00:00
import android.animation.Animator ;
import android.content.Context ;
import android.util.Log ;
import android.view.View ;
import androidx.core.view.ViewCompat ;
import com.discord.app.AppComponent ;
import com.discord.overlay.views.OverlayDialog ;
import d0.z.d.m ;
import kotlin.Unit ;
import kotlin.jvm.functions.Function1 ;
import rx.subjects.PublishSubject ;
import rx.subjects.Subject ;
/* compiled from: OverlayAppDialog.kt */
public abstract class k extends OverlayDialog implements AppComponent {
public final Subject < Void , Void > w ;
/* renamed from: x reason: collision with root package name */
2021-07-22 07:57:51 +00:00
public Function1 < ? super OverlayDialog , Unit > f239x = l . i ;
2021-06-27 20:44:35 +00:00
/* compiled from: Animator.kt */
public static final class a implements Animator . AnimatorListener {
public final /* synthetic */ k a ;
public a ( k kVar ) {
this . a = kVar ;
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationCancel ( Animator animator ) {
m . checkParameterIsNotNull ( animator , " animator " ) ;
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationEnd ( Animator animator ) {
m . checkParameterIsNotNull ( animator , " animator " ) ;
this . a . getOnDialogClosed ( ) . invoke ( this . a ) ;
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationRepeat ( Animator animator ) {
m . checkParameterIsNotNull ( animator , " animator " ) ;
}
@Override // android.animation.Animator.AnimatorListener
public void onAnimationStart ( Animator animator ) {
m . checkParameterIsNotNull ( animator , " animator " ) ;
}
}
/* compiled from: OverlayAppDialog.kt */
public static final class b implements View . OnAttachStateChangeListener {
public final /* synthetic */ Animator i ;
public b ( Animator animator ) {
this . i = animator ;
}
@Override // android.view.View.OnAttachStateChangeListener
public void onViewAttachedToWindow ( View view ) {
}
@Override // android.view.View.OnAttachStateChangeListener
public void onViewDetachedFromWindow ( View view ) {
this . i . end ( ) ;
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public k ( Context context ) {
super ( context ) ;
m . checkNotNullParameter ( context , " context " ) ;
2021-07-03 23:36:06 +00:00
PublishSubject k0 = PublishSubject . k0 ( ) ;
m . checkNotNullExpressionValue ( k0 , " PublishSubject.create() " ) ;
this . w = k0 ;
2021-06-27 20:44:35 +00:00
setOnClickListener ( new j ( this ) ) ;
}
public final void g ( ) {
getUnsubscribeSignal ( ) . onNext ( null ) ;
Log . i ( getClass ( ) . getSimpleName ( ) , " closing " ) ;
if ( ! ViewCompat . isAttachedToWindow ( this ) ) {
2021-07-22 07:57:51 +00:00
this . f239x . invoke ( this ) ;
2021-06-27 20:44:35 +00:00
return ;
}
Animator closingAnimator = getClosingAnimator ( ) ;
closingAnimator . addListener ( new a ( this ) ) ;
closingAnimator . start ( ) ;
addOnAttachStateChangeListener ( new b ( closingAnimator ) ) ;
}
public abstract Animator getClosingAnimator ( ) ;
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.overlay.views.OverlayDialog, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.overlay.views.OverlayDialog, kotlin.Unit> */
public final Function1 < OverlayDialog , Unit > getOnDialogClosed ( ) {
2021-07-22 07:57:51 +00:00
return this . f239x ;
2021-06-27 20:44:35 +00:00
}
@Override // com.discord.app.AppComponent
public Subject < Void , Void > getUnsubscribeSignal ( ) {
return this . w ;
}
@Override // android.view.View, android.view.ViewGroup
public void onDetachedFromWindow ( ) {
getUnsubscribeSignal ( ) . onNext ( null ) ;
super . onDetachedFromWindow ( ) ;
}
public final void setOnDialogClosed ( Function1 < ? super OverlayDialog , Unit > function1 ) {
m . checkNotNullParameter ( function1 , " <set-?> " ) ;
2021-07-22 07:57:51 +00:00
this . f239x = function1 ;
2021-06-27 20:44:35 +00:00
}
}