Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fanmixco/xamarin-searchbar
Material Design Search Bar for Android, based on Mansur Nashaev's version
https://github.com/fanmixco/xamarin-searchbar
android android-library androidx androidx-library java-to-csharp material material-design nuget nuget-package reverse-engineering search search-bar searchbar ui view xamarin xamarin-android xamarin-library xamarin-searchbar
Last synced: 3 months ago
JSON representation
Material Design Search Bar for Android, based on Mansur Nashaev's version
- Host: GitHub
- URL: https://github.com/fanmixco/xamarin-searchbar
- Owner: FANMixco
- License: mit
- Created: 2019-06-26T18:02:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-19T07:03:30.000Z (4 months ago)
- Last Synced: 2024-11-07T10:03:10.239Z (3 months ago)
- Topics: android, android-library, androidx, androidx-library, java-to-csharp, material, material-design, nuget, nuget-package, reverse-engineering, search, search-bar, searchbar, ui, view, xamarin, xamarin-android, xamarin-library, xamarin-searchbar
- Language: C#
- Homepage: https://fanmixco.github.io/Xamarin-SearchBar/
- Size: 851 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Xamarin-Material SearchBar Android
Material Design Search Bar for Android.[![.NET](https://github.com/FANMixco/Xamarin-SearchBar/actions/workflows/dotnet.yml/badge.svg)](https://github.com/FANMixco/Xamarin-SearchBar/actions/workflows/dotnet.yml)
|Latest Release|Downloads|
|:------------:|:------------:|
|[![NuGet Badge Xamarin-MaterialSearchBar](https://img.shields.io/nuget/v/Xamarin-MaterialSearchBar)](https://www.nuget.org/packages/Xamarin-MaterialSearchBar/)|[![NuGet Badge SpotsDialog.Xamarin](https://img.shields.io/nuget/dt/Xamarin-MaterialSearchBar)](https://www.nuget.org/packages/Xamarin-MaterialSearchBar/)|This version is **based on** the fantastic version created by: Mansur Nashaev
This beautiful and easy to use library will help to add Lollipop Material Design SearchView in your project.
***
### Read the Wiki for advanced examples and options.
***
But now, let's go deep into some code!
### Basic example:
First to add Xamarin-MaterialSearchBar into your project you need to download the package from NuGet.
Next edit your XML and add the custom control:
```xml
```
After that you can edit your activity and add the following piece of code:```csharp
public partial class YourClassActivity : AppCompatActivity, MaterialSearchBar.IOnSearchActionListener
{
private MaterialSearchBar MSearchBar { get; set; }protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);MSearchBar = FindViewById(Resource.Id.searchBar);
MSearchBar.SetOnSearchActionListener(this);
MSearchBar.AddTextChangeListener(new MaterialSearchBarListener());
}void MaterialSearchBar.IOnSearchActionListener.OnButtonClicked(int p0)
{
switch (p0)
{
case MaterialSearchBar.ButtonNavigation:
Drawer.OpenDrawer((int)GravityFlags.Left);
break;
case MaterialSearchBar.ButtonSpeech:
break;
case MaterialSearchBar.ButtonBack:
MSearchBar.DisableSearch();
break;
}
}
}public partial class YourClassActivity
{
private class MaterialSearchBarListener : Java.Lang.Object, ITextWatcher
{
public void AfterTextChanged(IEditable s)
{}
public void BeforeTextChanged(ICharSequence s, int start, int count, int after)
{}
public void OnTextChanged(ICharSequence s, int start, int before, int count)
{
//Here you can execute the query with the texted data.
}
}
}
```### Follow me at:
| LinkedIn |YouTube|Amazon|Goodreads|Instagram|Cyber Prophets|Sharing Your Stories|
|:----------|:------------:|:------------:|:------------:|:------------:|:------------:|:------------:|
|[![LinkedIn](https://i.sstatic.net/idQWu.png)](https://bit.ly/lfanmixco)|[![YouTube](https://i.sstatic.net/CFPMR.png)](https://youtube.com/c/FedericoNavarrete)|[![Amazon](https://i.sstatic.net/NFOeE.png)](https://www.amazon.com/Federico-Navarrete/e/B08NJTXQRV)|[![Goodreads](https://i.sstatic.net/oBk0g.jpg)](https://www.goodreads.com/author/show/21125413.Federico_Navarrete)|[![Instagram](https://i.sstatic.net/PIfqY.png)](https://www.instagram.com/federico_the_consultant)|[![RedCircle Podcast](https://i.sstatic.net/4XICF.png)](https://redcircle.com/shows/cyber-prophets)|[![RedCircle Podcast](https://i.sstatic.net/4XICF.png)](https://redcircle.com/shows/sharing-your-stories)|