public final class AndroidObservable
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> rx.Observable<T> |
bindActivity(android.app.Activity activity,
rx.Observable<T> source)
Binds the given source sequence to an activity.
|
static <T> rx.Observable<T> |
bindFragment(java.lang.Object fragment,
rx.Observable<T> source)
Binds the given source sequence to a fragment (native or support-v4).
|
static rx.Observable<android.content.Intent> |
fromBroadcast(android.content.Context context,
android.content.IntentFilter filter)
Create Observable that wraps BroadcastReceiver and emmit received intents.
|
static rx.Observable<android.content.Intent> |
fromBroadcast(android.content.Context context,
android.content.IntentFilter filter,
java.lang.String broadcastPermission,
android.os.Handler schedulerHandler)
Create Observable that wraps BroadcastReceiver and emmit received intents.
|
static rx.Observable<android.content.Intent> |
fromLocalBroadcast(android.content.Context context,
android.content.IntentFilter filter)
Create Observable that wraps BroadcastReceiver and connects to LocalBroadcastManager
to emmit received intents.
|
static rx.Observable<java.lang.String> |
fromSharedPreferencesChanges(android.content.SharedPreferences sharedPreferences)
Create Observable that emits String keys whenever it changes in provided SharedPreferences
Items will be observed on the main Android UI thread
|
public static <T> rx.Observable<T> bindActivity(android.app.Activity activity, rx.Observable<T> source)
activity
- the activity to bind the source sequence tosource
- the source sequencepublic static <T> rx.Observable<T> bindFragment(java.lang.Object fragment, rx.Observable<T> source)
fragment
- the fragment to bind the source sequence tosource
- the source sequencepublic static rx.Observable<android.content.Intent> fromBroadcast(android.content.Context context, android.content.IntentFilter filter)
filter
- Selects the Intent broadcasts to be received.public static rx.Observable<android.content.Intent> fromBroadcast(android.content.Context context, android.content.IntentFilter filter, java.lang.String broadcastPermission, android.os.Handler schedulerHandler)
filter
- Selects the Intent broadcasts to be received.broadcastPermission
- String naming a permissions that a
broadcaster must hold in order to send an Intent to you. If null,
no permission is required.schedulerHandler
- Handler identifying the thread that will receive
the Intent. If null, the main thread of the process will be used.public static rx.Observable<android.content.Intent> fromLocalBroadcast(android.content.Context context, android.content.IntentFilter filter)
filter
- Selects the Intent broadcasts to be received.public static rx.Observable<java.lang.String> fromSharedPreferencesChanges(android.content.SharedPreferences sharedPreferences)