Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6669ca6 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add API for showing breadcrumbs of fragment back stack.

This adds a simple API to have your back stack automatically
shown as bread crumbs in the action bar.  Introduces some APIs
to retrieve the current back stack.

Also fix a little bug in the "activated" state where it was
being propagated down the hierarchy as "selected". :p  And from
that, fix the standard colors to be reasonable when in the
activated state.

Finally PreferenceActivity is updated to take advantage of
bread crumbs to show your place in the preferences.

Change-Id: I9d633bedf8d7c6e4ed9b25cb9698faa66c7dd9a4
parent 10a96daf
Loading
Loading
Loading
Loading
+367 −0
Original line number Diff line number Diff line
@@ -2792,6 +2792,28 @@
 visibility="public"
>
</field>
<field name="breadCrumbShortTitle"
 type="int"
 transient="false"
 volatile="false"
 value="16843589"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="breadCrumbTitle"
 type="int"
 transient="false"
 volatile="false"
 value="16843588"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="bufferType"
 type="int"
 transient="false"
@@ -17384,6 +17406,17 @@
 visibility="public"
>
</field>
<field name="Widget_FragmentBreadCrumbs"
 type="int"
 transient="false"
 volatile="false"
 value="16973986"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="Widget_Gallery"
 type="int"
 transient="false"
@@ -29343,6 +29376,113 @@
</parameter>
</constructor>
</class>
<class name="FragmentBreadCrumbs"
 extends="android.view.ViewGroup"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<implements name="android.app.FragmentManager.OnBackStackChangedListener">
</implements>
<constructor name="FragmentBreadCrumbs"
 type="android.app.FragmentBreadCrumbs"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
</constructor>
<constructor name="FragmentBreadCrumbs"
 type="android.app.FragmentBreadCrumbs"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="attrs" type="android.util.AttributeSet">
</parameter>
</constructor>
<constructor name="FragmentBreadCrumbs"
 type="android.app.FragmentBreadCrumbs"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="attrs" type="android.util.AttributeSet">
</parameter>
<parameter name="defStyle" type="int">
</parameter>
</constructor>
<method name="onBackStackChanged"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onLayout"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
<parameter name="changed" type="boolean">
</parameter>
<parameter name="l" type="int">
</parameter>
<parameter name="t" type="int">
</parameter>
<parameter name="r" type="int">
</parameter>
<parameter name="b" type="int">
</parameter>
</method>
<method name="setActivity"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="a" type="android.app.Activity">
</parameter>
</method>
<method name="setTitle"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="title" type="java.lang.CharSequence">
</parameter>
<parameter name="shortTitle" type="java.lang.CharSequence">
</parameter>
</method>
</class>
<interface name="FragmentManager"
 abstract="true"
 static="false"
@@ -29350,6 +29490,30 @@
 deprecated="not deprecated"
 visibility="public"
>
<method name="addOnBackStackChangedListener"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="listener" type="android.app.FragmentManager.OnBackStackChangedListener">
</parameter>
</method>
<method name="countBackStackEntries"
 return="int"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="findFragmentById"
 return="android.app.Fragment"
 abstract="true"
@@ -29376,6 +29540,19 @@
<parameter name="tag" type="java.lang.String">
</parameter>
</method>
<method name="getBackStackEntry"
 return="android.app.FragmentManager.BackStackEntry"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="index" type="int">
</parameter>
</method>
<method name="getFragment"
 return="android.app.Fragment"
 abstract="true"
@@ -29460,6 +29637,19 @@
<parameter name="fragment" type="android.app.Fragment">
</parameter>
</method>
<method name="removeOnBackStackChangedListener"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="listener" type="android.app.FragmentManager.OnBackStackChangedListener">
</parameter>
</method>
<field name="POP_BACK_STACK_INCLUSIVE"
 type="int"
 transient="false"
@@ -29472,6 +29662,66 @@
>
</field>
</interface>
<interface name="FragmentManager.BackStackEntry"
 abstract="true"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<method name="getBreadCrumbShortTitle"
 return="java.lang.CharSequence"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getBreadCrumbTitle"
 return="java.lang.CharSequence"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getId"
 return="int"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
