BrandedSupportFragment

open class BrandedSupportFragment
kotlin.Any
   ↳ androidx.leanback.app.BrandedSupportFragment

Fragment class for managing search and branding using a view that implements TitleViewAdapter.Provider.

Summary

Public constructors

Public methods
open SearchOrbView.Colors!

Returns the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.

open Unit

Shows or hides the title view.

open Unit
showTitle(flags: Int)

Changes title view's components visibility and shows title.

open Unit

open Unit

Sets the drawable displayed in the fragment title.

open Unit

Sets the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.

open Unit

open Unit

open Unit
onViewCreated(view: View, savedInstanceState: Bundle?)

open Unit

Sets title text for the fragment.

open CharSequence!

Returns the title text for the fragment.

Boolean

Returns true/false to indicate the visibility of TitleView.

open Unit

open Unit
installTitleView(inflater: LayoutInflater!, parent: ViewGroup!, savedInstanceState: Bundle!)

Inflate title view and add to parent.

open Unit
setTitleView(titleView: View!)

Sets the view that implemented TitleViewAdapter.

open Unit

open Unit

Sets a click listener for the search affordance.

open Unit

Sets the color used to draw the search affordance.

open TitleViewAdapter!

Returns the TitleViewAdapter implemented by title view.

open View!
onInflateTitleView(inflater: LayoutInflater!, parent: ViewGroup!, savedInstanceState: Bundle!)

Called by #installTitleView(LayoutInflater, ViewGroup, Bundle) to inflate title view.

open View!

Returns the view that implements TitleViewAdapter.Provider.

open Drawable!

Returns the badge drawable used in the fragment title.

open Int

Returns the color used to draw the search affordance.

Public constructors

<init>

BrandedSupportFragment()

Public methods

getSearchAffordanceColors

open fun getSearchAffordanceColors(): SearchOrbView.Colors!

Returns the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.

showTitle

open fun showTitle(show: Boolean): Unit

Shows or hides the title view.

Parameters
show Boolean: True to show title view, false to hide title view.

showTitle

open fun showTitle(flags: Int): Unit

Changes title view's components visibility and shows title.

Parameters
flags Int: Flags representing the visibility of components inside title view.

onDestroyView

open fun onDestroyView(): Unit

setBadgeDrawable

open fun setBadgeDrawable(drawable: Drawable!): Unit

Sets the drawable displayed in the fragment title.

Parameters
drawable Drawable!: The Drawable to display in the fragment title.

setSearchAffordanceColors

open fun setSearchAffordanceColors(colors: SearchOrbView.Colors!): Unit

Sets the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.

Parameters
colors SearchOrbView.Colors!: Colors used to draw search affordance.

onResume

open fun onResume(): Unit

onSaveInstanceState

open fun onSaveInstanceState(outState: Bundle!): Unit

onViewCreated

open fun onViewCreated(view: View, savedInstanceState: Bundle?): Unit

setTitle

open fun setTitle(title: CharSequence!): Unit

Sets title text for the fragment.

Parameters
title CharSequence!: The title text of the fragment.

getTitle

open fun getTitle(): CharSequence!

Returns the title text for the fragment.

Return
CharSequence!: Title text for the fragment.

isShowingTitle

fun isShowingTitle(): Boolean

Returns true/false to indicate the visibility of TitleView.

Return
Boolean: boolean to indicate whether or not it's showing the title.

onStart

open fun onStart(): Unit

installTitleView

open fun installTitleView(inflater: LayoutInflater!, parent: ViewGroup!, savedInstanceState: Bundle!): Unit

Inflate title view and add to parent. This method should be called in Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle).

Parameters
inflater LayoutInflater!: The LayoutInflater object that can be used to inflate any views in the fragment,
parent LayoutInflater!: Parent of title view.
savedInstanceState LayoutInflater!: If non-null, this fragment is being re-constructed from a previous saved state as given here.

setTitleView

open fun setTitleView(titleView: View!): Unit

Sets the view that implemented TitleViewAdapter.

Parameters
titleView View!: The view that implemented TitleViewAdapter.Provider.

onPause

open fun onPause(): Unit

setOnSearchClickedListener

open fun setOnSearchClickedListener(listener: OnClickListener!): Unit

Sets a click listener for the search affordance.

The presence of a listener will change the visibility of the search affordance in the fragment title. When set to non-null, the title will contain an element that a user may click to begin a search.

The listener's onClick method will be invoked when the user clicks on the search element.

Parameters
listener OnClickListener!: The listener to call when the search element is clicked.

setSearchAffordanceColor

open fun setSearchAffordanceColor(color: Int): Unit

Sets the color used to draw the search affordance. A default brighter color will be set by the framework.

Parameters
color Int: The color to use for the search affordance.

getTitleViewAdapter

open fun getTitleViewAdapter(): TitleViewAdapter!

Returns the TitleViewAdapter implemented by title view.

Return
TitleViewAdapter!: The TitleViewAdapter implemented by title view.

onInflateTitleView

open fun onInflateTitleView(inflater: LayoutInflater!, parent: ViewGroup!, savedInstanceState: Bundle!): View!

Called by #installTitleView(LayoutInflater, ViewGroup, Bundle) to inflate title view. Default implementation uses layout file lb_browse_title. Subclass may override and use its own layout, the layout must have a descendant with id browse_title_group that implements TitleViewAdapter.Provider. Subclass may return null if no title is needed.

Parameters
inflater LayoutInflater!: The LayoutInflater object that can be used to inflate any views in the fragment,
parent LayoutInflater!: Parent of title view.
savedInstanceState LayoutInflater!: If non-null, this fragment is being re-constructed from a previous saved state as given here.
Return
View!: Title view which must have a descendant with id browse_title_group that implements TitleViewAdapter.Provider, or null for no title view.

getTitleView

open fun getTitleView(): View!

Returns the view that implements TitleViewAdapter.Provider.

Return
View!: The view that implements TitleViewAdapter.Provider.

getBadgeDrawable

open fun getBadgeDrawable(): Drawable!

Returns the badge drawable used in the fragment title.

Return
Drawable!: The badge drawable used in the fragment title.

getSearchAffordanceColor

open fun getSearchAffordanceColor(): Int

Returns the color used to draw the search affordance.