summaryrefslogtreecommitdiff
path: root/core/java/android/app/ActivityTransitionState.java
Commit message (Collapse)AuthorAgeFilesLines
* Only use return transition when requested.George Mount2022-08-241-1/+8
| | | | | | | | | | Fixes: 233975804 When exiting back, the activity transition should not run unless an activity transition has been requested. Test: existing ActivityTransitionTests, manually use Settings Change-Id: Ice2cf6d82c25c65076a9656ddd847a9e2aa68b80
* Revert "Clear mEnterTransitionCoordinator after content shows."George Mount2022-07-261-10/+0
| | | | | | | | | | | | This reverts commit 8aef548893f7fbf57f7cd3fa179ef88ed69e80c8. Fixes: 239497474 Fixes: 239595736 Fixes: 240211711 Reason for revert: b/240211711 b/239595736 b/239497474 Change-Id: I3b13b49c91d38055b3e5b9d772dfe21e054911b6
* Clear mEnterTransitionCoordinator after content shows.George Mount2022-06-241-0/+10
| | | | | | | | | | | | Fixes: 233975804 After content has been shown, we should clear the mEnterTransitonCoordinator so that the exit doesn't accidentally try to use the enter transition information to remove Views. Test: manually tested example from bug report Change-Id: Ida7ca354cb75953d1d5ecffc159da0d7320d4349
* Prefer WeakReference.refersTo() to get()Hans Boehm2022-01-201-1/+1
| | | | | | | | | | This is an initial pass over frameworks/core to avoid WeakReference get(), since that can cause the referent to be unnecessarily retained. Most of these were found by searching for "get() == null". Bug: 215259836 Test: Treehugger Change-Id: I5227b05ca22e83b886ccf6713989961076df3f8c
* Fixing support for shared element transitions from a windowJon Miranda2020-11-301-6/+6
| | | | | | | | | | | Previously animation from window always ran in exit mode causing the animation to play in the calling window surface instead of the launching activity surface. This causes flicker on transition end when the rendering switches to the new activity surface. Test: Verified with demo app Change-Id: I07f5aa4e390fd9dab9883894ba7b780170c0e212
* Clear the EnterTransitionCoordinator only after onResume.George Mount2019-10-171-8/+5
| | | | | | | | | | | | | | | | | | | | | Fixes: 141875256 Fixes: 142224519 In ActivityTransitionState, the mEnterTransitionCoordinator was being set to null as soon as the transition finished. In tests, transitions were being finished immediately and the mEnterTransitionCoordinator was being set to null immediately. That left time for the same transition to be started again at a later time. This waits until the onResume() is called before potentially clearing the mEnterTransitionCoordinator. This means that all potential other times where a new EnterTransitionCoordinator may have been created have already passed and it is safe to clear the mEnterTransitionCoordinator. Test: ran ActivityTransition tests Change-Id: I91978a3c992b533b9074409f05c006fe700d7983
* Clear reference to EnterTransitionCoordinator when doneGeorge Mount2019-09-201-2/+10
| | | | | | | | | | | Fixes: 141162306 When transitions have completed, the EnterTransitionCoordinator is no longer needed, so should be cleared so that its references can be released. Test: ran code producing the leak Change-Id: Ia049d88a45dc27b77fcf4ab58a444457a6b87f88
* Only check isTopOfTask() when neededSunny Goyal2019-01-311-2/+2
| | | | | | | This avoids unnecessary binder call to system Test: Verified on device Change-Id: I5258550c8fbe837acc93e89f21a44464a00c7d6e
* Adding support for cross-task hero transitionSunny Goyal2018-10-181-12/+24
| | | | | | | | | | | | > Do not show starting window when using hero transition > When running cross-task, only play the enter animation > Allow transitions when using intent-sender Bug: 113071278 Test: atest cts/tests/tests/transition/src/android/transition/cts/ActivityTransitionTest.java atest cts/tests/tests/app.usage/src/android/app/usage/cts/ActivityTransitionTest.java Change-Id: Id973d52412a9a2cde3ebcae3b718556c47dfff5d
* Add methods to query animation stateChet Haase2017-01-301-0/+20
| | | | | | | | | | | | | Testing utilities want the ability to know whether things in the UI are in flux and they need to wait before testing on-screen values. These changes (a subset of what's needed, but will have to do for a start) allow querying of ActivityTransitions and ProgressBar, two common/difficult pieces in the puzzle. Test: CTS tests at ag/1835467 Bug: 30978257 Provide view transition Api to prevent flaky tests Change-Id: If63b3d0dde2178d826ac1dbfad0fc50e5ed9a780
* Use safe access to OnPreDrawListener.George Mount2016-11-151-13/+8
| | | | | | | | | | | | | | | | | | Bug 32472451 It is important to remove an OnPreDrawListener from the correct ViewTreeObserver. When a View is added to the view hierarchy, the initial ViewTreeObserver is not active. The listener must then be removed from the current OnPreDrawListener. When a View has been removed from the hierarchy, it is important to remove the listener from the orignal ViewTreeObserver. Test: cts-tradefed run singleCommand cts -d --skip-preconditions --skip-connectivity-check -m CtsUsageStatsTestCases Test: cts-tradefed run singleCommand cts -d --skip-preconditions --skip-connectivity-check -m CtsFragmentTestCases Change-Id: I735f71d2d9c84e86ef846aab0088a8651300fbe8
* Set the Intent class loader for onActivityReenter.George Mount2016-09-271-1/+6
| | | | | | | | | | | Bug 29992842 This is the same thing we do in ActivityThread#deliverResults before calling Activity#dispatchActivityResult. Test: Ic5510f1b3c3c453ca9035b167ce5379e9023be20 Change-Id: I3bb94572f13d8c9a7537dfa51e436702c00f5701
* Fix NPE during Activity transition using wrong Activity.George Mount2016-08-161-2/+3
| | | | | | | | | | Bug 30786309 If the Activity used in makeSceneTransitionAnimation isn't the same one used in the startActivity call, a NullPointerException could be thrown. Change-Id: Id21c54fcf99b353feab62f7fc160997ed06e7d23
* Re-add Internal API for cross-task Activity used by assistant.George Mount2016-06-081-4/+11
| | | | | | | | | | Bug: 29091742 This reverts commit 563df3b328f5488aaa33b894748029ed00d0e263. This also fixes the problems experienced by b/29128683. Change-Id: I8e3d485cb818ea9e03ca475cba88934f6f903f11
* Revert "Internal API for cross-task Activity used by assistant."Eino-Ville Talvala2016-06-061-28/+4
| | | | | | | This reverts commit 04073dc5be4c8faad41f549617ed1c3ef999d6b2. Bug: 29128683 Change-Id: I7d9bb7bb388f38e8e5ab159a211ee7f9f4fb7ab9
* Internal API for cross-task Activity used by assistant.George Mount2016-06-031-4/+28
| | | | | | | | | | | | | | | | 29091742 A new internal API has been created for use by assistant to launch an Activity Transition from a non-Activity. The ActivityOptions are also passed along when using a spring board Activity so that the shared elements can be properly synchronized. This also fixes TransitionManager.endTransition so that it forces Transitions to end the animations. Change-Id: Id18d9765bfc0c7b438e17966455aa66d3fa3aeda
* Better handling of confused finish transition.George Mount2016-05-311-1/+1
| | | | | | | | | | Bug 28347277 When an activity calls startActivity with makeSceneTransitionAnimation and then calls finishAfterTransition, it should not do any transition and just finish. Change-Id: I00e537638fa6f24c95605f09bbafd843b569bb4d
* Removed improper check on mCalledExitCoordinator.George Mount2016-04-011-3/+0
| | | | | | | | | | Bug 27969302 mCalledExitCoordinator can be nulled before the onResume is called, so it cannot be used to determine whether or not the Activity is a caller or called. Change-Id: Ie3696ed59b89cfc8c6145d22bc230111f0813701
* If resume occurs, force finish of exiting activity.George Mount2016-03-241-3/+21
| | | | | | | Bug 27231404 Bug 27274246 Change-Id: Ia92fe6fdebced3e5a1fc9d165212ac1196f395bd
* Fix for Activity Transitions restoring views bug.George Mount2016-01-081-1/+11
| | | | | | | | | | | Bug 26426496 When finish() came immediately after finishAfterTransition(), the Views of the reentering Activity would not be restored properly. This forces the entering Views to show if they aren't already transitioning in. Change-Id: If3ab37be8eb5dd3d7649db75385adb9fa214cb4c
* Ensure feature flags are set prior to checking Activity Transition.George Mount2015-09-091-1/+7
| | | | | | | | | | | | | Bug 23764120 Window features are set in PhoneWindow.installDecor. The Activity Transition feature is checked after onCreate. If the developer hasn't accessed the decor View in onCreate, the Activity Transition feature will not have been set prior to checking it. To correct this, the decor View will be forced to be created prior to checking the Activity Transition feature state. Change-Id: I2c756b6736ae7f3a346f4f9bcef6936371ff03c5
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-1/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* Activity Transition: fix quick back after enter.George Mount2015-01-261-3/+21
| | | | | | | | | | | | | | | | Bug 19105460 When an Activity Transition was receiving an exit call immediately after the enter, the transition for the enter was still in progress. TransitionManager does not allow multiple transitions to work at once, so the enter transition would run, but the exit did not. This CL detects when the enter transition is still pending and tells the ActivityTransitionState to delay one frame so that the enter can finish its required work prior to starting the exit transition. Change-Id: I1b40f1e41d61a67da3fd672419ea321e7d0496da
* Force transitioning views to be visible when transition interrupted.George Mount2014-09-221-2/+12
| | | | | | | | | | | | | Bug 17553034 When an Activity Transition was interrupted prior to starting the enter transition, the views were not being made visible. Override the return ActivityOptions if interrupted so that the entering activity doesn't launch with a transition when coming back from recents. Change-Id: Id4e00c7bb138babfee4de71247a9df4431376e21
* Have Activity Transitions activited by a new window attribute.George Mount2014-09-111-2/+2
| | | | | | | | | | | | | | | Bug 17006497 Window content transitions were being enabled by default in the Material Theme so that Activity Transitions could be enabled by default. Unfortunately, this gave the effect that many applications did not want -- the default transition between window content is a fade out/in. Here, a new attribute is added: windowActivityTransitions that is enabled by default in the Material theme and windowContentTransitions is disabled by default in all themes. Change-Id: Iab453d608f00a48ff7ab7f09ce84b52cf5f20294
* Additional fixes for "back" with translucent windows.George Mount2014-09-031-0/+1
| | | | | | | | Ensure background is mutated before changing its alpha. Ensure resetViews is called when activity options is set. Bug 16215650 Change-Id: I8482532777652a93b2c0d05c1b902516d281baf0
* Don't blink in views that haven't transitioned yet.George Mount2014-08-141-0/+12
| | | | | | | | | | | | | Bug 16959262 Views that hadn't animated in during the enter transition were being stripped from the exit transition. This caused them to blink in as the enter transition was canceled. This pauses the entering transition so that the view positions are properly captured for the exit transition and aren't stripped. Change-Id: I39cc94ed3bf92a51f8c5fe741f0aa5456b704bf0
* Transition: remap if views in calling activity became invalidDake Gu2014-08-081-3/+2
| | | | | | | | | | | | | In activity back, the calling activity might have re-constructed UI, the accepted views captured in calling activity was detached and no longer valid. Re-query the calling activity for shared element in such case. If the app has reconstructed UI of calling activity, it is app's responsibility to assign same transition name to new view where it desires to transition back to. b/16853679 Change-Id: Ia6729c6082fbaf54c2ce17f695d5b8d66bd9187d
* Don't lose ActivityOptions during orientation change.George Mount2014-07-151-1/+7
| | | | | | Bug 16188506 Change-Id: I056153e6ddbaf328dd65b8b27a91ae773c33ea22
* Fix converting to opaque when "back" hit quickly after entering.George Mount2014-07-081-2/+2
| | | | | | | | Bug 16044696 Also ensured that there were no memory leaks. Change-Id: I9b32592a5b57b496903b2c5ede6d742e86ab5fa7
* Activity Transitions: Fix memory leak.George Mount2014-06-241-0/+11
| | | | | | Bug 15731459 Change-Id: Id357d841a0db832e2525b7bbd75c8d8ccdb757d1
* Activity Transitions: don't require transitionName.George Mount2014-06-231-34/+63
| | | | | | | | | | Bug 15585623 Bug 15607591 Exit transitions now run because exit transitions are executed with startActivity. Change-Id: Ie55793a9514c64d96e2cf1abdd2d39c4d2606a23
* Allow enter activity transitions to be delayed until data is ready.George Mount2014-06-101-5/+33
| | | | | | Bug 15539194 Change-Id: I8de9806b0bcdf8129eb3b5a555a2433f0c7be634
* Fix for quick "back" in Activity Transitions.George Mount2014-05-201-8/+13
| | | | | | | | | Bug 14990153 Stops two potential animators working against the background drawable. Forces the entering views to become visible onResume. Change-Id: I2da66b54a16c6c69533eebbeff6db7f5a7794a89
* Support Activity Transitions when activity stopped.George Mount2014-05-151-0/+204
Bug 14459812 Bug 14454812 Bug 14450295 A new transport was supported for Activity Transitions in which convertToTranslucent can now take a Bundle to transport to the calling Activity. This also allows waking Activities to regain the communication between the exiting Activity and the calling Activity. Change-Id: I29aee14b7e56d9b8b9fb656f382b2c4172b02e14