BrandedFragment

Added in 1.1.0
Deprecated in 1.1.0

public class BrandedFragment extends 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 methods

@Nullable Drawable

Returns the badge drawable used in the fragment title.

int

Returns the color used to draw the search affordance.

@Nullable SearchOrbView.Colors

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

@Nullable CharSequence

Returns the title text for the fragment.

@Nullable View

Returns the view that implements TitleViewAdapter.Provider.

@Nullable TitleViewAdapter

Returns the TitleViewAdapter implemented by title view.

void
installTitleView(
    @NonNull LayoutInflater inflater,
    @NonNull ViewGroup parent,
    @Nullable Bundle savedInstanceState
)

Inflate title view and add to parent.

final boolean

Returns true/false to indicate the visibility of TitleView.

void

This method is deprecated.

@NonNull View
onInflateTitleView(
    @NonNull LayoutInflater inflater,
    @Nullable ViewGroup parent,
    @Nullable Bundle savedInstanceState
)

Called by installTitleView to inflate title view.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)

This method is deprecated.

void

Sets the drawable displayed in the fragment title.

void

Sets a click listener for the search affordance.

void

Sets the color used to draw the search affordance.

void

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

void

Sets title text for the fragment.

void

Sets the view that implemented TitleViewAdapter.

void
showTitle(int flags)

Changes title view's components visibility and shows title.

void
showTitle(boolean show)

Shows or hides the title view.

Inherited Constants

From android.content.ComponentCallbacks2
static final int
static final int
static final int
static final int
static final int
static final int
static final int

Inherited methods

From android.app.Fragment
void
dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)

This method is deprecated.

final boolean

This method is deprecated.

final Activity

This method is deprecated.

boolean

This method is deprecated.

boolean

This method is deprecated.

final Bundle

This method is deprecated.

final FragmentManager

This method is deprecated.

Context

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

final FragmentManager

This method is deprecated.

final Object

This method is deprecated.

final int

This method is deprecated.

final LayoutInflater

This method is deprecated.

LoaderManager

This method is deprecated.

final Fragment

This method is deprecated.

Transition

This method is deprecated.

final Resources

This method is deprecated.

final boolean

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

final String
getString(int resId)

This method is deprecated.

final String

This method is deprecated.

final Fragment

This method is deprecated.

final int

This method is deprecated.

final CharSequence
getText(int resId)

This method is deprecated.

boolean

This method is deprecated.

View

This method is deprecated.

final int

This method is deprecated.

static Fragment
instantiate(Context context, String fname)

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

void
onActivityCreated(Bundle savedInstanceState)

This method is deprecated.

void
onActivityResult(int requestCode, int resultCode, Intent data)

This method is deprecated.

void
onAttach(Context context)

This method is deprecated.

void
onAttachFragment(Fragment childFragment)

This method is deprecated.

void

This method is deprecated.

boolean

This method is deprecated.

void
onCreate(Bundle savedInstanceState)

This method is deprecated.

Animator
onCreateAnimator(int transit, boolean enter, int nextAnim)

This method is deprecated.

void
onCreateContextMenu(
    ContextMenu menu,
    View v,
    ContextMenu.ContextMenuInfo menuInfo
)

This method is deprecated.

void

This method is deprecated.

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

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

LayoutInflater
onGetLayoutInflater(Bundle savedInstanceState)

This method is deprecated.

void
onHiddenChanged(boolean hidden)

This method is deprecated.

