use of cz.destil.glasquare.adapter.VenuesAdapter in project glasquare by davidvavra.
the class VenueListActivity method searchVenues.
private void searchVenues(String ll) {
Callback<ExploreVenues.ExploreVenuesResponse> callback = new Callback<ExploreVenues.ExploreVenuesResponse>() {
@Override
public void success(ExploreVenues.ExploreVenuesResponse exploreVenuesResponse, Response response) {
if (exploreVenuesResponse.getVenues().size() == 0) {
showError(R.string.no_venues_found);
} else {
showContent(new VenuesAdapter(exploreVenuesResponse.getVenues()), new CardSelectedListener() {
@Override
public void onCardSelected(Object item) {
mSelectedVenue = (ExploreVenues.Venue) item;
openOptionsMenu();
}
});
}
}
@Override
public void failure(RetrofitError retrofitError) {
showError(R.string.error_please_try_again);
DebugLog.e(retrofitError);
}
};
int type = getIntent().getIntExtra(EXTRA_TYPE, TYPE_EXPLORE);
switch(type) {
case TYPE_EXPLORE:
Api.get().create(ExploreVenues.class).best(ll, callback);
break;
case TYPE_SEARCH:
String query = getIntent().getStringExtra(EXTRA_QUERY);
Api.get().create(ExploreVenues.class).search(ll, query, callback);
break;
}
}
Aggregations