</interface>
<interface name="FragmentManager.OnBackStackChangedListener"
 abstract="true"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<method name="onBackStackChanged"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
</interface>
<interface name="FragmentTransaction"
 abstract="true"
 static="false"
@@ -29619,6 +29869,58 @@
<parameter name="tag" type="java.lang.String">
</parameter>
</method>
<method name="setBreadCrumbShortTitle"
 return="android.app.FragmentTransaction"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="res" type="int">
</parameter>
</method>
<method name="setBreadCrumbShortTitle"
 return="android.app.FragmentTransaction"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="text" type="java.lang.CharSequence">
</parameter>
</method>
<method name="setBreadCrumbTitle"
 return="android.app.FragmentTransaction"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="res" type="int">
</parameter>
</method>
<method name="setBreadCrumbTitle"
 return="android.app.FragmentTransaction"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="text" type="java.lang.CharSequence">
</parameter>
</method>
<method name="setCustomAnimations"
 return="android.app.FragmentTransaction"
 abstract="true"
@@ -142369,6 +142671,21 @@
<parameter name="preferenceScreen" type="android.preference.PreferenceScreen">
</parameter>
</method>
<method name="showBreadCrumbs"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="title" type="java.lang.CharSequence">
</parameter>
<parameter name="shortTitle" type="java.lang.CharSequence">
</parameter>
</method>
<method name="startPreferenceFragment"
 return="void"
 abstract="false"
@@ -142384,6 +142701,21 @@
<parameter name="push" type="boolean">
</parameter>
</method>
<method name="startPreferenceFragment"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="fragment" type="android.app.Fragment">
</parameter>
<parameter name="ft" type="android.app.FragmentTransaction">
</parameter>
</method>
<method name="startWithFragment"
 return="void"
 abstract="false"
@@ -142427,6 +142759,21 @@
<parameter name="header" type="android.preference.PreferenceActivity.Header">
</parameter>
</method>
<method name="switchToHeaderInner"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="fragmentName" type="java.lang.String">
</parameter>
<parameter name="args" type="android.os.Bundle">
</parameter>
</method>
<field name="EXTRA_NO_HEADERS"
 type="java.lang.String"
 transient="false"
@@ -142539,6 +142886,26 @@
 visibility="public"
>
</field>
<field name="breadCrumbShortTitle"
 type="java.lang.CharSequence"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="breadCrumbTitle"
 type="java.lang.CharSequence"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="extras"
 type="android.os.Bundle"
 transient="false"
+119 −50
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.app;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;

