Commit 549093af authored by Varun Patil's avatar Varun Patil

Show loading spinner while searching in explore

parent e0358034
...@@ -94,6 +94,8 @@ public class ExploreFragment extends Fragment { ...@@ -94,6 +94,8 @@ public class ExploreFragment extends Fragment {
@Override @Override
public void onFailure(Call<List<Body>> call, Throwable t) {} public void onFailure(Call<List<Body>> call, Throwable t) {}
}); });
} else {
getView().findViewById(R.id.loadingPanel).setVisibility(View.GONE);
} }
// Search on text change in search // Search on text change in search
...@@ -126,6 +128,10 @@ public class ExploreFragment extends Fragment { ...@@ -126,6 +128,10 @@ public class ExploreFragment extends Fragment {
public void doSearch(String query) { public void doSearch(String query) {
if (getActivity() == null || getView() == null) return; if (getActivity() == null || getView() == null) return;
// Show loading spinner
getView().findViewById(R.id.loadingPanel).setVisibility(View.VISIBLE);
// Make request
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class); RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
retrofitInterface.search(sessionId, query).enqueue(new Callback<ExploreResponse>() { retrofitInterface.search(sessionId, query).enqueue(new Callback<ExploreResponse>() {
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment