{"id":22612316,"url":"https://github.com/utsavdotpro/searchablelistdialog","last_synced_at":"2026-05-17T15:33:17.608Z","repository":{"id":37944029,"uuid":"347691634","full_name":"utsavdotpro/SearchableListDialog","owner":"utsavdotpro","description":"Bottom Dialog Searchable List built with Material.io","archived":false,"fork":false,"pushed_at":"2022-06-22T18:53:42.000Z","size":3427,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T23:46:09.411Z","etag":null,"topics":["android","android-library","java","listview","search-list-view"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utsavdotpro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-14T16:35:57.000Z","updated_at":"2023-06-14T21:04:48.000Z","dependencies_parsed_at":"2022-08-26T21:27:53.301Z","dependency_job_id":null,"html_url":"https://github.com/utsavdotpro/SearchableListDialog","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/utsavdotpro/SearchableListDialog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsavdotpro%2FSearchableListDialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsavdotpro%2FSearchableListDialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsavdotpro%2FSearchableListDialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsavdotpro%2FSearchableListDialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utsavdotpro","download_url":"https://codeload.github.com/utsavdotpro/SearchableListDialog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utsavdotpro%2FSearchableListDialog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012516,"owners_count":26085134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","java","listview","search-list-view"],"created_at":"2024-12-08T17:12:16.937Z","updated_at":"2025-10-12T18:38:17.446Z","avatar_url":"https://github.com/utsavdotpro.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://jitpack.io/v/utsavdotpro/SearchableListDialog.svg)](https://jitpack.io/#utsavdotpro/SearchableListDialog)\n# SearchableListDialog\nBottom Dialog Searchable List built with Material.io with custom search bar and custom list item view.\n\n## Sample\n| | |\n| - | - |\n| \u003cimg src=\"./samples/demo.gif\" height=\"350\"\u003e | \u003cimg src=\"./samples/preview1.png\" height=\"350\"\u003e |\n| \u003cimg src=\"./samples/preview2.png\" height=\"350\"\u003e | \u003cimg src=\"./samples/preview3.png\" height=\"350\"\u003e |\n\n## Features\n\n - Works with literally any type of data\n - One-on-one comparison\n - Auto empty view\n - Portable\n - Clean UI\n - Pre-optimized\n - Easy to use\n - Lightweight\n\n---\n\n## Implementation\n**Step 1:** Add to project level build.gradle\n\n```gradle\nallprojects {\n  repositories {\n    ...\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\n\n**Step 2:** Add to app level build.gradle\n\n```gradle\ndependencies {\n  implementation 'com.github.utsavdotpro:SearchableListDialog:VERSION'\n}\n```\n\n---\n\n## How to use?\nIn this example, I am creating a \u003ci\u003edialog search list for a list of customers with their name and business name\u003c/i\u003e. You can easily understand how it works from the example and implement according to your requirements.    \n\n- You can use any kind of object to populate and search for in the list\n- Here, I have created a simple object `Customer` with basic setters and getters\n\n\u003e You can also check out the [example app](https://github.com/utsavdotpro/SearchableListDialog/tree/main/app/src/main/java/com/isolpro/searchablelistdialoglibrary)\n\n\n### Creating List Adapter\nSearchableListAdapter is built from BaseAdapter with only addition of `setItems()` and `getItems()` methods\n\n```java\npublic class CustomersSearchableListAdapter extends SearchableListAdapter\u003cCustomer\u003e {\n  private final Context context;\n  private List\u003cCustomer\u003e customerList = new ArrayList\u003c\u003e();\n\n  public CustomersSearchableListAdapter(Context context) {\n    this.context = context;\n  }\n\n  @Override\n  public int getCount() {\n    return customerList.size();\n  }\n\n  @Override\n  public Customer getItem(int position) {\n    return customerList.get(position);\n  }\n\n  @Override\n  public long getItemId(int position) {\n    return customerList.get(position).getId();\n  }\n\n  @Override\n  public View getView(int position, View convertView, ViewGroup parent) {\n    ViewHolder holder = createNewOrGetExistingViewHolder(convertView);\n\n    holder.populateView(getItem(position));\n\n    convertView = holder.getBinding().getRoot();\n    convertView.setTag(holder);\n\n    return convertView;\n  }\n\n  private ViewHolder createNewOrGetExistingViewHolder(View view) {\n    if (view != null)\n      return (ViewHolder) view.getTag();\n\n    ListCustomerItemBinding binding = ListCustomerItemBinding.inflate(LayoutInflater.from(context));\n\n    return new ViewHolder(binding);\n  }\n\n  @Override\n  public List\u003cCustomer\u003e getItems() {\n    return customerList;\n  }\n\n  @Override\n  public void setItems(List\u003cCustomer\u003e customerList) {\n    this.customerList = customerList;\n    notifyDataSetChanged();\n  }\n\n  public class ViewHolder {\n\n    private final ListCustomerItemBinding binding;\n\n    public ViewHolder(ListCustomerItemBinding binding) {\n      this.binding = binding;\n    }\n\n    public ListCustomerItemBinding getBinding() {\n      return binding;\n    }\n\n    public void populateView(Customer customer) {\n      binding.tvName.setText(customer.getName());\n      binding.tvBusinessName.setText(customer.getBusinessName());\n    }\n  }\n}\n```\n\n### Creating Dialog\n\n```java\nprivate CustomersSearchableListAdapter customersListAdapter;\nprivate SearchableListDialog\u003cCustomer\u003e dialogListCustomers;\n\ncustomersListAdapter = new CustomersSearchableListAdapter(activity);\ndialogListCustomers = new SearchableListDialog\u003c\u003e(activity, customersListAdapter);\n```\n\n### Setting Items\nCareful! Make sure you set the items to you `dialogListCustomers` and not `customersListAdapter`\n\n```java\n    dialogListCustomers.setItems(customerList);\n```\n\n### Defining Search Matcher\nSince SLD doesn't work with any specific object type, you have to define your own matcher(). This gives SLD its portability and you freedom to compare any way you like.\n\n```java\ndialogListCustomers.setSearchMatcher((customer, keyword) -\u003e {\n  return customer.getName().toLowerCase().contains(keyword);\n  // return true if matched, else false\n});\n```\n\n### Listening to Item Selection\n\n```java\ndialogListCustomers.setOnItemSelectedListener(customer -\u003e {\n  // to whatever you like with the selected item (customer in this case)\n});\n```\n\n---\n\n\u003e P.s. If you need me to write a better documentation, ping me at contact@utsav.pro\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futsavdotpro%2Fsearchablelistdialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futsavdotpro%2Fsearchablelistdialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futsavdotpro%2Fsearchablelistdialog/lists"}