BrandedFragment

Added in 1.1.0
Deprecated in 1.1.0

class BrandedFragment : Fragment

Known direct subclasses
BaseFragment

This class is deprecated.

use BaseSupportFragment

ErrorFragment

This class is deprecated.

use ErrorSupportFragment

Known indirect subclasses
BrowseFragment

This class is deprecated.

use BrowseSupportFragment

DetailsFragment

This class is deprecated.

use DetailsSupportFragment

VerticalGridFragment

This class is deprecated.

use VerticalGridSupportFragment


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

Summary

Public constructors

Public functions

Drawable?

Returns the badge drawable used in the fragment title.

Int

Returns the color used to draw the search affordance.

SearchOrbView.Colors?

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

CharSequence?

Returns the title text for the fragment.

View?

Returns the view that implements TitleViewAdapter.Provider.

TitleViewAdapter?

Returns the TitleViewAdapter implemented by title view.

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

Inflate title view and add to parent.

Boolean

Returns true/false to indicate the visibility of TitleView.

Unit

This function is deprecated.

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

Called by installTitleView to inflate title view.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

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

This function is deprecated.

Unit

Sets the drawable displayed in the fragment title.

Unit

Sets a click listener for the search affordance.

Unit

Sets the color used to draw the search affordance.

Unit

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

Unit

Sets title text for the fragment.

Unit
setTitleView(titleView: View?)

Sets the view that implemented TitleViewAdapter.

Unit
showTitle(flags: Int)

Changes title view's components visibility and shows title.

Unit

Shows or hides the title view.

Inherited functions

From android.app.Fragment
Unit
dump(
    prefix: String!,
    fd: FileDescriptor!,
    writer: PrintWriter!,
    args: Array<String!>!
)

This function is deprecated.

Boolean
equals(o: Any!)

This function is deprecated.

Activity!

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Bundle!

This function is deprecated.

FragmentManager!

This function is deprecated.

Context!

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

FragmentManager!

This function is deprecated.

Any!

This function is deprecated.

Int

This function is deprecated.

LayoutInflater!

This function is deprecated.

LoaderManager!

This function is deprecated.

Fragment!

This function is deprecated.

Transition!

This function is deprecated.

Resources!

This function is deprecated.

Boolean

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

String!
getString(resId: Int)

This function is deprecated.

String!

This function is deprecated.

Fragment!

This function is deprecated.

Int

This function is deprecated.

CharSequence!
getText(resId: Int)

This function is deprecated.

Boolean

This function is deprecated.

View!

This function is deprecated.

Int

This function is deprecated.

java-static Fragment!
instantiate(context: Context!, fname: String!)

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Unit
onActivityCreated(savedInstanceState: Bundle!)

This function is deprecated.

Unit
onActivityResult(requestCode: Int, resultCode: Int, data: Intent!)

This function is deprecated.

Unit
onAttach(context: Context!)

This function is deprecated.

Unit
onAttachFragment(childFragment: Fragment!)

This function is deprecated.

Unit

This function is deprecated.

Boolean

This function is deprecated.

Unit
onCreate(savedInstanceState: Bundle!)

This function is deprecated.

Animator!
onCreateAnimator(transit: Int, enter: Boolean, nextAnim: Int)

This function is deprecated.

Unit
onCreateContextMenu(
    menu: ContextMenu!,
    v: View!,
    menuInfo: ContextMenu.ContextMenuInfo!
)

This function is deprecated.

Unit
onCreateOptionsMenu(menu: Menu!, inflater: MenuInflater!)

This function is deprecated.

