From d285115090620a9d668f3505fee37090dc671e60 Mon Sep 17 00:00:00 2001 From: M M Arif Date: Thu, 10 Oct 2019 19:01:15 +0500 Subject: [PATCH] reset the adapter on new query --- .../mian/gitnex/fragments/ExploreRepositoriesFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mian/gitnex/fragments/ExploreRepositoriesFragment.java b/app/src/main/java/org/mian/gitnex/fragments/ExploreRepositoriesFragment.java index bf5c853d..cfe44e82 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/ExploreRepositoriesFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/ExploreRepositoriesFragment.java @@ -48,6 +48,8 @@ public class ExploreRepositoriesFragment extends Fragment { private String sort = "updated"; private String order = "asc"; + private ExploreRepositoriesAdapter adapter; + private OnFragmentInteractionListener mListener; public ExploreRepositoriesFragment() { @@ -99,6 +101,7 @@ public class ExploreRepositoriesFragment extends Fragment { if (actionId == EditorInfo.IME_ACTION_SEND) { if(!searchKeyword.getText().toString().equals("")) { mProgressBar.setVisibility(View.VISIBLE); + mRecyclerView.setVisibility(View.GONE); loadSearchReposList(instanceUrl, instanceToken, loginUid, searchKeyword.getText().toString(), repoTypeInclude, sort, order, getContext()); } } @@ -147,7 +150,9 @@ public class ExploreRepositoriesFragment extends Fragment { private void getReposList(List dataList, Context context) { - ExploreRepositoriesAdapter adapter = new ExploreRepositoriesAdapter(dataList, context); + adapter = new ExploreRepositoriesAdapter(dataList, context); + + mRecyclerView.setVisibility(View.VISIBLE); mRecyclerView.setHasFixedSize(true); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));