import java.util.ArrayList;
@@ -28,10 +29,14 @@ final class BackStackState implements Parcelable {
    final int mTransitionStyle;
    final String mName;
    final int mIndex;
    final int mBreadCrumbTitleRes;
    final CharSequence mBreadCrumbTitleText;
    final int mBreadCrumbShortTitleRes;
    final CharSequence mBreadCrumbShortTitleText;

    public BackStackState(FragmentManagerImpl fm, BackStackEntry bse) {
    public BackStackState(FragmentManagerImpl fm, BackStackRecord bse) {
        int numRemoved = 0;
        BackStackEntry.Op op = bse.mHead;
        BackStackRecord.Op op = bse.mHead;
        while (op != null) {
            if (op.removed != null) numRemoved += op.removed.size();
            op = op.next;
@@ -64,6 +69,10 @@ final class BackStackState implements Parcelable {
        mTransitionStyle = bse.mTransitionStyle;
        mName = bse.mName;
        mIndex = bse.mIndex;
        mBreadCrumbTitleRes = bse.mBreadCrumbTitleRes;
        mBreadCrumbTitleText = bse.mBreadCrumbTitleText;
        mBreadCrumbShortTitleRes = bse.mBreadCrumbShortTitleRes;
        mBreadCrumbShortTitleText = bse.mBreadCrumbShortTitleText;
    }

    public BackStackState(Parcel in) {
@@ -72,13 +81,17 @@ final class BackStackState implements Parcelable {
        mTransitionStyle = in.readInt();
        mName = in.readString();
        mIndex = in.readInt();
        mBreadCrumbTitleRes = in.readInt();
        mBreadCrumbTitleText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
        mBreadCrumbShortTitleRes = in.readInt();
        mBreadCrumbShortTitleText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
    }

    public BackStackEntry instantiate(FragmentManagerImpl fm) {
        BackStackEntry bse = new BackStackEntry(fm);
    public BackStackRecord instantiate(FragmentManagerImpl fm) {
        BackStackRecord bse = new BackStackRecord(fm);
        int pos = 0;
        while (pos < mOps.length) {
            BackStackEntry.Op op = new BackStackEntry.Op();
            BackStackRecord.Op op = new BackStackRecord.Op();
            op.cmd = mOps[pos++];
            if (FragmentManagerImpl.DEBUG) Log.v(FragmentManagerImpl.TAG,
                    "BSE " + bse + " set base fragment #" + mOps[pos]);
@@ -103,6 +116,10 @@ final class BackStackState implements Parcelable {
        bse.mName = mName;
        bse.mIndex = mIndex;
        bse.mAddToBackStack = true;
        bse.mBreadCrumbTitleRes = mBreadCrumbTitleRes;
        bse.mBreadCrumbTitleText = mBreadCrumbTitleText;
        bse.mBreadCrumbShortTitleRes = mBreadCrumbShortTitleRes;
        bse.mBreadCrumbShortTitleText = mBreadCrumbShortTitleText;
        bse.bumpBackStackNesting(1);
        return bse;
    }
@@ -117,6 +134,10 @@ final class BackStackState implements Parcelable {
        dest.writeInt(mTransitionStyle);
        dest.writeString(mName);
        dest.writeInt(mIndex);
        dest.writeInt(mBreadCrumbTitleRes);
        TextUtils.writeToParcel(mBreadCrumbTitleText, dest, 0);
        dest.writeInt(mBreadCrumbShortTitleRes);
        TextUtils.writeToParcel(mBreadCrumbShortTitleText, dest, 0);
    }

    public static final Parcelable.Creator<BackStackState> CREATOR
@@ -134,7 +155,8 @@ final class BackStackState implements Parcelable {
/**
 * @hide Entry of an operation on the fragment back stack.
 */
final class BackStackEntry implements FragmentTransaction, Runnable {
final class BackStackRecord implements FragmentTransaction,
        FragmentManager.BackStackEntry, Runnable {
    static final String TAG = "BackStackEntry";

    final FragmentManagerImpl mManager;
@@ -168,10 +190,33 @@ final class BackStackEntry implements FragmentTransaction, Runnable {
    boolean mCommitted;
    int mIndex;

    public BackStackEntry(FragmentManagerImpl manager) {
    int mBreadCrumbTitleRes;
    CharSequence mBreadCrumbTitleText;
    int mBreadCrumbShortTitleRes;
    CharSequence mBreadCrumbShortTitleText;

    public BackStackRecord(FragmentManagerImpl manager) {
        mManager = manager;
    }

    public int getId() {
        return mIndex;
    }

    public CharSequence getBreadCrumbTitle() {
        if (mBreadCrumbTitleRes != 0) {
            return mManager.mActivity.getText(mBreadCrumbTitleRes);
        }
        return mBreadCrumbTitleText;
    }

    public CharSequence getBreadCrumbShortTitle() {
        if (mBreadCrumbShortTitleRes != 0) {
            return mManager.mActivity.getText(mBreadCrumbShortTitleRes);
        }
        return mBreadCrumbShortTitleText;
    }

    void addOp(Op op) {
        if (mHead == null) {
            mHead = mTail = op;
@@ -306,6 +351,30 @@ final class BackStackEntry implements FragmentTransaction, Runnable {
        return this;
    }

    public FragmentTransaction setBreadCrumbTitle(int res) {
        mBreadCrumbTitleRes = res;
        mBreadCrumbTitleText = null;
        return this;
    }

    public FragmentTransaction setBreadCrumbTitle(CharSequence text) {
        mBreadCrumbTitleRes = 0;
        mBreadCrumbTitleText = text;
        return this;
    }

    public FragmentTransaction setBreadCrumbShortTitle(int res) {
        mBreadCrumbShortTitleRes = res;
        mBreadCrumbShortTitleText = null;
        return this;
    }

    public FragmentTransaction setBreadCrumbShortTitle(CharSequence text) {
        mBreadCrumbShortTitleRes = 0;
        mBreadCrumbShortTitleText = text;
        return this;
    }

    void bumpBackStackNesting(int amt) {
        if (!mAddToBackStack) {
            return;
+175 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.app;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Helper class for showing "bread crumbs" representing the fragment
 * stack in an activity.  This is intended to be used with
 * {@link ActionBar#setCustomNavigationMode(View)
 * ActionBar.setCustomNavigationMode(View)} to place the bread crumbs in
 * the navigation area of the action bar.
 *
 * <p>The default style for this view is
 * {@link android.R.style#Widget_FragmentBreadCrumbs}.
 */
public class FragmentBreadCrumbs extends ViewGroup
        implements FragmentManager.OnBackStackChangedListener {
    Activity mActivity;
    LayoutInflater mInflater;
    LinearLayout mContainer;

    // Hahah
    BackStackRecord mTopEntry;

    public FragmentBreadCrumbs(Context context) {
        this(context, null);
    }

    public FragmentBreadCrumbs(Context context, AttributeSet attrs) {
        this(context, attrs, android.R.style.Widget_FragmentBreadCrumbs);
    }

    public FragmentBreadCrumbs(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    /**
     * Attach the bread crumbs to their activity.  This must be called once
     * when creating the bread crumbs.
     */
    public void setActivity(Activity a) {
        mActivity = a;
        mInflater = (LayoutInflater)a.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mContainer = (LinearLayout)mInflater.inflate(
                com.android.internal.R.layout.fragment_bread_crumbs,
                this, false);
        addView(mContainer);
        a.getFragmentManager().addOnBackStackChangedListener(this);
        updateCrumbs();
    }

    /**
     * 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.
     */
    public void setTitle(CharSequence title, CharSequence shortTitle) {
        if (title == null) {
            mTopEntry = null;
        } else {
            mTopEntry = new BackStackRecord((FragmentManagerImpl)
                    mActivity.getFragmentManager());
            mTopEntry.setBreadCrumbTitle(title);
            mTopEntry.setBreadCrumbShortTitle(shortTitle);
        }
        updateCrumbs();
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        // Eventually we should implement our own layout of the views,
        // rather than relying on a linear layout.
        final int childCount = getChildCount();
        for (int i = 0; i < childCount; i++) {
            final View child = getChildAt(i);

            int childRight = mPaddingLeft + child.getMeasuredWidth() - mPaddingRight;
            int childBottom = mPaddingTop + child.getMeasuredHeight() - mPaddingBottom;
            child.layout(mPaddingLeft, mPaddingTop, childRight, childBottom);
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int count = getChildCount();

        int maxHeight = 0;
        int maxWidth = 0;

        // Find rightmost and bottom-most child
        for (int i = 0; i < count; i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() != GONE) {
                measureChild(child, widthMeasureSpec, heightMeasureSpec);
                maxWidth = Math.max(maxWidth, child.getMeasuredWidth());
                maxHeight = Math.max(maxHeight, child.getMeasuredHeight());
            }
        }

        // Account for padding too
        maxWidth += mPaddingLeft + mPaddingRight;
        maxHeight += mPaddingTop + mPaddingBottom;

        // Check against our minimum height and width
        maxHeight = Math.max(maxHeight, getSuggestedMinimumHeight());
        maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth());

        setMeasuredDimension(resolveSize(maxWidth, widthMeasureSpec),
                resolveSize(maxHeight, heightMeasureSpec));
    }

    @Override
    public void onBackStackChanged() {
        updateCrumbs();
    }

    void updateCrumbs() {
        FragmentManager fm = mActivity.getFragmentManager();
        int numEntries = fm.countBackStackEntries();
        int numViews = mContainer.getChildCount();
        for (int i=mTopEntry != null ? -1 : 0; i<numEntries; i++) {
            FragmentManager.BackStackEntry bse = i == -1 ? mTopEntry : fm.getBackStackEntry(i);
            int viewI = mTopEntry != null ? i+1 : i;
            if (viewI < numViews) {
                View v = mContainer.getChildAt(viewI);
                Object tag = v.getTag();
                if (tag != bse) {
                    for (int j=viewI; j<numViews; j++) {
                        mContainer.removeViewAt(viewI);
                    }
                    numViews = viewI;
                }
            }
            if (viewI >= numViews) {
                View item = mInflater.inflate(
                        com.android.internal.R.layout.fragment_bread_crumb_item,
                        this, false);
                TextView text = (TextView)item.findViewById(com.android.internal.R.id.title);
                text.setText(bse.getBreadCrumbTitle());
                item.setTag(bse);
                if (viewI == 0) {
                    text.setCompoundDrawables(null, null, null, null);
                }
                mContainer.addView(item);
            }
        }
        int viewI = mTopEntry != null ? numEntries+1 : numEntries;
        numViews = mContainer.getChildCount();
        while (numViews > viewI) {
            mContainer.removeViewAt(numViews-1);
            numViews--;
        }
    }
}
+114 −16

File changed.

Preview size limit exceeded, changes collapsed.

+52 −1
Original line number Diff line number Diff line
@@ -111,13 +111,64 @@ public interface FragmentTransaction {
    /** Fragment is being removed */
    public final int TRANSIT_FRAGMENT_CLOSE = 2 | TRANSIT_EXIT_MASK;

    /**
     * Set specific animation resources to run for the fragments that are
     * entering and exiting in this transaction.
     */
    public FragmentTransaction setCustomAnimations(int enter, int exit);
    
    /**
     * Select a standard transition animation for this transaction.  May be
     * one of {@link #TRANSIT_NONE}, {@link #TRANSIT_FRAGMENT_OPEN},
     * or {@link #TRANSIT_FRAGMENT_CLOSE}
     */
    public FragmentTransaction setTransition(int transit);

    /**
     * Set a custom style resource that will be used for resolving transit
     * animations.
     */
    public FragmentTransaction setTransitionStyle(int styleRes);
    
    /**
     * Add this transaction to the back stack.  This means that the transaction
     * will be remembered after it is committed, and will reverse its operation
     * when later popped off the stack.
     *
     * @param name An optional name for this back stack state, or null.
     */
    public FragmentTransaction addToBackStack(String name);

    /**
     * Set the full title to show as a bread crumb when this transaction
     * is on the back stack, as used by {@link FragmentBreadCrumbs}.
     *
     * @param res A string resource containing the title.
     */
    public FragmentTransaction setBreadCrumbTitle(int res);

    /**
     * Like {@link #setBreadCrumbTitle(int)} but taking a raw string; this
     * method is <em>not</em> recommended, as the string can not be changed
     * later if the locale changes.
     */
    public FragmentTransaction setBreadCrumbTitle(CharSequence text);

    /**
     * Set the short title to show as a bread crumb when this transaction
     * is on the back stack, as used by {@link FragmentBreadCrumbs}.
     *
     * @param res A string resource containing the title.
     */
    public FragmentTransaction setBreadCrumbShortTitle(int res);

    /**
     * Like {@link #setBreadCrumbShortTitle(int)} but taking a raw string; this
     * method is <em>not</em> recommended, as the string can not be changed
     * later if the locale changes.
     */
    public FragmentTransaction setBreadCrumbShortTitle(CharSequence text);

    /**
     * Schedules a commit of this transaction.  Note that the commit does
     * not happen immediately; it will be scheduled as work on the main thread
Loading