summaryrefslogtreecommitdiff
path: root/core/java/android/transition/Visibility.java
Commit message (Collapse)AuthorAgeFilesLines
* Reuse overlay view between two Visibility transitionsAndrey Kulikov2018-10-181-58/+87
| | | | | | | | | | Bug: 31362791 Instead of creating a new screenshot of the view every time previous visibility transition already did it or just added our startView to the overlay we can cache it and apply the animation to the same reused view. So the behaviour is the same(and expected) like in the case when no overlay is used. Test: test added in VisibilityTest Fix in AndroidX: aosp/772713 Change-Id: Iba4ab168722595eb19b9c681649a976462a5532b
* Fix crash in RecyclerView if it's view is animated by TransitionsAndrey Kulikov2018-10-151-4/+20
| | | | | | | | | | | | | | | | | When it is happening: a) Disappear Visibility transition is applied to the recyclerview(and it's children) b) Transition added the View to the ViewOverlay for an animation c) Transition is first paused before being canceled (for example when the new reversed transition wants to start after user click) d) In Visibility.onPause() we call suppressLayout(false) for RecyclerView e) RecyclerView starts layouting and tries to use our view, but it is currently added to the overlay f) So it crashes on attempt to call addView Fix: Detach a view from overlay in Visibility transition while it is paused. Attach it back in onTransitionResume if the view is still not used by someone else like RecyclerView. Bug: 33609996 Fix in AndroidX: I18d8327b338be442ec30b15fe53a99d1a2974888 Test: cts tests for Transitions Change-Id: I74f138617c8afbac9f6efa4ee9a1f4e961306c9e
* Fix IntDef's usages in the platform TransitionsAndrey Kulikov2018-09-071-2/+4
| | | | | | | | | | | | Bug: 68490704 1) Add annotation in some places where it was missed: constructors of Fade and Slide 2) Add Fade.IN and Fade.OUT into a set of allowed values for Visibility.MODE IntDef. Without it Lint will false alarm on this line: new Fade().setMode(Fade.IN); It should be allowed as Fade.IN is just a proxy value for Visibility.MODE_IN. Test: n/a Change-Id: I56d8ba5f49b1cf8f6a61357f58ac76312e7cf037
* Avoid improperly removing views during transitionsGeorge Mount2018-02-021-1/+4
| | | | | | | | | | | | | | | | | | | | | Bug: 65715616 There are two places where views were being removed improperly during transitions. The first was when making a copy of a view. Because of hardware bitmaps, views were being moved to the overlay so that the image could be copied. This CL moves the view back into its parent after copying the image. The second location is where the view was being considered an overlay. When a view is in the starting scene and the view in the end scene cannot be used, the starting scene view was being moved to the overlay. This is only valid when the view is alowed to be removed. Instead, a bitmap copy of the view is moved to the overlay. Test: manual testing Test: I0456d8a699525b08b044236c558b2d84b48c29a6 Change-Id: Ieb32b146cf65e3ff4ed6d7bb8325e74763dbd2d5
* Add more IntDef prefixes for auto-documenting.Jeff Sharkey2017-12-131-1/+4
| | | | | | | Test: builds, boots Bug: 70177949 Exempt-From-Owner-Approval: annotation-only changes Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
* Remove TransitionListener after transition completes.George Mount2016-06-141-0/+2
| | | | | | Bug 22232371 Change-Id: I1ba6f8742792ff00996b7fdaa892d5e1388ef61c
* Disable suppressLayout in Visibility Activity Transitoins.George Mount2016-03-221-3/+15
| | | | | | | | | | | | | Bug 27389255 In Idf21542464a13bac7b4d4a17f6b9303f68d550c3, I had removed a suppressLayout check from forced visibility. Unfortunately, when the transition ends, it calls layout if there was a requestLayout during the transition. This prevents the suppression at the level of the individual views so that it can be handled at the decor View level as it was before. Change-Id: I0f016e6356fd1ceff705b122a6b4ac3f3f09600d
* Don't use forceVisibility for Activity Transitions.George Mount2016-02-101-53/+16
| | | | | | | | | | | | Bug 22291911 Forced visibility for transitions was introduced to make Activity Transitions force going from INVISIBLE to VISIBLE without triggering focus changes. setTransitionVisibility was later introduced and now allows us to use visibility without triggering focus changes. Change-Id: Idf21542464a13bac7b4d4a17f6b9303f68d550c3
* Add IntDefs for Animator and Transition classes.George Mount2016-01-131-3/+13
| | | | | | Bug 23593341 Change-Id: Ifcb30322cb90efb32262c80f5d11c2d39efc5080
* Fix Fade out during Activity Transition.George Mount2015-07-061-32/+24
| | | | | | | | | | | Bug 22181705 The Fade Transition sets the transitionAlpha in onTransitionEnd. I previously changed Visibility to only do it in onAnimationEnd, so the onTransitionEnd overrides the Visibility's version. This fixes that change. Change-Id: I7df478897b6fcfec20999965e297925b65a1448b
* Merge "Add missing addPauseListener." into mnc-devGeorge Mount2015-07-011-0/+1
|\
| * Add missing addPauseListener.George Mount2015-06-301-0/+1
| | | | | | | | | | | | Bug 22112571 Change-Id: I0dd0d9a131f5630cbac6b404fb34c82073fa1a83
* | Suppress Layout during Visibility transitionsGeorge Mount2015-06-221-5/+38
|/ | | | | | | | | | | | Bug 21770464 Layout while a View is transitioning out can cause strange behavior during the animation. This CL suppresses the layout during the transition. It also invalidates the parent when it has been removed rather than requesting layout on it. Change-Id: I471243f5beef44d3bbed9ce844e66195dbf4ae10
* Have the final setVisibility cause a requestLayout.George Mount2015-06-151-1/+1
| | | | | | Bug 21770464 Change-Id: I8c501e8a681634cb87857cf9286b888e61101f13
* Merge "API Council changes." into mnc-devGeorge Mount2015-06-081-5/+5
|\
| * API Council changes.George Mount2015-06-051-5/+5
| | | | | | | | | | | | Bug 21571897 Change-Id: I681096c50a6f4a448e399b482742efc06229fab1
* | Don't cause requestLayout when transition changes Visibility.George Mount2015-06-051-5/+5
|/ | | | | | | | | | | | Bug 21400515 When a Visibility transition temporarily changes a View's visibility, it should not cause a requestLayout or any other action, such as focus change. This adds a hidden method to View to allow it to tweak the visibility without causing other side-effects. Change-Id: I5a06149983051319080130e5b5e7cc7edda8dd3e
* Fix Visibility not changing until Animator ends.George Mount2015-05-041-36/+81
| | | | | | | | | | Sometimes an animator will be interrupted before it starts during a transition and the onAnimatorEnd will not be called. In this case, we must set the final state in the onTransitionEnd. Bug 20416564 Change-Id: I388895215ba2b1c500de3a5afcae8db1fea288f7
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-3/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* Increase visibility of Transition.areValuesChanged() to protected to allowTodd Volkert2015-02-121-2/+2
| | | | | | subclasses outside the android.transition package to override it. Change-Id: Ib6a5502827e734de7494958b510afc9ddb80dffe
* Revert "Increase visibility of Transition.areValuesChanged() to protected to ↵Todd Volkert2015-02-121-2/+2
| | | | | | | | allow subclasses outside the android.transition package to override it." This reverts commit d23391eafe9f46ff01d5dc936126a4d6ae1c53d3. Change-Id: Id7211a0fd08b9bc8ad092501de3c3efa57bf8264
* Increase visibility of Transition.areValuesChanged() to protected to allowTodd Volkert2015-02-121-2/+2
| | | | | | subclasses outside the android.transition package to override it. Change-Id: Ife5de79b339b6d7598411ad851858f4c52a89f5c
* Fix Visibility transitions canceling when nothing has changed.George Mount2014-11-141-0/+1
| | | | | | Bug 18377719 Change-Id: I4ba282bba928781e7b8a62e813cb83f8bf78b58c
* Fix transition being canceled improperly.George Mount2014-10-221-2/+9
| | | | | | | | | | | | | Bug 18092208 When a transition is determining whether or not it should be canceled, the old values and new values are compared. Previously, the if a value was in the old values, but not in the new values then the value was considered changed. This discounts that transitions sometimes don't target views and it may be that no value was populated. Change-Id: I8210ba1e44921fadedf9ead571d380ad34e73d3f
* Fixed OOM due to visibility transitions.George Mount2014-09-151-31/+8
| | | | | | | | | | | | | Have maximum size for Visibility transition bitmaps. Also changed Visibility to avoid transitioning out child views while transitioning out their parents. Also moved view-to-bitmap code to common utility. Bug 17469198 Change-Id: I05f069a267539b479da1b39cdad2cc9270c5c381
* Omit appearing views that have a parent that is also appearing.Craig Stout2014-09-101-0/+12
| | | | | b/17460766 Change-Id: Ib3fe619e271688c93a5cd4cb4d557e6cca5baa34
* Improve Visibility parent value check.George Mount2014-09-071-6/+10
| | | | | | | | | | | | | | | | Bug 17412818 Bug 16398271 The Visibility Transition must not run against children that are already disappearing or there will be, for example, a double fade-out effect. Before this change, if a parent matched another view, it would prevent its child from disappearing. This change also removes using the overlay for children that have been removed from the view hierarchy indirectly. This prevents ListView and RecyclerView children from being added to the overlay. Change-Id: Iac0610f0939da8643b98812ee1ec1c8d1d70a215
* Update API per council requestsCraig Mautner2014-08-251-3/+3
| | | | | | | | | | | launchTaskBehindBackgroundAnimation => launchTaskBehindTargetAnimation visibilityMode => transitionVisiblityMode makeLaunchTaskBehindAnimation => makeTaskLaunchBehind launch_task_behind_background = launch_task_behind_target Fixes bug 16958544. Change-Id: I3b7c791fc0671b8071a5377cf6fa878bd5861f70
* Add Parent Change to ChangeTransformDake Gu2014-08-211-2/+0
| | | | | | | | | Bug 16460123 Modified ChangeTransform to support any pivot changes. Modified ChangeTransform to support changes between parents. Change-Id: I6374890dab9f3d795f334b951bdb9d51d434b8ee
* Fix visibility propagation check.George Mount2014-07-311-1/+1
| | | | | | Bug 16704963 Change-Id: I2538bac4b4565ac8c6b27407c7679fea55b1092b
* API Council: Change docs and constant names.George Mount2014-07-221-11/+11
| | | | | | | | | Bug 16401545 Changed doc for ChangeImageTransform. Changed IN/OUT to MODE_IN/MODE_OUT. Changed mode to flag attribute. Change-Id: Ia2ae9930f9725871c9b1d80b758a3a0808a8f0c6
* Don't change View visibility during activity transitions.George Mount2014-07-101-12/+39
| | | | | | | | | | Bug 16187776 Changing View visibility can change the View's focused item. To prevent this, a backdoor is introduced into Transition and Visiblity to set the target Visibility used in Activity Transitions. Change-Id: Idfd2c6fba2cad80fecdfd086990ddc604f86ca68
* Add curved motion to Transitions.George Mount2014-06-301-1/+29
| | | | | | | | | | Bug 15197527 Added two public PathMotions: PatternMotion and ArcMotion. ArcMotion is the algorithm provided by UX. PatternMotion provides a mechanism for using a Path as a pattern. Change-Id: Ie57fd5f4e62269acc1164eced39853a12c52bd77
* Add IN/OUT flag for all Visibility transitions.George Mount2014-06-261-0/+37
| | | | | | Bug 15758206 Change-Id: If9b1871117a6808c87adc84ab9215b913ebd2704
* Fix blinking animation during Visibility transitions.George Mount2014-06-181-10/+10
| | | | | | Bug 15618501 Change-Id: I9dff9eb386a4bfb51caec24f3f7cc0fad06ae04c
* Allow antroid.transition Transitions in fragments.George Mount2014-06-171-8/+39
| | | | | | | Bug 15274281 Bug 15189829 Change-Id: I8e2974430b84a611866fe20afe1f5745e803683f
* Add view name to Transition matching.George Mount2014-05-131-20/+9
| | | | | | Bug 14625214 Change-Id: Ia1b21e6bd0ea4892b504746e582aeb175e0f0506
* Fade Transition sometimes disappeared improperly.George Mount2014-04-251-1/+2
| | | | | | Bug 14320504 Change-Id: I43c2ddd34a5bd3a366027cd3c09d088baa4fb6f4
* Split Activity Transitions out of PhoneWindow.George Mount2014-04-171-2/+2
| | | | | | | | Bug 13622834 Made it possible to use shared elements without making Views invisible. Change-Id: I1e85c6bc19e634a9af225ad7f0309b4f003ea462
* Add Transitions useful for Activity transitions.George Mount2014-04-071-6/+194
| | | | | | | | | Slide: transition in and out of the edge of the scene. Explode: transition to the scene borders Moved capability from Fade to Visibility. Change-Id: Ibeb0d8f751c990edc467570d9665fbe251af2703
* Make fading transitions work betterChet Haase2013-09-261-64/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, a Fade transition would only affect a view if its parent hierarchy was not also affected between the start/end states. This caused problems for views which were removed from their parents between scenes when their parents' visibility also changed between those scenes. The effect would be that the transition would fade the parent... but the child would no longer be in that parent, so the user would just see the child view blink out. This fix ensure that views are faded appropriately by fading them regardless the parent hierarchy; if a view is removed from its parent, fade it out. Additionally, if that view has not been removed from its parent, but its parent is no longer parented *and* scene being transitioned from is based on a layout resource file (and thus the views are considered temporary after transitioning), then it is removed from its parent to be faded out in the overlay. Also, renamed TextChange to ChangeText to be more consistent with other transition class names. Change-Id: I4e0e7dfc9e9d95c7a4ca586534b6d204c4f3bae0
* Plug leaks in transitionsChet Haase2013-09-141-4/+1
| | | | | | | | | | | | | | | | Transitions were leaking views due to TransitionsValues holding references to views/parents. The references were fine, but the retention of the transition objects themselves were not. There were a few different places that needed to be plugged: - clones were not making new copies of some fields, leading to caching references in the original object (which was then cloned later to other clones) - Visibility was using a persistent field to cache temporary values. This transition, when cloned, would retain these instances, keeping references to views - ViewTreeObserver had a bug that would leak listeners Issue #10749071 Activity instance leak between TransitionManager and InputMethodManager Change-Id: I1d5d457dc5e020c7b9e8392a95e3b2c488461119
* Transition API changes from API council recommendationsChet Haase2013-09-041-0/+289
Issue #10460684 KLP API Review: android.view.transition and android.animation Issue #10570740 Transitions: inflate transition targets from xml Change-Id: I7a3f6d3aece2fcafc5efd555d033f79e86635c98