public static final class RxNetworkInfoPredicate.Type
extends java.lang.Object
RxNetwork
by network type.
Example usage:
rxnetwork.observe()
.subscribeOn(Schedulers.io())
.filter(hasType(TYPE_WIFI, TYPE_MOBILE))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(...);
| Modifier and Type | Field and Description |
|---|---|
static io.reactivex.functions.Predicate<RxNetworkInfo> |
IS_MOBILE
Predefined predicate for
mobile network type |
static io.reactivex.functions.Predicate<RxNetworkInfo> |
IS_WIFI
Predefined predicate for
wifi network type |
| Modifier and Type | Method and Description |
|---|---|
static io.reactivex.functions.Predicate<RxNetworkInfo> |
hasType(int... networkTypes)
Determines if at least one of provided network types occurred.
|
public static final io.reactivex.functions.Predicate<RxNetworkInfo> IS_MOBILE
mobile network typepublic static final io.reactivex.functions.Predicate<RxNetworkInfo> IS_WIFI
wifi network typepublic static io.reactivex.functions.Predicate<RxNetworkInfo> hasType(int... networkTypes)
networkTypes - one or many NetworkInfo.getType()true if any of the given network states occurred, false otherwise