use of cz.destil.glasquare.adapter.CheckInSearchAdapter in project glasquare by davidvavra.
the class CheckInSearchActivity method loadData.
@Override
protected void loadData() {
showProgress(R.string.loading);
LocationUtils.getRecentLocation(new LocationUtils.LocationListener() {
@Override
public void onLocationAcquired(Location location) {
String ll = LocationUtils.getLatLon(location);
Api.get().create(SearchVenues.class).searchForCheckIn(ll, new Callback<SearchVenues.SearchResponse>() {
@Override
public void success(SearchVenues.SearchResponse venuesResponse, Response response) {
showContent(new CheckInSearchAdapter(venuesResponse.getVenues()), new CardSelectedListener() {
@Override
public void onCardSelected(Object item) {
SearchVenues.Venue venue = (SearchVenues.Venue) item;
CheckInActivity.call(CheckInSearchActivity.this, venue.id, venue.name);
}
});
}
@Override
public void failure(RetrofitError retrofitError) {
showError(R.string.error_please_try_again);
}
});
}
@Override
public void onLocationFailed() {
showError(R.string.no_location);
}
});
}
Aggregations