History log of /frameworks/base/core/java/android/app/BackStackRecord.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
41fb99480c84683f44b17d2d40bcbfdb8bc12b42 30-Mar-2016 George Mount <mount@google.com> Restore fragment transaction animation state information.

Bug 17487986

Change-Id: Ic5154b0dd00f07804a1008f8b9f8328f1b2ec06c
/frameworks/base/core/java/android/app/BackStackRecord.java
b67d34f10e8accd1c205e4db0679fdd32df28a6a 01-Mar-2016 George Mount <mount@google.com> Merge "Ensure that fragments are created in added order." into nyc-dev
e01f5957fbbea04138073af423c1c9ae0b510038 24-Feb-2016 Adam Powell <adamp@google.com> Protect FragmentManager against View.NO_ID container ids

Not all code paths for FragmentManager were checking that the
container view had a valid view id. As we can't correctly restore a
fragment with a container without one, throw a more descriptive
exception earlier.

Bug 27290033

Change-Id: I86e41d2f9b5197e058a7ce154c682cbcc2f9c6eb
/frameworks/base/core/java/android/app/BackStackRecord.java
a7245b42536bb9e71229651ef7135b039c7df70c 11-Feb-2016 George Mount <mount@google.com> Ensure that fragments are created in added order.

Bug 26894030

Change-Id: I522cc56ee1902eb01b21301dc32e6807217d6906
/frameworks/base/core/java/android/app/BackStackRecord.java
8585ed66b947ef30d6a43f0bb91885ed0c5ebfb4 05-Feb-2016 Adam Powell <adamp@google.com> FragmentTransaction.commitNow, framework edition

Offer commitNow and commitNowAllowingStateLoss methods on Fragment for
use by encapsulated components using fragments as implementation
details. This can help prevent unexpected ordering side effects at the
app level when a call to a library method wants to commit and
immediately initialize a fragment as an implementation detail.

Note that this change still does not permit reentrant FragmentManager
operations. It is still an error to add/remove/change fragments in the
same FragmentManager while a fragment transaction is being executed.

Have the commonly used ViewPager adapters use commitNow instead of
executePendingTransactions.

Change-Id: Ia37a871234a287423063f0c2c3e4c93d69116cad
(cherry picked from commit f6b30662f87f7339d0d3946dcf71e930c2fead9b)
/frameworks/base/core/java/android/app/BackStackRecord.java
61fa2d466a771bab22160b652d8048c5483731e8 06-Jan-2016 Aurimas Liutikas <aurimas@google.com> Change fragment removal order for fragment replacement.

Before this patch it for loop was accessing mManager.mAdded elements using
an integer index and also removing the fragments from mAdded using
mManager.removeFragment().

Bug: 24693644
Change-Id: I8e32fffa9f65c2795141f61670956740399960e4
/frameworks/base/core/java/android/app/BackStackRecord.java
0b2664913fec4103a09ffc5e08f5e55d3c4a620d 04-Dec-2015 George Mount <mount@google.com> Merge "Revert "Revert "Choose the correct Fragment to pull a Transiton from."""
233c97c26f2aa15be47e0fca9f0567b06cd03c98 04-Dec-2015 George Mount <mount@google.com> Revert "Revert "Choose the correct Fragment to pull a Transiton from.""

This reverts commit c30d875c7f21890a4167938e536771675964a613.

Change-Id: Ica7c9b6d1dc6553aae893d2ce07bedef7da7dfe5
/frameworks/base/core/java/android/app/BackStackRecord.java
128690c07ab9ced034735041e7efc00bd818cd67 03-Dec-2015 George Mount <mount@google.com> Revert "Revert "Give transitioning fragment a context prior to retrieving transition""

This reverts commit 214f6749fccb5e90e909ae1bdce567b83d286433.

Change-Id: Iced45f42251a82448e4dc4392315c3864494a31a
/frameworks/base/core/java/android/app/BackStackRecord.java
214f6749fccb5e90e909ae1bdce567b83d286433 03-Dec-2015 George Mount <mount@google.com> Revert "Give transitioning fragment a context prior to retrieving transition"

This reverts commit 2b2d23aa706c2d8efb05e15f08bdc41883a4a651.

Change-Id: Ib3010b4ba3c3d003d5143d9ea63d331c9c2d304e
/frameworks/base/core/java/android/app/BackStackRecord.java
c30d875c7f21890a4167938e536771675964a613 03-Dec-2015 George Mount <mount@google.com> Revert "Choose the correct Fragment to pull a Transiton from."

This reverts commit fbaa14bc35e8d7366596053cac8a445084bac44c.

