31 lines
1.1 KiB
Java
31 lines
1.1 KiB
Java
package com.discord.utilities.viewcontroller;
|
|
|
|
import android.view.View;
|
|
import d0.z.d.m;
|
|
import kotlin.Unit;
|
|
import rx.Observable;
|
|
import rx.subjects.BehaviorSubject;
|
|
/* compiled from: ViewDetachedFromWindowObservable.kt */
|
|
public final class ViewDetachedFromWindowObservable implements View.OnAttachStateChangeListener {
|
|
private final BehaviorSubject<Unit> onDetachSubject = BehaviorSubject.k0();
|
|
|
|
public ViewDetachedFromWindowObservable(View view) {
|
|
m.checkNotNullParameter(view, "view");
|
|
view.addOnAttachStateChangeListener(this);
|
|
}
|
|
|
|
public final Observable<Unit> observe() {
|
|
BehaviorSubject<Unit> behaviorSubject = this.onDetachSubject;
|
|
m.checkNotNullExpressionValue(behaviorSubject, "onDetachSubject");
|
|
return behaviorSubject;
|
|
}
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
public void onViewAttachedToWindow(View view) {
|
|
}
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
public void onViewDetachedFromWindow(View view) {
|
|
this.onDetachSubject.onNext(Unit.a);
|
|
}
|
|
}
|