If you think the Android project android-async-google-places listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package io.github.axxiss.places.request;
//fromwww.java2s.comimport java.util.List;
import io.github.axxiss.places.callback.PlacesCallback;
import io.github.axxiss.places.enums.Params;
import io.github.axxiss.places.enums.PlaceType;
import io.github.axxiss.places.enums.Request;
/**
* Base class for search request.
*
* @author Axxiss
*/publicabstractclass BaseSearch {
/**
* Places request parameters.
*/protected PlaceParams params = new PlaceParams();
/**
* The request type.
*/private Request mRequest;
protected BaseSearch(Request request) {
mRequest = request;
}
public BaseSearch setMinPrice(double price) {
params.put(Params.MinPrice, price);
returnthis;
}
public BaseSearch setMaxPrice(double price) {
params.put(Params.MaxPrice, price);
returnthis;
}
public BaseSearch setLocation(double lat, double lng) {
params.put(Params.Location, PlaceParams.buildLocation(lat, lng));
returnthis;
}
public BaseSearch setZagatSelected() {
params.put(Params.ZagatSelected);
returnthis;
}
public BaseSearch setSetOpenNow(boolean open) {
params.put(Params.OpenNow, open);
returnthis;
}
public BaseSearch setType(List<PlaceType> types) {
params.put(Params.Types, types);
returnthis;
}
publicvoid sendRequest(final PlacesCallback callback) {
PlacesClient.sendRequest(mRequest, params, callback);
}
}