public final class ViewObservable
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> rx.Observable<T> |
bindView(android.view.View view,
rx.Observable<T> source)
Binds the given source sequence to the view.
|
static rx.Observable<OnClickEvent> |
clicks(android.view.View view) |
static rx.Observable<OnClickEvent> |
clicks(android.view.View view,
boolean emitInitialValue) |
public static rx.Observable<OnClickEvent> clicks(android.view.View view)
public static rx.Observable<OnClickEvent> clicks(android.view.View view, boolean emitInitialValue)
public static <T> rx.Observable<T> bindView(android.view.View view, rx.Observable<T> source)
This helper will schedule the given sequence to be observed on the main UI thread and ensure that no notifications will be forwarded to the view in case it gets detached from its the window.
Unlike AppObservable.bindActivity(android.app.Activity, rx.Observable<T>)
or AppObservable.bindFragment(java.lang.Object, rx.Observable<T>)
, you don't have to unsubscribe the returned Observable
on the detachment. bindView(android.view.View, rx.Observable<T>)
does it automatically.
That means that the subscriber doesn't see further sequence even if the view is recycled and
attached again.
view
- the view to bind the source sequence tosource
- the source sequence