SearchBar
open class SearchBar : RelativeLayout
kotlin.Any | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.RelativeLayout | |||
↳ | androidx.leanback.widget.SearchBar |
A search widget containing a search orb and a text entry view.
Note: When SpeechRecognitionCallback
is not used, i.e. using SpeechRecognizer
, your application will need to declare android.permission.RECORD_AUDIO in manifest file. If your application target >= 23 and the device is running >= 23, it needs implement SearchBarPermissionListener
where requests runtime permission.
Summary
Nested classes | |
---|---|
abstract |
Interface for receiving notification of search query changes. |
abstract |
Interface that handles runtime permissions requests. |
Public constructors | |
---|---|
<init>(context: Context!, attrs: AttributeSet!) |
|
<init>(context: Context!, attrs: AttributeSet!, defStyle: Int) |
Public methods | |
---|---|
open Unit |
displayCompletions(completions: MutableList<String!>!) Updates the completion list shown by the IME |
open Unit |
displayCompletions(completions: Array<CompletionInfo!>!) Updates the completion list shown by the IME |
open Drawable! |
Returns the badge drawable |
open CharSequence! |
getHint() Returns the current search bar hint text. |
open String! |
getTitle() Returns the current title |
open Boolean |
Returns true if is not running Recognizer, false otherwise. |
open Unit |
setBadgeDrawable(drawable: Drawable!) Sets the badge drawable showing inside the search bar. |
open Unit |
setNextFocusDownId(viewId: Int) |
open Unit |
Sets listener that handles runtime permission requests. |
open Unit |
Sets background color of not-listening state search orb. |
open Unit |
Sets background color of listening state search orb. |
open Unit |
setSearchBarListener(listener: SearchBar.SearchBarListener!) Sets a listener for when the term search changes |
open Unit |
setSearchQuery(query: String!) Sets the search query |
open Unit |
Sets the speech recognition callback. |
open Unit |
setSpeechRecognizer(recognizer: SpeechRecognizer!) Sets the speech recognizer to be used when doing voice search. |
open Unit |
Sets the title text used in the hint shown in the search bar. |
open Unit | |
open Unit |
Stops the speech recognition, if already started. |
Protected methods | |
---|---|
open Unit | |
open Unit | |
open Unit |
Public constructors
<init>
SearchBar(context: Context!)
<init>
SearchBar(
context: Context!,
attrs: AttributeSet!)
<init>
SearchBar(
context: Context!,
attrs: AttributeSet!,
defStyle: Int)