Skip to content

Basic Implementation

Mansur edited this page Jan 27, 2017 · 3 revisions

Basic implementation

add this code to the the project level build.gradle file

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

add the dependency to the the app level build.gradle file

dependencies {
	compile 'com.github.mancj:MaterialSearchBar:0.6'
}

then add SearchBar to your activity:

<com.mancj.materialsearchbar.MaterialSearchBar
    app:speechMode="true"
    app:hint="Custom hint"
    app:maxSuggestionsCount="10"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/searchBar" />
Clone this wiki locally