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

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

[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
int getOrbColor()
Returns the orb color
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)
void setOrbColor(int color)
Set the background color of the search orb.
void setOrbIcon(Drawable icon)
Set the orb icon
Protected Methods
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.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnClickListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public SearchOrbView (Context context)

public SearchOrbView (Context context, AttributeSet attrs)

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

Public Methods

public int getOrbColor ()

Returns the orb color

Returns
  • the RGBA color

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)

public void setOrbColor (int color)

Set the background color of the search orb.

Parameters
color the RGBA color

public void setOrbIcon (Drawable icon)

Set the orb icon

Parameters
icon the drawable to be used as the icon

Protected Methods

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.