mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-26 22:47:39 +00:00
Reapply filter when reloading app list
This commit is contained in:
parent
cc262d6595
commit
c1e7d74b96
@ -7,6 +7,7 @@ import android.support.annotation.Nullable;
|
|||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@ -43,6 +44,7 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
|
|||||||
private ApplicationAdapter appAdapter;
|
private ApplicationAdapter appAdapter;
|
||||||
|
|
||||||
private SearchView.OnQueryTextListener searchListener;
|
private SearchView.OnQueryTextListener searchListener;
|
||||||
|
private String lastFilter;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
@ -64,12 +66,14 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
|
|||||||
searchListener = new SearchView.OnQueryTextListener() {
|
searchListener = new SearchView.OnQueryTextListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
|
lastFilter = query;
|
||||||
appAdapter.filter(query);
|
appAdapter.filter(query);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
|
lastFilter = newText;
|
||||||
appAdapter.filter(newText);
|
appAdapter.filter(newText);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -109,5 +113,8 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
|
|||||||
appAdapter.setLists(result.listApps, result.hideList);
|
appAdapter.setLists(result.listApps, result.hideList);
|
||||||
recyclerView.setVisibility(View.VISIBLE);
|
recyclerView.setVisibility(View.VISIBLE);
|
||||||
mSwipeRefreshLayout.setRefreshing(false);
|
mSwipeRefreshLayout.setRefreshing(false);
|
||||||
|
if (!TextUtils.isEmpty(lastFilter)) {
|
||||||
|
appAdapter.filter(lastFilter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user