We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello There, I am using this library which is really helpful, but I am stuck on one thing. How to implement Search functionality in this library.
Right now I am trying and it is not giving me correct position when filterable is active other than this it is giving correct
Filter code is here bwllow
` @OverRide public Filter getFilter() { return new Filter() { @SuppressWarnings("unchecked") @OverRide protected void publishResults(CharSequence constraint, FilterResults results) { dummyList = (List) results.values; notifyDataSetChanged(); }
@Override protected FilterResults performFiltering(CharSequence constraint) { List<GetByModel> filteredResults = null; if (constraint.length() == 0) { filtered = groupList; filteredResults = groupList; } else { filteredResults = getFilteredResults(constraint.toString().toLowerCase()); } FilterResults results = new FilterResults(); results.values = filteredResults; return results; } }; } protected List<GetByModel> getFilteredResults(String constraint) { List<GetByModel> results = new ArrayList<>(); for (GetByModel item : dummyList) { for (GenericModelFilterSelection genericModelFilterSelection : item.getGenericModels()) { if (genericModelFilterSelection.getName().toLowerCase().contains(constraint)) { if (!results.contains(item)) { results.add(item); } } } } return results; }
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello There,
I am using this library which is really helpful, but I am stuck on one thing. How to implement Search functionality in this library.
Right now I am trying and it is not giving me correct position when filterable is active other than this it is giving correct
Filter code is here bwllow
` @OverRide
public Filter getFilter() {
return new Filter() {
@SuppressWarnings("unchecked")
@OverRide
protected void publishResults(CharSequence constraint, FilterResults results) {
dummyList = (List) results.values;
notifyDataSetChanged();
}
`
The text was updated successfully, but these errors were encountered: