Commit Graph

217 Commits

Author SHA1 Message Date
Evan Rosky
cd5719fde4 Merge "Don't clear focus during transition animations" into pi-dev am: 09ba7e0bae
am: 13f13935ea

Change-Id: Id5e4345720f6307c1809cc0e36a144f1ddf8365b
2018-05-01 15:15:43 -07:00
Evan Rosky
8cd89cddc1 Don't clear focus during transition animations
If a view is suppressing layout, it is probably part of a
transition animation. In this case, we don't want to defocus
a focused view which may eventually have a size.

Bug: 78302781
Test: issue in bug is resolved. Transition CTS tests still pass
Change-Id: I983f41bcd68056d2150d4db29c781b63a2c321c2
2018-04-23 13:58:16 -07:00
George Mount
a69609e124 Transfer Interpolator from TransitionSet to child Transitions
Bug: 74831546

TransitionSet interpolator was never being used in child
transitions. This transfers the interpolator by setting the
interpolator of the children as they are added or when the
interpolator is set. It also works for other settings:
epicenter, path motion, and propagation.

Test: Ie8ce23fe15e6193fdb2909606e442bd2912a4c5a
Change-Id: Ia9e35639f025d14c6497fa30abf75252ff3b1423
2018-03-16 16:30:04 -07:00
John Reck
519ad488a5 Switch to public API version
Use the public API version of the same thing that the private API
access was doing. No behavior change.

Test: built
Change-Id: I4a9032cfb1d4e699f72df3b079ef363d308419e8
2018-02-12 17:30:02 -08:00
TreeHugger Robot
a20833c06d Merge "Fix bug in calculating path in ArcMotion" 2018-02-08 15:43:50 +00:00
George Mount
575ffb856e Fix bug in calculating path in ArcMotion
Bug: 73077523

When the path is perfectly horizontal, ArcMotion
was calculating a Path that had NaN values. This
corrects that problem by special casing horizontal
and vertical paths.

Test: manual with app that discovered the problem
Test: manual with test app
Test: I30d51206194e3c68ea145d3a81e05a461c4e0ca8
Change-Id: Ic1a70b79290847726fc7994d1224fd77024e0610
2018-02-07 12:44:55 -08:00
George Mount
283897b327 Avoid improperly removing views during transitions
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
2018-02-02 15:10:22 -08:00
Jeff Sharkey
ce8db99114 Add more IntDef prefixes for auto-documenting.
Test: builds, boots
Bug: 70177949
Exempt-From-Owner-Approval: annotation-only changes
Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
2017-12-13 20:05:36 -07:00
George Mount
3884b03b98 Fix Transition test failure.
Bug: 67049319

TransitionUtils was returning null when the View wasn't attached,
but Visibility transitions can do that intentionally. This CL
temporarily adds detached views to the view hierarchy as part of
an overlay while creating the hardware bitmap representation.

Test: ran transition CTS tests
Change-Id: Ie335619953653dce0224514f0d5c9c8eb00ee1a9
2017-09-29 15:03:47 -07:00
Doris Liu
a3acf73c3e Merge "Associate RenderNodes created for hw bitmap w/ views" into oc-mr1-dev 2017-09-28 02:33:48 +00:00
Doris Liu
d4c5ab8b8c Associate RenderNodes created for hw bitmap w/ views
In transition animations, in order to capture the content of a view
or a drawable in a hw bitmap, a RenderNode needs to be created. The
RenderNode was previously setup with no owning view. As a result,
in cases where RenderNode animations are triggered by the draw calls
in displaylist recording, these animations would fail for lack of a
view to animate on.

This CL ensures that when RenderNodes are created for the purpose of
populating content in a hw bitmap in transitions, there's always a
view associated with each RenderNode.

BUG: 65160121
Test: Force to repro crash by changing press state during hw bitmap
creation, which triggers a ripple animation that led to the
otherwise timing dependent and hard to repro crash.

Change-Id: I2b4ba95cad25a94d50b3904e775606f737e960e3
2017-09-27 16:53:05 -07:00
Doris Liu
4dc1ec754c Fix crash when creating a HW Bitmap on a detached view
BUG: 65160121
Test: Unable to repro the crash before or after the fix

Change-Id: I84fa28557c67a6672b8d82443d4da7be4f28a50d
2017-09-25 17:21:48 -07:00
George Mount
3f81c33a35 Use hardware bitmap for shared element snapshots.
Bug: 64851247

Drawing to software bitmaps does not support many
features, most especially hardware bitmaps. This
changes the implementation to using hardware bitmaps
for View snapshots.

Also fixed broken TransitionTest discovered while
testing.

Test: I4ede02db67e578ea4a25069b683f1989c611e06c
Change-Id: I185bbfe1f789055c9efdba5297a74e481607afaf
2017-08-23 20:51:13 +00:00
George Mount
dc93620115 Fix ChangeClipBounds to set final clip to null.
Bug 35227753

ChangeClipBounds wasn't setting the final clip to null after its
transition if the end clip was supposed to be null.

Test: I9089e0c84718d219cfda266a99fd3dffdbae8512

Change-Id: If928454b30807ccc6b34ed4dfbb14857d99d43be
2017-04-20 09:12:20 -07:00
George Mount
f31efa38f8 Ensure bounds are updated together.
Bug 37156683

The animator was setting the value twice on the first run, so
the bounds was being set improperly as the top/left was being
set from a different frame than the bottom/right.

Test: I534cc4d7534cff1206ea8c2b222e0c0852fc0e9c
Change-Id: I6fb047d2fa4d0ed0db3b44107f9815a65f1f2676
2017-04-07 12:43:28 -07:00
George Mount
f85b3d48d6 Excluded Views don't go through Transition.
Bug 35832096

When entering or exiting Views were excluded, they were still
being set to INVISIBLE during the exit transition. This made
them disappear instantly. Instead, I've reverted back to the
original implementation by not affecting excluded Views during
the transition.

This CL walks the transition and removes excluded Views from
the enter/exit from being affected.

Test: I5b1b75dd12a3914e35c1d0fb641850981a19f9c3
Change-Id: I2b00ba95575420bae690b1cd8d4894c98401da79
2017-03-13 14:09:58 -07:00
Yuichi Araki
fb6ed353a6 Recycle TypedArrays in Fade and TransitionInflater
Test: Builds
Change-Id: I91e214eafc87850dca6986af2054e5edca46e724
2017-02-10 13:47:36 +09:00
Yuichi Araki
fd62c58ede Merge "Fix doc for setReparentWithOverlay" 2017-02-07 07:35:48 +00:00
Ben Weiss
995f4b5721 Merge "Extract and unhide TransitionListenerAdapter" 2017-02-06 10:16:50 +00:00
Yuichi Araki
3f23b30c63 Fix doc for setReparentWithOverlay
Test: Doc fix only
Change-Id: I8d89be7c87cf95fd2c7799fdd8286acc13102e46
2017-02-03 15:15:13 +09:00
Ben Weiss
5de23c5eb4 Make ArcMotion material spec compliant
Upwards and downwards paths are
now curved in the same direction,
applying "gravity" to objects as they move around.

Test: CTS I40a5df051711fd719806cd88d87eeed68565d73d

Change-Id: I9e5323655dc7901393f90bb1ea2f393ca64b77ff
2017-01-05 11:43:04 +00:00
Ben Weiss
e0c37bdea3 Extract and unhide TransitionListenerAdapter
Test: CTS tested

Change-Id: I8db99d5f212b15db70ee5a6d6debf25d7ad7922d
2016-11-17 10:50:34 +00:00
George Mount
f0b46b9540 Use safe access to OnPreDrawListener.
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
2016-11-15 15:00:53 -08:00
Aurimas Liutikas
67e2ae8639 Fix import statement in view|transition|animation packages.
This change also remove trailing whitespace.

Test: code still compiles
Change-Id: I7eff4546320d67d2bae58d31bad0625ea0791b8f
2016-10-12 09:09:52 -07:00
George Mount
d0549f2e90 Fix TransitionManager.go with null Transition.
Bug: 31529500

Test: I8e5a3285bc5e2b34a1eb32afd67e3184c6d8897e
Change-Id: Ibf273d5acab4e32420093adc395034b2246bd530
2016-09-20 15:19:03 -07:00
TreeHugger Robot
50b2c2444c Merge "Return proper values from ChangeScroll.getTransitionProperties" 2016-06-27 18:39:14 +00:00
George Mount
ae61b85cb5 Return proper values from ChangeScroll.getTransitionProperties
Bug 29644621

Change-Id: I9035e94582d05889a00df61f84de46d782baea17
2016-06-24 17:29:21 -07:00
George Mount
f239f99113 Make getTransition a @TestApi for CTS tests.
Bug 29570647

Change-Id: I85b2b215fbad2ca72e67b17a29cc9b122ae5945e
2016-06-24 11:53:42 -07:00
George Mount
25f98a4c01 Remove TransitionListener after transition completes.
Bug 22232371

Change-Id: I1ba6f8742792ff00996b7fdaa892d5e1388ef61c
2016-06-14 14:11:28 -07:00
George Mount
e6b23b6ab9 Merge \\"Re-add Internal API for cross-task Activity used by assistant.\\" into nyc-mr1-dev am: 174e41b1fd
am: dff1fa4bb9

Change-Id: I76afa8d89b2ac1624a36b3114bd3891c9c734cee
2016-06-08 20:39:54 +00:00
George Mount
413739e8c6 Re-add Internal API for cross-task Activity used by assistant.
Bug: 29091742

This reverts commit 563df3b328.

This also fixes the problems experienced by b/29128683.

Change-Id: I8e3d485cb818ea9e03ca475cba88934f6f903f11
2016-06-08 07:13:37 -07:00
Eino-Ville Talvala
d9a7b1e07b Merge "Revert "Internal API for cross-task Activity used by assistant."" into nyc-mr1-dev am: fe3ecdab1b
am: abb7488998