Change-Id: Ic6953554a97bf125a69209b1db973d7fc48ab31b
/frameworks/base/core/java/android/app/BackStackRecord.java
fbaa14bc35e8d7366596053cac8a445084bac44c 30-Nov-2015 George Mount <mount@google.com> Choose the correct Fragment to pull a Transiton from.

Bug 25375640

When popping multiple back stacks or replacing multiple times
within a transaction, the wrong fragment could have been
chosen. This normally occured when one of the Fragments had
a null Transition.

Change-Id: Ic2c842d9228ee7d26bf067016cb3f307bdf92991
/frameworks/base/core/java/android/app/BackStackRecord.java
2b2d23aa706c2d8efb05e15f08bdc41883a4a651 30-Nov-2015 George Mount <mount@google.com> Give transitioning fragment a context prior to retrieving transition

Bug 23688972

An incoming fragment that is going to execute a transition may
need to have a context in order to load the transition. This
CL moves the state of incoming fragments to CREATED prior to
getting their Transitions.

Change-Id: I08b8cda479f7542fb326aa4f0f62a07ccc5662b0
/frameworks/base/core/java/android/app/BackStackRecord.java
61f83319292699658bcf4e0e0a4244832e299c84 10-Sep-2015 George Mount <mount@google.com> Ensure entering and exiting views don't match in Fragment Transitions.

Bug 23693301

An enter or exit transition targeting an ID, name, or similar
would match by the given criteria. This disreguarded that the
exiting view should not match against the entering views, even
if they have the matching criteria.

This excludes the exiting and shared elements from participating in
the enter transition and the enter and shared elements from
participating in the exit transition.

Change-Id: I4007699d2546416008f7a9fcfdb87ff504316577
/frameworks/base/core/java/android/app/BackStackRecord.java
13d7032d597755e5bb5b3b6512f48b519bb65895 21-Jul-2015 George Mount <mount@google.com> Null checks to prevent NPEs in Fragments transactions.

Bug 22631964

Change-Id: I20bc80bfb0ba5f1081d1c349b94db7c5475bcc51
/frameworks/base/core/java/android/app/BackStackRecord.java
22369d519d41a0b50bffc62b244f52229a907040 29-Jun-2014 Eddie Ringle <eddie.ringle@gmail.com> Fix FragmentTransaction replace() behavior

Bug 22174959

According to FragmentTransaction's reference, replace()
should be equivalent to remove()'ing every fragment in
a given container and then adding the specified fragment
to replace those that were removed.

Commit ee76efb74b5886f98cdfebfbefe9b69224e016fb broke
this intended behavior in the framework.

This patch makes it so that the removal loop doesn't
end prematurely. It also fixes an issue where the
replace operation would remove fragments regardless
of their container after encountering the first fragment
with a matching container ID.

Relevant issues:
http://b.android.com/43265
http://b.android.com/52112
http://b.android.com/53393
http://b.android.com/68856
http://b.android.com/70803

Change-Id: Ica4691746ab8979ed974a998e85324e4feacc5e3
Signed-off-by: Eddie Ringle <eddie.ringle@gmail.com>
/frameworks/base/core/java/android/app/BackStackRecord.java
c855f7d08f1eede615e10507d5480fceeafd3c3c 11-Jun-2015 George Mount <mount@google.com> Limit shared element transition to shared elements and children.

Bug 20257189

Shared element transitions should target the shared elements
or their children. When no target is given to a transition,
the transition should target the shared element. If a target
is given, it should also be able to target the children of
the shared element.

This is solved by wrapping the shared element transition
with a TransitionSet. The set is given the targets of all
shared elements and their children. Further, if no target
is given for a transition, the transition is given only
the shared elements as targets.

Change-Id: Ic015ca12e291ccbb47e20a49b11e3825da3e6e85
/frameworks/base/core/java/android/app/BackStackRecord.java
ec3364cc3257372f10e8bad66832874a3bf45d7d 04-Jun-2015 George Mount <mount@google.com> Clean up the enter transition even if there is not entering fragment.

Bug 21618103

Change-Id: Id670465afd0b743f964d24d7d36d49706b459ac8
/frameworks/base/core/java/android/app/BackStackRecord.java
5aec62eae12b35de8d5fe7cba29166048c167572 08-May-2015 George Mount <mount@google.com> Remove hidden/deleted APIs.

Change-Id: Iabeaac2c9b485f1f25fb2fcc3193610b0d6478c4
/frameworks/base/core/java/android/app/BackStackRecord.java
a5fc6f006f67867417b7a427de6e7394c4312dec 15-Apr-2015 Todd Kennedy <toddke@google.com> Remove dependency upon FragmentActivity

