Added in API level 11
Deprecated in API level 21

FragmentBreadCrumbs


open class FragmentBreadCrumbs : ViewGroup, FragmentManager.OnBackStackChangedListener
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.app.FragmentBreadCrumbs

Helper class for showing "bread crumbs" representing the fragment stack in an activity. This is intended to be used with ActionBar.setCustomView(View) to place the bread crumbs in the action bar.

The default style for this view is android.R.style#Widget_FragmentBreadCrumbs.

Summary

Nested classes
abstract

Interface to intercept clicks on the bread crumbs.

Inherited XML attributes
Inherited constants
Public constructors

FragmentBreadCrumbs(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Public methods
open Unit

Called whenever the contents of the back stack change.

open Unit

Attach the bread crumbs to their activity.

open Unit
setMaxVisible(visibleCrumbs: Int)

The maximum number of breadcrumbs to show.

open Unit

Sets a listener for clicks on the bread crumbs.

open Unit
setParentTitle(title: CharSequence!, shortTitle: CharSequence!, listener: View.OnClickListener!)

Inserts an optional parent entry at the first position in the breadcrumbs.

open Unit
setTitle(title: CharSequence!, shortTitle: CharSequence!)

Set a custom title for the bread crumbs.

Protected methods
open Unit
onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int)

Called from layout when this view should assign a size and position to each of its children.

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Measure the view and its content to determine the measured width and the measured height.

Inherited functions
Inherited properties

Public constructors

FragmentBreadCrumbs

Added in API level 11
FragmentBreadCrumbs(context: Context!)

FragmentBreadCrumbs

Added in API level 11
FragmentBreadCrumbs(
    context: Context!,
    attrs: AttributeSet!)

FragmentBreadCrumbs

Added in API level 11
FragmentBreadCrumbs(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int)

Public methods

onBackStackChanged

Added in API level 11
open fun onBackStackChanged(): Unit

Deprecated: Deprecated in Java.

Called whenever the contents of the back stack change.

setActivity

Added in API level 11
open fun setActivity(a: Activity!): Unit

Deprecated: Deprecated in Java.

Attach the bread crumbs to their activity. This must be called once when creating the bread crumbs.

setMaxVisible

Added in API level 11
open fun setMaxVisible(visibleCrumbs: Int): Unit

Deprecated: Deprecated in Java.

The maximum number of breadcrumbs to show. Older fragment headers will be hidden from view.

Parameters
visibleCrumbs Int: the number of visible breadcrumbs. This should be greater than zero.

setOnBreadCrumbClickListener

Added in API level 12
Deprecated in API level 21
open fun setOnBreadCrumbClickListener(listener: FragmentBreadCrumbs.OnBreadCrumbClickListener!): Unit

Deprecated: Deprecated in Java.

Sets a listener for clicks on the bread crumbs. This will be called before the default click action is performed.

Parameters
listener FragmentBreadCrumbs.OnBreadCrumbClickListener!: The new listener to set. Replaces any existing listener.

setParentTitle

Added in API level 11
open fun setParentTitle(
    title: CharSequence!,
    shortTitle: CharSequence!,
    listener: View.OnClickListener!
): Unit

Deprecated: Deprecated in Java.

Inserts an optional parent entry at the first position in the breadcrumbs. Selecting this entry will result in a call to the specified listener's android.view.View.OnClickListener#onClick(View) method.

Parameters
title CharSequence!: the title for the parent entry
shortTitle CharSequence!: the short title for the parent entry
listener View.OnClickListener!: the android.view.View.OnClickListener to be called when clicked. A null will result in no action being taken when the parent entry is clicked.

setTitle

Added in API level 11
open fun setTitle(
    title: CharSequence!,
    shortTitle: CharSequence!
): Unit

Deprecated: Deprecated in Java.

Set a custom title for the bread crumbs. This will be the first entry shown at the left, representing the root of the bread crumbs. If the title is null, it will not be shown.

Protected methods

onLayout

Added in API level 11
protected open fun onLayout(
    changed: Boolean,
    l: Int,
    t: Int,
    r: Int,
    b: Int
): Unit

Deprecated: Deprecated in Java.

Called from layout when this view should assign a size and position to each of its children. Derived classes with children should override this method and call layout on each of their children.

Parameters
changed Boolean: This is a new size or position for this view
left Left position, relative to parent
top Top position, relative to parent
right Right position, relative to parent
bottom Bottom position, relative to parent

onMeasure

Added in API level 11
protected open fun onMeasure(
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
): Unit

Deprecated: Deprecated in Java.

Measure the view and its content to determine the measured width and the measured height. This method is invoked by measure(int,int) and should be overridden by subclasses to provide accurate and efficient measurement of their contents.

CONTRACT: When overriding this method, you must call setMeasuredDimension(int,int) to store the measured width and height of this view. Failure to do so will trigger an IllegalStateException, thrown by measure(int,int). Calling the superclass' onMeasure(int,int) is a valid use.

The base class implementation of measure defaults to the background size, unless a larger size is allowed by the MeasureSpec. Subclasses should override onMeasure(int,int) to provide better measurements of their content.

If this method is overridden, it is the subclass's responsibility to make sure the measured height and width are at least the view's minimum height and width (getSuggestedMinimumHeight() and getSuggestedMinimumWidth()).

Parameters
widthMeasureSpec Int: horizontal space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.
heightMeasureSpec Int: vertical space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.