Android APIs
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

Class Overview

A widget that draws a search affordance, represented by a round background and an icon.

Background color and icon can be customized

Summary

Nested Classes
class SearchOrbView.Colors A set of colors used to display the search orb. 
[Expand]
Inherited XML Attributes
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
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)
Called when a view has been clicked.
void setOnOrbClickedListener(View.OnClickListener listener)
Set the on click listener for the orb
void setOrbColor(int color, int brightColor)
This method is deprecated. Use setOrbColors(Colors) instead.
void setOrbColor(int color)
Sets the background color of the search orb.
void setOrbColors(SearchOrbView.Colors colors)
Set the SearchOrbView.Colors used to display the search orb.
void setOrbIcon(Drawable icon)
Set the orb icon
Protected Methods
void onDetachedFromWindow()
This is called when the view is detached from a window.
void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect)
Called by the view system when the focus state of this view changes.
[Expand]
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

public SearchOrbView (Context context)

public SearchOrbView (Context context, AttributeSet attrs)

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

Public Methods

public 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.

public int getOrbColor ()

Returns the orb color

Returns
  • the RGBA color

public SearchOrbView.Colors getOrbColors ()

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

public Drawable getOrbIcon ()

Returns the orb icon

Returns
  • the drawable used as the icon

public void onClick (View view)

Called when a view has been clicked.

Parameters
view The view that was clicked.

public void setOnOrbClickedListener (View.OnClickListener listener)

Set the on click listener for the orb

Parameters
listener The listener.

public void setOrbColor (int color, int brightColor)

This method is deprecated.
Use setOrbColors(Colors) instead.

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

public void setOrbColor (int color)

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

Parameters
color the RGBA color

public void setOrbColors (SearchOrbView.Colors colors)

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

public void setOrbIcon (Drawable icon)

Set the orb icon

Parameters
icon the drawable to be used as the icon

Protected Methods

protected void onDetachedFromWindow ()

This is called when the view is detached from a window. At this point it no longer has a surface for drawing.

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

Called by the view system when the focus state of this view changes. When the focus change event is caused by directional navigation, direction and previouslyFocusedRect provide insight into where the focus is coming from. When overriding, be sure to call up through to the super class so that the standard focus handling will occur.

Parameters
gainFocus True if the View has focus; false otherwise.
direction The direction focus has moved when requestFocus() is called to give this view focus. Values are FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_FORWARD, or FOCUS_BACKWARD. It may not always apply, in which case use the default.
previouslyFocusedRect The rectangle, in this view's coordinate system, of the previously focused view. If applicable, this will be passed in as finer grained information about where the focus is coming from (in addition to direction). Will be null otherwise.