The FragmentManagerImpl is intimately tied with a FragmentActivity. In
many cases, we want to be able to create / manage Fragments outside of
a FragmentManager. This defines a FragmentController interface that can
be used by any class to host Fragments.

Bug: 19569654
Change-Id: I6816a5c1815122d206062b9f4584ad460b3d41dd
/frameworks/base/core/java/android/app/BackStackRecord.java
06ecdc1a0cab3c3886d67f32bd6d0c98e575a303 11-Apr-2015 George Mount <mount@google.com> Fix transition not properly removing targets on completion.

Bug 19770911

The enter transition was adding the non-existent View to its
list of entering Views, but was removed from the transition
improperly so that the comparison of Views formed a mismatch.

Change-Id: Iccaf5fb48e8fb5931efd75a0cd3a0b3dbcea28b6
/frameworks/base/core/java/android/app/BackStackRecord.java
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

Change-Id: I031443de83f93eb57a98863001826671b18f3b17
/frameworks/base/core/java/android/app/BackStackRecord.java
7ce5d75dc920823d83e2e34fefc3875dc8868411 31-Oct-2014 George Mount <mount@google.com> Only modify add Transition targets when they aren't targeted.

Bug 18191727

Transitions were targeting specific views, but they do this by
adding targets. If there was already a view targeted, now that
transition also targeted a different view. This prevents that
by only targeting views when no target was given.

Change-Id: I50590a81c1c1c55b1624f8df848ab53731f7e8e1
/frameworks/base/core/java/android/app/BackStackRecord.java
2deeaa33143362846299bb424b3b1a52ca45deeb 19-Sep-2014 George Mount <mount@google.com> Target only shared elements with shared element Transition

Bug 17549213
Bug 17553253

Change-Id: If54aebb4e37d2012aa8d1c5354d5ec03f92b81a3
/frameworks/base/core/java/android/app/BackStackRecord.java
0b26e4d58ab1a60340dd7ab35ca6e3bddff9f760 18-Sep-2014 George Mount <mount@google.com> Fix exception when fragment container has no View.

Bug 17535259

Change-Id: I29c9ef53dd693cbb4043ebfb4750753870c9e99a
/frameworks/base/core/java/android/app/BackStackRecord.java
27bc8aa583b437ec8ae3c13920aeabdb472125e0 15-Sep-2014 George Mount <mount@google.com> Fixed enter/exit transitions working against shared elements.

Bug 17499971

The enter and exit transitions were targeting the shared element.
This means you'd get double transitions on the shared element.

Also, the enter transition was not properly initialized to have
an invalid target so it was targeting all views.

Change-Id: I4f3510c70bea90f09be01776bc0ad1ffb42d99d5
/frameworks/base/core/java/android/app/BackStackRecord.java
ecfd007c8fe29504de517f3243613a7f00cef4fc 07-Sep-2014 George Mount <mount@google.com> Move capturing entering views until just before transition.

Bug 17407387
Bug 17420256

Recycler view doesn't instantiate its views until after
the onCreateView call. This delays the capturing of
final views until just before the entering state is
captured for the Transition.

Change-Id: I425876eae44e7e0309b5c4407db1643d467cd94e
/frameworks/base/core/java/android/app/BackStackRecord.java
6558056e8fccc32f9e1dc59e46d09f8d916b7538 29-Aug-2014 George Mount <mount@google.com> API Review: Change SharedElementListener to SharedElementCallback.

Bug 15863001
Bug 17289526

Changed SharedElementListener to SharedElementCallback
Renamed methods to use "on" prefix.
Adjusted javadoc to reflect usage in Fragments.

Change-Id: I7cc517c269a8e417cb5c3a0948bdd3b654d42472
/frameworks/base/core/java/android/app/BackStackRecord.java
c03da0e7a9ef721709d51cf8a2d539a5bd8a320e 23-Aug-2014 George Mount <mount@google.com> Make Fragment Transitions match Acitivty Transitions API

Bug 17188255

Change-Id: I506a097be4010d7156caf465c95295c58612c16e
/frameworks/base/core/java/android/app/BackStackRecord.java
448bace8612b0f9a41844339ca5db1b8eac1ac5c 19-Aug-2014 George Mount <mount@google.com> API Review: change fragment transition methods.

Bug 16959326

Change-Id: I7460ac077e81c37bbec3ed6350b6e34f7c7b6e33
/frameworks/base/core/java/android/app/BackStackRecord.java
0a2ae002e60f7ea9b6bea282086b5eb0ae3c6e51 23-Jun-2014 George Mount <mount@google.com> Revert "Revert "API Review: Change View viewName attribute to transitionName.""

This reverts commit 1bdfbc68e22a64215ab8fa3e3d17676513546997.

Change-Id: Ie3fdf53b33cb2f61c1878055940f52ed9dfc8b08
/frameworks/base/core/java/android/app/BackStackRecord.java
a3c1025b80c910fd7c0e9b1c178de32cab83f6de 23-Jun-2014 John Reck <jreck@google.com> Revert "API Review: Change View viewName attribute to transitionName."

This reverts commit f1b1adf51b2a84e0ac83685812c7e8d86590af12.

Change-Id: I0e49aeed84f2a548e272a59f4e13c3fb74c2bfd9
/frameworks/base/core/java/android/app/BackStackRecord.java
125578a8637a9ad5e7430d16b9fc0096a8b596d7 18-Jun-2014 George Mount <mount@google.com> API Review: Change View viewName attribute to transitionName.

Bug 15548520

Change-Id: I4009458d83dbffb20ff0100aaa42eea44d943378
/frameworks/base/core/java/android/app/BackStackRecord.java
d4c3c91dd0757eec9703ef90ea4c5a7ee99f18ca 09-Jun-2014 George Mount <mount@google.com> Allow antroid.transition Transitions in fragments.

Bug 15274281
Bug 15189829

Change-Id: I8e2974430b84a611866fe20afe1f5745e803683f
/frameworks/base/core/java/android/app/BackStackRecord.java
8c84109b9fbbf473b225707a38261ff5f99d95fb 24-Jun-2013 Dianne Hackborn <hackbod@google.com> Use FastPrintWriter... everywhere.

One problem this turned up is, because FastPrintWriter does
its own buffering, a lot of code that used to use PrintWriter
would fail -- if it pointed to a StringWriter, there was no
buffering, so it could just immediately get the result. Now
you need to first flush the FastPrintWriter.

Also added some new constructors to specify the size of buffer
that FastPrintWriter should use.

Change-Id: If48cd28d7be0b6b3278bbb69a8357e6ce88cf54a
/frameworks/base/core/java/android/app/BackStackRecord.java
f43a33c5ea5adb8d100ab0c3da965bac33155cb8 27-Sep-2012 Dianne Hackborn <hackbod@google.com> Work on issue #7232641: ISE crash when rotating phone in label list mode

This doesn't fix the problem; I think it is an app problem. It does
improve a bunch of the debugging to help better identify what is going
on, and introduces some checks when adding a fragment to fail
immediately if we are getting into a state when a fragment is going to
be in the added list multiple times (which is pretty much guaranteed
to lead to a failure at some point in the future).

Change-Id: If3a8700763facd61c4505c6ff872ae66875afc8d
/frameworks/base/core/java/android/app/BackStackRecord.java
ee76efb74b5886f98cdfebfbefe9b69224e016fb 05-Jun-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6584942 IllegalStateException: Failure saving state...

...active SuggestFragment{419494f0} has cleared index: -1

There were issues when the same fragment was removed and then
added again before completely finishing the remove (such as due
to a running animation).

Two fixes:

- Now when you call FragmentTransaction.replace() and are replacing
a fragment with the same fragment, this becomes a no-op, to avoid
visual artifacts in the transition and bad states.
- When we are moving the fragment state up and it is currently
animating away to the INITIALIZED state, we could end up making
the fragment inactive as part of the cleanup. In this case it
shouldn't be made inactive; we just need to initialize it but
keep it active since we are going to continue to use it.

Bug: 6584942
Change-Id: I8bfd73f2d8ef8f67b541b3e2525dfa5db6c3bfa5
/frameworks/base/core/java/android/app/BackStackRecord.java
6c285977a0dc9605348bd9530282c7d006cbf8bd 30-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix issues 5158104 and 4981556 (fragment problems)

5158104: com.android.contacts: java.lang.IllegalStateException:
Can not perform this action after onSaveInstanceState at
android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1201)

The ViewPager can just commit without worrying about a state loss,
since it can correctly reconstruct its state later.

4981556: Fragment.mImmediateActivity doesn't get restored on orientation change

I am giving up on this thing; I just don't see how it can actually
be correct. So now instead of getting an exception about a dup
add/remove at point of the add/remove call, this will happen later when
processing the transaction.

Also add an API for controlling the visibility of menus, which ViewPager
can use to have the correct menus shows. And add a method to get the
name of a back stack entry.

