{"id":13644290,"url":"https://github.com/claudiodegio/MsvSearch","last_synced_at":"2025-04-21T07:30:45.159Z","repository":{"id":80919474,"uuid":"75492620","full_name":"claudiodegio/MsvSearch","owner":"claudiodegio","description":"Material Search View","archived":false,"fork":false,"pushed_at":"2018-01-27T12:28:20.000Z","size":789,"stargazers_count":143,"open_issues_count":3,"forks_count":36,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-09T16:44:13.283Z","etag":null,"topics":["android","library","material","material-search"],"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/claudiodegio.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,"governance":null}},"created_at":"2016-12-03T18:32:05.000Z","updated_at":"2024-10-06T18:06:38.000Z","dependencies_parsed_at":"2023-02-28T22:01:40.951Z","dependency_job_id":null,"html_url":"https://github.com/claudiodegio/MsvSearch","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiodegio%2FMsvSearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiodegio%2FMsvSearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiodegio%2FMsvSearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiodegio%2FMsvSearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claudiodegio","download_url":"https://codeload.github.com/claudiodegio/MsvSearch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250014568,"owners_count":21360975,"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","library","material","material-search"],"created_at":"2024-08-02T01:02:00.734Z","updated_at":"2025-04-21T07:30:43.911Z","avatar_url":"https://github.com/claudiodegio.png","language":"Java","readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Material%20Search%20View-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/4765)\n\n# Material Search View\nCute library to implement SearchView in a Material Design Approach. *Works from Android API 14 (ICS) and above*.\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.claudiodegio.sample.msv\"\u003e\n  \u003cimg alt=\"Get it on Google Play\"\n       src=\"https://developer.android.com/images/brand/en_generic_rgb_wo_60.png\" /\u003e\n\u003c/a\u003e\n\n![sample](https://raw.githubusercontent.com/claudiodegio/MsvSearch/master/screen/Resized-1.png)\n![sample](https://raw.githubusercontent.com/claudiodegio/MsvSearch/master/screen/Resized-2.png)\n![sample](https://raw.githubusercontent.com/claudiodegio/MsvSearch/master/screen/Resized-3.png)\n![sample](https://raw.githubusercontent.com/claudiodegio/MsvSearch/master/screen/Resized-4.png)\n\n\n# Usage\n**Add the dependencies to your gradle file:**\n```javascript\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\ndependencies {\n        compile 'com.github.claudiodegio:MsvSearch:1.0.0'\n}\n```\n**Add MaterialSearchView to your layout file along with the Toolbar** *(Add this block at the bottom of your layout, in order to display it over the rest of the view)*:\n\n```xml\n\u003c!— Must be last for right layering display —\u003e\n\u003cFrameLayout\n    android:id=\"@+id/toolbar_container\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\u003e\n\n    \u003candroid.support.v7.widget.Toolbar\n        android:id=\"@+id/toolbar\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"?attr/actionBarSize\"\n        android:background=\"@color/theme_primary\" /\u003e\n\n   \u003ccom.claudiodegio.msv.MaterialSearchView\n        android:id=\"@+id/sv\"\n        android:elevation=\"5dip\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\u003e\n    \u003c/com.claudiodegio.msv.MaterialSearchView\u003e\n\u003c/FrameLayout\u003e\n```\n\n**Create a menu resource file and add the search item into the menu file:**\n```xml\n\t\u003cmenu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\u003e\n\n        \u003citem\n            android:id=\"@+id/action_search\"\n            android:title=\"Search\"\n            android:icon=\"@drawable/ic_magnify_white_24dp\"\n            app:showAsAction=\"always\"\n            /\u003e\n    \u003c/menu\u003e\n```\n**Add define it in the *onCreateOptionsMenu*:**\n```java\n\t@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n        getMenuInflater().inflate(R.menu.menu_main, menu);\n\n        MenuItem item = menu.findItem(R.id.action_search);\n        searchView.setMenuItem(item);\n\n        return true;\n    }\n```\n\n**Implement following methods from OnSearchViewListener**\n```java\n    @Override\n    public void onSearchViewShown() {\n\n    }\n\n    @Override\n    public void onSearchViewClosed() {\n\n    }\n\n    @Override\n    public boolean onQueryTextSubmit(String query) {\n        // handle text submit and then return true\n        return false;\n    }\n\n    @Override\n    public void onQueryTextChange(String newText) {\n\n    }\n```\n**Hook your OnSearchViewListener and don't forget to add toolbar and set it as support action bar!!**\n```java\n    @Override\n    protected void onCreate(@Nullable Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.test_msv_simple);\n\n        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n        setSupportActionBar(toolbar);\n\n        mSearchView = (MaterialSearchView) findViewById(R.id.sv);\n        mSearchView.setOnSearchViewListener(this); // this class implements OnSearchViewListener\n    }\n```\n\n**More detailed and advanced examples coming soon!**\n\n\n\n# Help me\nPull requests are more than welcome, help me and others improve this awesome library.\n\n# License\n\tCopyright 2016 Claudio Degioanni\n\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\n\t\thttp://www.apache.org/licenses/LICENSE-2.0\n\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.","funding_links":[],"categories":["SearchView"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaudiodegio%2FMsvSearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaudiodegio%2FMsvSearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaudiodegio%2FMsvSearch/lists"}