{"id":17179267,"url":"https://github.com/bytehamster/searchpreference","last_synced_at":"2025-04-06T19:11:33.744Z","repository":{"id":43728212,"uuid":"129553458","full_name":"ByteHamster/SearchPreference","owner":"ByteHamster","description":"Search inside Android Preferences","archived":false,"fork":false,"pushed_at":"2025-03-21T22:25:02.000Z","size":1076,"stargazers_count":71,"open_issues_count":6,"forks_count":23,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T18:10:01.997Z","etag":null,"topics":["android","android-library","android-settings"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ByteHamster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-14T20:50:41.000Z","updated_at":"2025-03-22T13:33:07.000Z","dependencies_parsed_at":"2023-12-23T12:32:01.414Z","dependency_job_id":"5d89749f-d8ae-4dfb-9cb7-28309e0c0100","html_url":"https://github.com/ByteHamster/SearchPreference","commit_stats":{"total_commits":121,"total_committers":6,"mean_commits":"20.166666666666668","dds":0.09090909090909094,"last_synced_commit":"0c5669a6423292f1653abd9259a4040dad96f84e"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteHamster%2FSearchPreference","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteHamster%2FSearchPreference/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteHamster%2FSearchPreference/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByteHamster%2FSearchPreference/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ByteHamster","download_url":"https://codeload.github.com/ByteHamster/SearchPreference/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535517,"owners_count":20954576,"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","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","android-settings"],"created_at":"2024-10-15T00:25:23.789Z","updated_at":"2025-04-06T19:11:33.720Z","avatar_url":"https://github.com/ByteHamster.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SearchPreference\n\n[![](https://jitpack.io/v/ByteHamster/SearchPreference.svg)](https://jitpack.io/#ByteHamster/SearchPreference)\n\nThis is a library for Android apps that allows to search inside Preference xml files.\nThe library provides a subclass of `Preference` that can be integrated into existing apps easily.\n\n\u003cimg width=\"200\" src=\"https://raw.githubusercontent.com/ByteHamster/PreferenceSearch/master/screenshots/main.png\" /\u003e \u003cimg width=\"200\" src=\"https://raw.githubusercontent.com/ByteHamster/PreferenceSearch/master/screenshots/history.png\" /\u003e \u003cimg width=\"200\" src=\"https://raw.githubusercontent.com/ByteHamster/PreferenceSearch/master/screenshots/suggestions.png\" /\u003e \u003cimg width=\"200\" src=\"https://raw.githubusercontent.com/ByteHamster/PreferenceSearch/master/screenshots/result.png\" /\u003e\n\n## Adding to your app\n\nAdd PreferenceSearch to your `app/build.gradle`:\n\n    dependencies {\n        implementation 'com.github.ByteHamster:SearchPreference:2.7.0'\n    }\n\nAdd PreferenceSearch to your `build.gradle`:\n\n    allprojects {\n        repositories {\n            // ...\n            maven { url 'https://jitpack.io' }\n        }\n    }\n\nAdd search bar to your `preferences.xml` file:\n\n    \u003ccom.bytehamster.lib.preferencesearch.SearchPreference\n        android:key=\"searchPreference\" /\u003e\n        \nDefine search index in your `PreferenceFragment`:\n\n\n    public static class PrefsFragment extends PreferenceFragmentCompat {\n        @Override\n        public void onCreate(Bundle savedInstanceState) {\n            super.onCreate(savedInstanceState);\n            addPreferencesFromResource(R.xml.preferences);\n\n            SearchPreference searchPreference = (SearchPreference) findPreference(\"searchPreference\");\n            SearchConfiguration config = searchPreference.getSearchConfiguration();\n            config.setActivity((AppCompatActivity) getActivity());\n            config.index(R.xml.preferences);\n        }\n    }\n\nAnd react to search results in your Activity:\n\n    public class MyActivity extends AppCompatActivity implements SearchPreferenceResultListener {\n        private PrefsFragment prefsFragment;\n\n        @Override\n        public void onSearchResultClicked(SearchPreferenceResult result) {\n            result.closeSearchPage(this);\n            result.highlight(prefsFragment);\n        }\n    }\n\n## Translations\n\nThis library currently contains only a limited number of translations. If you want to translate\nthe texts shown by the library together with your app's other strings, you can override\nthe strings in the preference xml file using attributes like `search:textNoResults`.\nRefer to [`attrs.xml`](lib/src/main/res/values/attrs.xml) for details.\nYou can also overwrite the strings when constructing the SearchConfiguration object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytehamster%2Fsearchpreference","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytehamster%2Fsearchpreference","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytehamster%2Fsearchpreference/lists"}