void
onInflate(AttributeSet attrs, Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void
onMultiWindowModeChanged(
    boolean isInMultiWindowMode,
    Configuration newConfig
)

This method is deprecated.

boolean

This method is deprecated.

void

This method is deprecated.

void
onPictureInPictureModeChanged(
    boolean isInPictureInPictureMode,
    Configuration newConfig
)

This method is deprecated.

void

This method is deprecated.

void
onRequestPermissionsResult(
    int requestCode,
    String[] permissions,
    int[] grantResults
)

This method is deprecated.

void

This method is deprecated.

void
onTrimMemory(int level)

This method is deprecated.

void
onViewStateRestored(Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

final void
requestPermissions(String[] permissions, int requestCode)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setHasOptionsMenu(boolean hasMenu)

This method is deprecated.

void

This method is deprecated.

void
setMenuVisibility(boolean menuVisible)

This method is deprecated.

void

This method is deprecated.

void
setRetainInstance(boolean retain)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setTargetFragment(Fragment fragment, int requestCode)

This method is deprecated.

void
setUserVisibleHint(boolean isVisibleToUser)

This method is deprecated.

boolean

This method is deprecated.

void

This method is deprecated.

void
startActivityForResult(Intent intent, int requestCode)

This method is deprecated.

void
startIntentSenderForResult(
    IntentSender intent,
    int requestCode,
    Intent fillInIntent,
    int flagsMask,
    int flagsValues,
    int extraFlags,
    Bundle options
)

This method is deprecated.

void

This method is deprecated.

String

This method is deprecated.

void

This method is deprecated.

Public constructors

BrandedFragment

Added in 1.1.0
Deprecated in 1.1.0
public BrandedFragment()

Public methods

getBadgeDrawable

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable Drawable getBadgeDrawable()

Returns the badge drawable used in the fragment title.

Returns
@Nullable Drawable

The badge drawable used in the fragment title.

getSearchAffordanceColor

Added in 1.1.0
Deprecated in 1.1.0
public int getSearchAffordanceColor()

Returns the color used to draw the search affordance.

getSearchAffordanceColors

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable SearchOrbView.Colors getSearchAffordanceColors()

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

getTitle

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable CharSequence getTitle()

Returns the title text for the fragment.

Returns
@Nullable CharSequence

Title text for the fragment.

getTitleView

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable View getTitleView()

Returns the view that implements TitleViewAdapter.Provider.

Returns
@Nullable View

The view that implements TitleViewAdapter.Provider.

getTitleViewAdapter

Added in 1.1.0
Deprecated in 1.1.0
public @Nullable TitleViewAdapter getTitleViewAdapter()

Returns the TitleViewAdapter implemented by title view.

Returns
@Nullable TitleViewAdapter

The TitleViewAdapter implemented by title view.

installTitleView

Added in 1.1.0
Deprecated in 1.1.0
public void installTitleView(
    @NonNull LayoutInflater inflater,
    @NonNull ViewGroup parent,
    @Nullable Bundle savedInstanceState
)

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

Parameters
@NonNull LayoutInflater inflater

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

@NonNull ViewGroup parent

Parent of title view.

@Nullable Bundle savedInstanceState

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
public final boolean isShowingTitle()

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
public void onDestroyView()

onInflateTitleView

Added in 1.1.0
Deprecated in 1.1.0
public @NonNull View onInflateTitleView(
    @NonNull LayoutInflater inflater,
    @Nullable ViewGroup parent,
    @Nullable Bundle savedInstanceState
)

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
@NonNull LayoutInflater inflater

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

@Nullable ViewGroup parent

Parent of title view.

@Nullable Bundle savedInstanceState

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

Returns
@NonNull 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
public void onPause()

onResume

Added in 1.1.0
Deprecated in 1.1.0
public void onResume()

onSaveInstanceState

Added in 1.1.0
Deprecated in 1.1.0
public void onSaveInstanceState(Bundle outState)

onStart

Added in 1.1.0
Deprecated in 1.1.0
public void onStart()

onViewCreated

Added in 1.1.0
Deprecated in 1.1.0
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)

setBadgeDrawable

Added in 1.1.0
Deprecated in 1.1.0
public void setBadgeDrawable(@Nullable Drawable drawable)

Sets the drawable displayed in the fragment title.

Parameters
@Nullable Drawable drawable

The Drawable to display in the fragment title.

setOnSearchClickedListener

Added in 1.1.0
Deprecated in 1.1.0
public void setOnSearchClickedListener(@Nullable View.OnClickListener listener)

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
@Nullable View.OnClickListener listener

The listener to call when the search element is clicked.

setSearchAffordanceColor

Added in 1.1.0
Deprecated in 1.1.0
public void setSearchAffordanceColor(int color)

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

Parameters
int color

The color to use for the search affordance.

setSearchAffordanceColors

Added in 1.1.0
Deprecated in 1.1.0
public void setSearchAffordanceColors(@NonNull SearchOrbView.Colors colors)

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

Parameters
@NonNull SearchOrbView.Colors colors

Colors used to draw search affordance.

setTitle

Added in 1.1.0
Deprecated in 1.1.0
public void setTitle(@Nullable CharSequence title)

Sets title text for the fragment.

Parameters
@Nullable CharSequence title

The title text of the fragment.

setTitleView

Added in 1.1.0
Deprecated in 1.1.0
public void setTitleView(@Nullable View titleView)

Sets the view that implemented TitleViewAdapter.

Parameters
@Nullable View titleView

The view that implemented TitleViewAdapter.Provider.

showTitle

Added in 1.1.0
Deprecated in 1.1.0
public void showTitle(int flags)

Changes title view's components visibility and shows title.

Parameters
int flags

Flags representing the visibility of components inside title view.

showTitle

Added in 1.1.0
Deprecated in 1.1.0
public void showTitle(boolean show)

Shows or hides the title view.

Parameters
boolean show

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