Skip to content

Most visited

Recently visited

navigation

TitleView

public class TitleView
extends FrameLayout implements TitleViewAdapter.Provider

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ android.support.v17.leanback.widget.TitleView


Title view for a leanback fragment.

Summary

Inherited XML attributes

From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View

Inherited constants

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

Inherited fields

From class android.view.View

Public constructors

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

Public methods

void enableAnimation(boolean enable)

Enables or disables any view animations.

Drawable getBadgeDrawable()

Returns the badge drawable.

SearchOrbView.Colors getSearchAffordanceColors()

Returns the SearchOrbView.Colors used to draw the search affordance.

View getSearchAffordanceView()

Returns the view for the search affordance.

CharSequence getTitle()

Returns the title text.

TitleViewAdapter getTitleViewAdapter()

Returns TitleViewAdapter to be implemented by the customized widget class.

void setBadgeDrawable(Drawable drawable)

Sets the badge drawable.

void setOnSearchClickedListener(View.OnClickListener listener)

Sets the listener to be called when the search affordance is clicked.

void setSearchAffordanceColors(SearchOrbView.Colors colors)

Sets the SearchOrbView.Colors used to draw the search affordance.

void setTitle(CharSequence titleText)

Sets the title text.

void updateComponentsVisibility(int flags)

Based on the flag, it updates the visibility of the individual components - BadgeView, TextView and SearchView.

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.support.v17.leanback.widget.TitleViewAdapter.Provider

Public constructors

TitleView

added in version 22.1.0
TitleView (Context context)

Parameters
context Context

TitleView

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

Parameters
context Context

attrs AttributeSet

TitleView

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

Parameters
context Context

attrs AttributeSet

defStyleAttr int

Public methods

enableAnimation

added in version 22.1.0
void enableAnimation (boolean enable)

Enables or disables any view animations.

Parameters
enable boolean

getBadgeDrawable

added in version 22.1.0
Drawable getBadgeDrawable ()

Returns the badge drawable.

Returns
Drawable

getSearchAffordanceColors

added in version 22.1.0
SearchOrbView.Colors getSearchAffordanceColors ()

Returns the SearchOrbView.Colors used to draw the search affordance.

Returns
SearchOrbView.Colors

getSearchAffordanceView

added in version 22.1.0
View getSearchAffordanceView ()

Returns the view for the search affordance.

Returns
View

getTitle

added in version 22.1.0
CharSequence getTitle ()

Returns the title text.

Returns
CharSequence

getTitleViewAdapter

added in version 24.0.0
TitleViewAdapter getTitleViewAdapter ()

Returns TitleViewAdapter to be implemented by the customized widget class.

Returns
TitleViewAdapter TitleViewAdapter to be implemented by the customized widget class.

setBadgeDrawable

added in version 22.1.0
void setBadgeDrawable (Drawable drawable)

Sets the badge drawable. If non-null, the drawable is displayed instead of the title text.

Parameters
drawable Drawable

setOnSearchClickedListener

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

Sets the listener to be called when the search affordance is clicked.

Parameters
listener View.OnClickListener

setSearchAffordanceColors

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

Sets the SearchOrbView.Colors used to draw the search affordance.

Parameters
colors SearchOrbView.Colors

setTitle

added in version 24.0.0
void setTitle (CharSequence titleText)

Sets the title text.

Parameters
titleText CharSequence

updateComponentsVisibility

added in version 24.0.0
void updateComponentsVisibility (int flags)

Based on the flag, it updates the visibility of the individual components - BadgeView, TextView and SearchView.

Parameters
flags int: integer representing the visibility of TitleView components.

See also:

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!

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 one-minute survey?
Help us improve Android tools and documentation.