View!
onCreateView(
    inflater: LayoutInflater!,
    container: ViewGroup!,
    savedInstanceState: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

LayoutInflater!
onGetLayoutInflater(savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit
onInflate(attrs: AttributeSet!, savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit
onMultiWindowModeChanged(
    isInMultiWindowMode: Boolean,
    newConfig: Configuration!
)

This function is deprecated.

Boolean

This function is deprecated.

Unit

This function is deprecated.

Unit
onPictureInPictureModeChanged(
    isInPictureInPictureMode: Boolean,
    newConfig: Configuration!
)

This function is deprecated.

Unit

This function is deprecated.

Unit
onRequestPermissionsResult(
    requestCode: Int,
    permissions: Array<String!>!,
    grantResults: IntArray!
)

This function is deprecated.

Unit

This function is deprecated.

Unit
onTrimMemory(level: Int)

This function is deprecated.

Unit
onViewStateRestored(savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
requestPermissions(permissions: Array<String!>!, requestCode: Int)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
setMenuVisibility(menuVisible: Boolean)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
setTargetFragment(fragment: Fragment!, requestCode: Int)

This function is deprecated.

Unit
setUserVisibleHint(isVisibleToUser: Boolean)

This function is deprecated.

Boolean

This function is deprecated.

Unit

This function is deprecated.

Unit
startActivityForResult(intent: Intent!, requestCode: Int)

This function is deprecated.

Unit
startIntentSenderForResult(
    intent: IntentSender!,
    requestCode: Int,
    fillInIntent: Intent!,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int,
    options: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

String!

This function is deprecated.

Unit

This function is deprecated.

Public constructors

BrandedFragment

Added in 1.1.0
Deprecated in 1.1.0
BrandedFragment()

Public functions

getBadgeDrawable

Added in 1.1.0
Deprecated in 1.1.0
fun getBadgeDrawable(): Drawable?

Returns the badge drawable used in the fragment title.

Returns
Drawable?

The badge drawable used in the fragment title.

getSearchAffordanceColor

Added in 1.1.0
Deprecated in 1.1.0
fun getSearchAffordanceColor(): Int

Returns the color used to draw the search affordance.

getSearchAffordanceColors

Added in 1.1.0
Deprecated in 1.1.0
fun getSearchAffordanceColors(): SearchOrbView.Colors?

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

getTitle

Added in 1.1.0
Deprecated in 1.1.0
fun getTitle(): CharSequence?

Returns the title text for the fragment.

Returns
CharSequence?

Title text for the fragment.

getTitleView

Added in 1.1.0
Deprecated in 1.1.0
fun getTitleView(): View?

Returns the view that implements TitleViewAdapter.Provider.

Returns
View?

The view that implements TitleViewAdapter.Provider.

getTitleViewAdapter

Added in 1.1.0
Deprecated in 1.1.0
fun getTitleViewAdapter(): TitleViewAdapter?

Returns the TitleViewAdapter implemented by title view.

Returns
TitleViewAdapter?

The TitleViewAdapter implemented by title view.

installTitleView

Added in 1.1.0
Deprecated in 1.1.0
fun installTitleView(
    inflater: LayoutInflater,
    parent: ViewGroup,
    savedInstanceState: Bundle?
): Unit

Inflate title view and add to parent. This method should be called in onCreateView.

Parameters
inflater: LayoutInflater

The LayoutInflater object that can be used to inflate any views in the fragment,

parent: ViewGroup

Parent of title view.

savedInstanceState: Bundle?

If non-null, this fragment is being re-constructed from a previous saved state as given here.

isShowingTitle

Added in 1.1.0
Deprecated in 1.1.0
fun isShowingTitle(): Boolean

Returns true/false to indicate the visibility of TitleView.

Returns
Boolean

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

onDestroyView

Added in 1.1.0
Deprecated in 1.1.0
fun onDestroyView(): Unit

onInflateTitleView

Added in 1.1.0
Deprecated in 1.1.0
fun onInflateTitleView(
    inflater: LayoutInflater,
    parent: ViewGroup?,
    savedInstanceState: Bundle?
): View

Called by installTitleView 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: ViewGroup?

Parent of title view.

savedInstanceState: Bundle?

If non-null, this fragment is being re-constructed from a previous saved state as given here.

Returns
View

Title view which must have a descendant with id browse_title_group that implements TitleViewAdapter.Provider, or null for no title view.

onPause

Added in 1.1.0
Deprecated in 1.1.0
fun onPause(): Unit

onResume

Added in 1.1.0
Deprecated in 1.1.0
fun onResume(): Unit

onSaveInstanceState

Added in 1.1.0
Deprecated in 1.1.0
fun onSaveInstanceState(outState: Bundle!): Unit

onStart

Added in 1.1.0
Deprecated in 1.1.0
fun onStart(): Unit

onViewCreated

Added in 1.1.0
Deprecated in 1.1.0
fun onViewCreated(view: View, savedInstanceState: Bundle?): Unit

setBadgeDrawable

Added in 1.1.0
Deprecated in 1.1.0
fun setBadgeDrawable(drawable: Drawable?): Unit

Sets the drawable displayed in the fragment title.

Parameters
drawable: Drawable?

The Drawable to display in the fragment title.

setOnSearchClickedListener

Added in 1.1.0
Deprecated in 1.1.0
fun setOnSearchClickedListener(listener: View.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: View.OnClickListener?

The listener to call when the search element is clicked.

setSearchAffordanceColor

Added in 1.1.0
Deprecated in 1.1.0
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.

setSearchAffordanceColors

Added in 1.1.0
Deprecated in 1.1.0
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.

setTitle

Added in 1.1.0
Deprecated in 1.1.0
fun setTitle(title: CharSequence?): Unit

Sets title text for the fragment.

Parameters
title: CharSequence?

The title text of the fragment.

setTitleView

Added in 1.1.0
Deprecated in 1.1.0
fun setTitleView(titleView: View?): Unit

Sets the view that implemented TitleViewAdapter.

Parameters
titleView: View?

The view that implemented TitleViewAdapter.Provider.

showTitle

Added in 1.1.0
Deprecated in 1.1.0
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.

showTitle

Added in 1.1.0
Deprecated in 1.1.0
fun showTitle(show: Boolean): Unit

Shows or hides the title view.

Parameters
show: Boolean

True to show title view, false to hide title view.