Change-Id: Idcba14cfa2a172545a7a2a2c466cb49ceb789619
/frameworks/base/core/java/android/app/BackStackRecord.java
d04ad541def2bca8fc2d810514ee15ab97893d35 26-Jul-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5063010: Loaders don't seem to be properly...

...retained with compatibility library

Yikes, and also in the main platform...! :(

Change-Id: I76ee3a9a5ba4a220c2f54d0af9cf49e3a736e7bd
/frameworks/base/core/java/android/app/BackStackRecord.java
47c4156567ce5abf8a6fca7fefe6ae9a20fb5117 16-Apr-2011 Dianne Hackborn <hackbod@google.com> Back-port new fragment detach APIs from support lib.

This allow a much cleaner implementation of things like the
fragment pager class.

Change-Id: I433be3d6c24c9a059d908d442bcfddbf1e8e57e5
/frameworks/base/core/java/android/app/BackStackRecord.java
bc377841db05bd5197ffadb58ba52c54b2a85f16 22-Mar-2011 Chet Haase <chet@google.com> Add custom fragment anims to be run when popping backstack

The previous fragment implementation allowed for animations
during fragment transitions, but did not account for the
different behavior of fragments when popping the back stack.
In general, you probably don't want to run the same animation
for putting a fragment on the stack as for popping it off, which
is what happens now. For example, you might fade a fragment out when
putting it on the stack. But when popping ot off, fading it out
is probably not the behavior you want.

The new API (setCustomAnimations() overload with two additional
parameters) allows developers to specify animations to be run
in the popping operation. Otherwise, the animations are null and
the operation will not be animated.

Change-Id: I2e132b3890838358e496149f18a25037a59990aa
/frameworks/base/core/java/android/app/BackStackRecord.java
327fbd2c8fa294b919475feb4c74a74ee1981e02 17-Jan-2011 Dianne Hackborn <hackbod@google.com> Fix a bunch of API review bugs.

3362464 API REVIEW: android.content potpourri
3362445 API REVIEW: Fragment transaction stuff
3362428 API REVIEW: Fragment stuff
3362418 API REVIEW: Loader stuff
3362414 API REVIEW: android.content.pm.ActivityInfo

Change-Id: I6475421a4735759b458acb67df4380cc6234f147
/frameworks/base/core/java/android/app/BackStackRecord.java
d2835935d2df8be70d1b37d3ef3b2fe0155b3422 14-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3258849: Grab thumbnail when exiting an app via back

Also issue #3281400: Rotating a retained instance fragment leaks the fragment manager

And turn off fragment debug logging.

Change-Id: Ibdd7db82bb35618021bcba421ba92ced7cd691c2
/frameworks/base/core/java/android/app/BackStackRecord.java
30d7189067524000c738c188c4ff91f84f474d25 11-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3274841: Orientation change problem with a paused activity

Plus a bunch of debug output improvements.

And some new Intent helpers for dealing with restarting an app.

Change-Id: I50ec56bca6a86c562156b13fe8a6fdf68038a12e
/frameworks/base/core/java/android/app/BackStackRecord.java
ab36acb39941ce981dddda9f9cf4d2d23a56fd26 05-Nov-2010 Dianne Hackborn <hackbod@google.com> Fixe some stuff.

Addresses these bugs:

3061847 - With no headers, PreferenceActivity crashes
2888426 - minor typo in DevicePolicyManagerService.ActiveAdmin.writeToXml()
3159155 - IllegalStateException:"Can not perform this action after
onSaveInstanceState" while dismissing a DialogFragment
3155995 - PopupWindow.showAtLocation does not respect LayoutParams

Also tweak the new fragment APIs to use abstract classes instead of
interfaces as base classes.

Change-Id: I9c0b4337fe0e304b737b5f7c2762762372bb3020
/frameworks/base/core/java/android/app/BackStackRecord.java
0c24a5514c1ff143a223720a090b19a86a75945f 04-Nov-2010 Adam Powell <adamp@google.com> Fix bug 3156280 - Fix several issues with tab navigation in action bars.

Add the ability to restrict a FragmentTransaction's ability to be
added to the back stack. (It doesn't make sense for tabs or other
scenarios to allow this.)

Change-Id: I8fa2edb5f35c365e2483010ad13eb9993f5e6570
/frameworks/base/core/java/android/app/BackStackRecord.java
c6669ca63299219d815464129dac051ab2404286 16-Sep-2010 Dianne Hackborn <hackbod@google.com> 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
/frameworks/base/core/java/android/app/BackStackRecord.java