use of app.insti.api.response.ExploreResponse in project IITB-App by wncc.
the class ExploreFragment method doSearch.
public void doSearch(final String query) {
if (getActivity() == null || getView() == null)
return;
// Set the lastest query
currentQuery = query;
// Make request
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.search(sessionId, query).enqueue(new EmptyCallback<ExploreResponse>() {
@Override
public void onResponse(Call<ExploreResponse> call, Response<ExploreResponse> response) {
// Check if we already have a new query pending
if (!currentQuery.equals(query)) {
return;
}
// Get data
bodies = response.body().getBodies();
events = response.body().getEvents();
users = response.body().getUsers();
updateAdapter(bodies, events, users);
}
});
}
Aggregations