Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:27.0.0

SearchOrbView

public class SearchOrbView
extends FrameLayout implements View.OnClickListener

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ android.support.v17.leanback.widget.SearchOrbView
Known Direct Subclasses


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

class SearchOrbView.Colors

A set of colors used to display the search orb. 

Inherited constants

From class android.view.ViewGroup
From class android.view.View

Inherited fields

From class android.view.View

Public constructors

SearchOrbView(Context context)
SearchOrbView(Context context, AttributeSet attrs)
SearchOrbView(Context context, AttributeSet attrs, int defStyleAttr)

Public methods

void enableOrbColorAnimation(boolean enable)

Enables or disables the orb color animation.

int getOrbColor()

Returns the orb color

SearchOrbView.Colors getOrbColors()

Returns the SearchOrbView.Colors used to display the search orb.

Drawable getOrbIcon()

Returns the orb icon

void onClick(View view)
void setOnOrbClickedListener(View.OnClickListener listener)

Sets the on click listener for the orb.

void setOrbColor(int color)

Sets the background color of the search orb.

void setOrbColor(int color, int brightColor)

This method was deprecated in API level 22.1.0. Use setOrbColors(Colors) instead.

void setOrbColors(SearchOrbView.Colors colors)

Sets the SearchOrbView.Colors used to display the search orb.

void setOrbIcon(Drawable icon)

Sets the orb icon.

Protected methods

void onAttachedToWindow()
void onDetachedFromWindow()
void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect)

Inherited methods

From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource
From interface android.view.View.OnClickListener

Public constructors

SearchOrbView

added in version 22.1.0
SearchOrbView (Context context)

Parameters
context Context

SearchOrbView

added in version 22.1.0
SearchOrbView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

SearchOrbView

added in version 22.1.0
SearchOrbView (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

Public methods

enableOrbColorAnimation

added in version 22.1.0
void enableOrbColorAnimation (boolean enable)

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.

Parameters
enable boolean

getOrbColor

added in version 22.1.0
int getOrbColor ()

Returns the orb color

Returns
int the RGBA color

getOrbColors

added in version 22.1.0
SearchOrbView.Colors getOrbColors ()

Returns the SearchOrbView.Colors used to display the search orb.

Returns
SearchOrbView.Colors

getOrbIcon

added in version 22.1.0
Drawable getOrbIcon ()

Returns the orb icon

Returns
Drawable the drawable used as the icon

onClick

added in version 22.1.0
void onClick (View view)

Parameters
view View

setOnOrbClickedListener

added in version 22.1.0
void setOnOrbClickedListener (View.OnClickListener listener)

Sets the on click listener for the orb.

Parameters
listener View.OnClickListener: The listener.

setOrbColor

added in version 22.1.0
void setOrbColor (int color)

Sets the background color of the search orb. Other colors will be provided by the framework.

Parameters
color int: the RGBA color

setOrbColor

added in version 22.1.0
void setOrbColor (int color, 
                int brightColor)

This method was deprecated in API level 22.1.0.
Use setOrbColors(Colors) instead.

Sets the search orb colors. Other colors are provided by the framework.

Parameters
color int

brightColor int

setOrbColors

added in version 22.1.0
void setOrbColors (SearchOrbView.Colors colors)

Sets the SearchOrbView.Colors used to display the search orb.

Parameters
colors SearchOrbView.Colors

setOrbIcon

added in version 22.1.0
void setOrbIcon (Drawable icon)

Sets the orb icon.

Parameters
icon Drawable: the drawable to be used as the icon

Protected methods

onAttachedToWindow

void onAttachedToWindow ()

onDetachedFromWindow

void onDetachedFromWindow ()

onFocusChanged

void onFocusChanged (boolean gainFocus, 
                int direction, 
                Rect previouslyFocusedRect)

Parameters
gainFocus boolean

direction int

previouslyFocusedRect Rect

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)