BrandedFragment
public class BrandedFragment extends Fragment
BaseFragment |
This class is deprecated. |
ErrorFragment |
This class is deprecated. |
BrowseFragment |
This class is deprecated. |
DetailsFragment |
This class is deprecated. |
VerticalGridFragment |
This class is deprecated. |
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 |
@Nullable CharSequence |
Returns the title text for the fragment. |
@Nullable View |
Returns the view that implements |
@Nullable TitleViewAdapter |
Returns the |
void |
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 |
Called by |
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 |
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 |
void |
Sets title text for the fragment. |
void |
Sets the view that implemented |
void |
Changes title view's components visibility and shows title. |
void |
Shows or hides the title view. |
Inherited Constants |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited methods |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Public methods
public @Nullable SearchOrbView.ColorsgetSearchAffordanceColors()
Returns the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.
public @Nullable CharSequencegetTitle()
Returns the title text for the fragment.
| Returns | |
|---|---|
@Nullable CharSequence |
Title text for the fragment. |
public @Nullable ViewgetTitleView()
Returns the view that implements TitleViewAdapter.Provider.
| Returns | |
|---|---|
@Nullable View |
The view that implements |
public @Nullable TitleViewAdaptergetTitleViewAdapter()
Returns the TitleViewAdapter implemented by title view.
| Returns | |
|---|---|
@Nullable TitleViewAdapter |
The |
public voidinstallTitleView(
@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. |
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. |
public @NonNull ViewonInflateTitleView(
@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 |
public voidsetBadgeDrawable(@Nullable Drawable drawable)
Sets the drawable displayed in the fragment title.
public voidsetOnSearchClickedListener(@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. |
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. |
public voidsetSearchAffordanceColors(@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. |
public voidsetTitle(@Nullable CharSequence title)
Sets title text for the fragment.
| Parameters | |
|---|---|
@Nullable CharSequence title |
The title text of the fragment. |
public voidsetTitleView(@Nullable View titleView)
Sets the view that implemented TitleViewAdapter.
| Parameters | |
|---|---|
@Nullable View titleView |
The view that implemented |
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. |