Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
FANMixco authored Jul 1, 2019
1 parent 1808f43 commit 9d52b02
Showing 1 changed file with 72 additions and 3 deletions.
75 changes: 72 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Xamarin-Material SearchBar Android
Material Design Search Bar for Android
Material Design Search Bar for Android, you can download it from:

This is a **ported version** of the fantastic version created by:
https://www.nuget.org/packages/Xamarin-MaterialSearchBar

This version is **based on** of the fantastic version created by:

https://github.com/mancj

**The original one:**

https://github.com/mancj/MaterialSearchBar.
https://github.com/mancj/MaterialSearchBar

This beautiful and easy to use library will help to add Lollipop Material Design SearchView in your project.

Expand All @@ -17,3 +19,70 @@ This beautiful and easy to use library will help to add Lollipop Material Design
<img src="https://raw.githubusercontent.com/mancj/MaterialSearchBar/master/art/pv3.png" width="400">
<img src="https://raw.githubusercontent.com/mancj/MaterialSearchBar/master/art/pv4.png" width="400">
<img src="https://raw.githubusercontent.com/mancj/MaterialSearchBar/master/art/pv5.png" width="400">

**Basic example:**

**XML:**

<tk.supernovaic.MaterialSearchBar.MaterialSearchBar
style="@style/MaterialSearchBarLight"
app:mt_speechMode="true"
app:mt_hint="Custom hint"
app:mt_maxSuggestionsCount="10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/searchBar" />

**C#:**

public partial class YourClassActivity : AppCompatActivity, MaterialSearchBar.IOnSearchActionListener
{
private MaterialSearchBar MSearchBar { get; set; }

protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

MSearchBar = FindViewById<MaterialSearchBar>(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)
{

}
}
}

0 comments on commit 9d52b02

Please sign in to comment.