Xamarin-MaterialSearchBar
1.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Xamarin-MaterialSearchBar --version 1.1.0
NuGet\Install-Package Xamarin-MaterialSearchBar -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xamarin-MaterialSearchBar" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xamarin-MaterialSearchBar --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Xamarin-MaterialSearchBar, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xamarin-MaterialSearchBar as a Cake Addin #addin nuget:?package=Xamarin-MaterialSearchBar&version=1.1.0 // Install Xamarin-MaterialSearchBar as a Cake Tool #tool nuget:?package=Xamarin-MaterialSearchBar&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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)
{
}
}
}
More information:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-android was computed. net7.0-android was computed. net8.0-android was computed. |
MonoAndroid | monoandroid is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- Xamarin.Android.Support.v7.AppCompat (>= 28.0.0.1)
- Xamarin.Android.Support.v7.CardView (>= 28.0.0.1)
- Xamarin.Android.Support.v7.RecyclerView (>= 28.0.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.