SearchOrbView
open class SearchOrbView : FrameLayout, OnClickListener
kotlin.Any | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.FrameLayout | |||
↳ | androidx.leanback.widget.SearchOrbView |
A widget that draws a search affordance, represented by a round background and an icon.
The background color and icon can be customized.Summary
Nested classes | |
---|---|
open |
A set of colors used to display the search orb. |
Public constructors | |
---|---|
<init>(context: Context!, attrs: AttributeSet!) |
|
<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int) |
Public methods | |
---|---|
open Unit |
enableOrbColorAnimation(enable: Boolean) Enables or disables the orb color animation. |
open Int |
Returns the orb color |
open SearchOrbView.Colors! |
Returns the |
open Drawable! |
Returns the orb icon |
open Unit | |
open Unit |
setOnOrbClickedListener(listener: OnClickListener!) Sets the on click listener for the orb. |
open Unit |
setOrbColor(color: Int) Sets the background color of the search orb. |
open Unit |
setOrbColor(@ColorInt color: Int, @ColorInt brightColor: Int) Sets the search orb colors. |
open Unit |
setOrbColors(colors: SearchOrbView.Colors!) Sets the |
open Unit |
setOrbIcon(icon: Drawable!) Sets the orb icon. |
Protected methods | |
---|---|
open Unit | |
open Unit | |
open Unit |
onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?) |
Public constructors
<init>
SearchOrbView(context: Context!)
<init>
SearchOrbView(
context: Context!,
attrs: AttributeSet!)
<init>
SearchOrbView(
context: Context!,
attrs: AttributeSet!,
defStyleAttr: Int)
Public methods
enableOrbColorAnimation
open fun enableOrbColorAnimation(enable: Boolean): Unit
Enables or disables the orb color animation.
Orb color animation is handled automatically when the orb is focused/unfocused, however, an app may choose to override the current animation state, for example when an activity is paused.
getOrbColors
open fun getOrbColors(): SearchOrbView.Colors!
Returns the Colors
used to display the search orb.
getOrbIcon
open fun getOrbIcon(): Drawable!
Returns the orb icon
Return | |
---|---|
Drawable! |
the drawable used as the icon |
setOnOrbClickedListener
open fun setOnOrbClickedListener(listener: OnClickListener!): Unit
Sets the on click listener for the orb.
Parameters | |
---|---|
listener |
OnClickListener!: The listener. |
setOrbColor
open fun setOrbColor(color: Int): Unit
Sets the background color of the search orb. Other colors will be provided by the framework.
Parameters | |
---|---|
color |
Int: the RGBA color |
setOrbColor
open funsetOrbColor(
@ColorInt color: Int,
@ColorInt brightColor: Int
): Unit
Deprecated: Use setOrbColors(Colors)
instead.
Sets the search orb colors. Other colors are provided by the framework.
setOrbColors
open fun setOrbColors(colors: SearchOrbView.Colors!): Unit
Sets the Colors
used to display the search orb.
setOrbIcon
open fun setOrbIcon(icon: Drawable!): Unit
Sets the orb icon.
Parameters | |
---|---|
icon |
Drawable!: the drawable to be used as the icon |
Protected methods
onAttachedToWindow
protected open fun onAttachedToWindow(): Unit
onDetachedFromWindow
protected open fun onDetachedFromWindow(): Unit