* commit 'abb74889982603f6070100033c8fa2b1eef3d8de':
  Revert "Internal API for cross-task Activity used by assistant."

Change-Id: Id397afe9221e2562e096befc1b105233618ca7ef
2016-06-06 23:55:58 +00:00
Eino-Ville Talvala
563df3b328 Revert "Internal API for cross-task Activity used by assistant."
This reverts commit 04073dc5be.

Bug: 29128683
Change-Id: I7d9bb7bb388f38e8e5ab159a211ee7f9f4fb7ab9
2016-06-06 22:04:54 +00:00
George Mount
a9e1ad04fb Merge "Merge "Internal API for cross-task Activity used by assistant." into nyc-mr1-dev am: 3af59ef42c" into nyc-mr1-dev-plus-aosp
am: 74babe679b

* commit '74babe679b0f8e17ed73280b18bc19153764c55e':
  Internal API for cross-task Activity used by assistant.

Change-Id: I985c67a465e88f74e66600709c187c3dfc9734e9
2016-06-04 00:10:35 +00:00
George Mount
04073dc5be Internal API for cross-task Activity used by assistant.
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
2016-06-03 14:08:06 -07:00
TreeHugger Robot
e1b53d7cab Merge "Add missing @Deprecated annotations." 2016-05-25 17:46:40 +00:00
Aurimas Liutikas
514c5ef8d5 Add missing @Deprecated annotations.
Add missing @Deprecated annotations for methods with @deprecated tag
in javadoc.

Change-Id: I35b78ccb97832d86b914c21a300444ba29e33844
2016-05-24 15:22:55 -07:00
Doris Liu
bbeafd1199 Fix blue channel gets updated incorrectly in ChangeText transition
Also fixed text's alpha channel gets incorrectly reset to fully
opaque.

Bug: 28919053
Bug: 28932357
Change-Id: Ib0ae6fe56ba4e09dea69534868e764e65e888e62
2016-05-24 14:56:08 -07:00
George Mount
1349bb9c33 Disable suppressLayout in Visibility Activity Transitoins.
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
2016-03-22 13:41:57 -07:00
George Mount
fdce57b6dc Merge "Fix ArcMotion path creation in some quadrants." into nyc-dev 2016-03-10 18:19:10 +00:00
George Mount
eddc8dbed6 Fix ArcMotion path creation in some quadrants.
Bug 27577177

When ArcMotion created paths in some quadrants, the control
points were placed in the wrong place, making a non-circular
arc instead of an arc of a circle.

Change-Id: Ie842524c09385038fb1f991b877b01ee5e740f20
2016-03-09 15:30:19 -08:00
George Mount
193b821829 Merge "Fix propagation delay not working with minimum value = 0" into nyc-dev 2016-03-08 21:03:16 +00:00
George Mount
23d57f30c5 Fix propagation delay not working with minimum value = 0
Bug 27545221

When the propagation delay had a minimum value of 0, no
propagation delay was happening.

Change-Id: Id28c2cac1c40d5c57f6b49fa11a60218ac1787a0
2016-03-08 09:32:07 -08:00
Tony Mantler
cfa15bd1d5 Add hidden slide fraction call to Slide
b/27460758

Change-Id: I936ce1c0ece24dd6a9e1c546f0bf261b37ba97c1
2016-03-07 14:48:16 -08:00
George Mount
c47738d8c2 Merge "Fix TransitionSet javadoc to use transitionOrdering attribute." into nyc-dev 2016-02-16 21:38:02 +00:00
George Mount
d6505566a9 Merge "Don't use forceVisibility for Activity Transitions." into nyc-dev 2016-02-16 21:37:39 +00:00
George Mount
93aaab034f Fix TransitionSet javadoc to use transitionOrdering attribute.
Bug 27056771

Change-Id: Idb00d7e49857f6aed88a898edd957b5202581a2f
2016-02-10 15:39:17 -08:00
George Mount
45feb95c4a Null check for fade start alpha value.
Bug 27105186
Fade previously hadn't had any values saved over those captured
by Visibility. If a Transition merged two Visibility transitions,
it could avoid calling captureStartValues for the Fade transition.
This change prevents an NPE in that case. The combined transition
won't get the intermediate alpha value, but at least it won't
crash.

Change-Id: I8e5720caafda56b017dfe1cc0b16ebdf246e90c4
2016-02-10 15:14:17 -08:00
George Mount
629767288a Don't use forceVisibility for Activity Transitions.
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
2016-02-10 22:12:14 +00:00
George Mount
5affef0773 Fix Fade transition interrupt.
Bug 26963113

When a Fade transition is interrupted and reversed, the
View started the animation from the beginning. This change
captures the previous transitionAlpha and starts the animation
from the previous alpha state.

Change-Id: I801fe9ade6af4cf8446838e231bdc71841668a18
(cherry picked from commit 3cf9fa3db0)
2016-02-08 20:33:49 +00:00