com.firebase.geofire.GeoQuery Java Examples

The following examples show how to use com.firebase.geofire.GeoQuery. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RxGeoFenceOnSubscribe.java    From android-rxgeofence with MIT License 6 votes vote down vote up
private void listen(GeoQueryWrapper<Place> wrapper,
    final Subscriber<? super GeoFenceEvent> subscriber) {

  GeoQuery geoQuery = wrapper.getGeoQuery();
  geoQuery.addGeoQueryEventListener(new PlaceGeoQueryEventListener(wrapper.getData()) {
    @Override public void onChange(GeoFenceType type, String key, Place place) {
      if (key.equalsIgnoreCase(userKey)) {
        subscriber.onNext(new GeoFenceEvent(key, place, type));
      }
    }

    @Override public void onGeoQueryError(DatabaseError error) {
      subscriber.onError(new GeoFenceError(error));
    }
  });
  queries.add(wrapper);
}
 
Example #2
Source File: RxGeoFenceOnSubscribe.java    From android-rxgeofence with MIT License 5 votes vote down vote up
private void stopListen() {
  for (GeoQueryWrapper<Place> wrapper : queries) {
    GeoQuery geoQuery = wrapper.getGeoQuery();
    geoQuery.removeAllListeners();
  }
  queries.clear();
}
 
Example #3
Source File: GeoQueryWrapper.java    From android-rxgeofence with MIT License 4 votes vote down vote up
public GeoQueryWrapper(GeoQuery geoQuery, T data) {
  this.geoQuery = geoQuery;
  this.data = data;
}
 
Example #4
Source File: GeoQueryWrapper.java    From android-rxgeofence with MIT License 4 votes vote down vote up
public GeoQuery getGeoQuery() {
  return geoQuery;
}