It will allow to call this method in AndroidX Transition without reflection.
ChangeBounds#BOTTOM_RIGHT_ONLY_PROPERTY,POSITION_PROPERTY are restricted now as well as developers can just use setLeftTopRightBottom method instead (it was used as a performance optimization in third-party transitions backport)
Bug: 117521189
Bug: 117521197
Bug: 117521053
Test: new test added for the method
Change-Id: I0a29bc8cf0b3357e49f6be14270993a21a6dfeee
They were used via reflection in older versions of support transitions.
Starting from 26.0.0 it is not in use and there is no need to allow this usages.
Developers should update to the newer version of support libraries/androidx
Bug: 117521462
Bug: 117521646
Test: none
Change-Id: Ia1d5516a58c0deec68091d719065621fc588591b
I pretty sure the getter method Scene.getCurrentScene() should be promoted to be public. This method is the only option for developers to understand is the sceneRoot already in the scene they need. Otherwise they have to introduce their own states and sync it with all scene changes which is more error-prone. To make it simpler to developers we can just make the method public. As an example of usage:
void displayMessages(List<Message> messages) {
if (!messages.isEmpty()) {
if (Scene.getCurrentScene(root) != messagesScene) {
TransitionManager.go(messagesScene);
MyAnalytics.trackDisplayMessages();
(... more initialization ... )
}
messagesView.display(messages);
}
}
Test: added a cts test for getCurrentScene
Change in AndroidX: aosp/807055
Bug: 118720709
Change-Id: Ic90e3576a82b5ab9a88e38e396efd49875968011
1) Allow override values for a children of TransitionSet. For example for usages like this:
TransitionSet set = new TransitionSet().setDuration(300);
Fade fade = new Fade();
set.addTransition(fade);
fade.setDuration(100);
The result duration applied for fade transition is still 300. And it breaks all the flexibility of configuring sets.
The reason of it is clone() method which will be executed in beginDelayedTransition. And as part of clone() implementation of TransitionSet the children will be re-added to the new cloned set and set's duration will be re-applied again. To fix it I changed how we add transitions into set in clone().
2) Recently we had a bug about TransitionSet will crash during inflation if we provide duration for it via xml. I fixed similar issue for applying a path motion.
Test: added new tests for both issues
Change in AndroidX: aosp/803493
Bug: 64644617
Change-Id: If205845a83e29d49f8cced8a53d9f56a4ad740aa
Found two places where we forgot to remove TransitionListener in onTransitionEnd. I think it is important to clear it as if you reuse a transition object it will be leaked together with some views
Test: n/a
Bug: 64643817
Fixes in AndroidX: aosp/793641, aosp/795753
Change-Id: Iae0a9945a4158776f1a75c806c1f29efc049f96b
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
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
Bug: 68489306
If we use a drawable like ColorDrawable for an ImageView it has intrinsicWidth and intrinsicHeight == -1.
1) Simplified matrix calculation in ChangeImageTransform.captureValues. It makes no sense to return null as a matrix because later in createAnimator it will be considered as the identity matrix. For cases when drawableSize == -1 instead we can just use view.getImageMatrix() which would be the identity matrix.
2) There is an additional check in createAnimator() to start an empty animation if the drawable width or height is 0. But actually it worth to use it also for cases when width or height is -1, as if it goes into else branch matrix transformations will try to incorrectly change the bounds of the drawable to (0, 0, -1, -1).
3) And also actually there is a bug in createNullAnimator() method, we can't provide nulls as values for ObjectAnimator.ofObject, as later it will crash on PropertyValuesHolder.setObjectValues(Object... values) because of "values[0].getClass()". So I changed it to provide some nonnull values like Matrix.IDENTITY_MATRIX. It is not important what to provide here as NULL_MATRIX_EVALUATOR will not use the values anyway.
4) Also I found a bug in ImageView.animateTransform(). If we provide null matrix if will try to update the drawable bounds to the view size but will not take into account paddings(in the same way like configureBounds()).
Test: Tested manually on the sample app from the bug and added new tests for both cases: with view bounds change and without it
Change-Id: I0750de56f4a011e06b340ed342884b59896d92dc
Bug: 65536124
When we pass null for TransitionManager.go() there is a special logic where we forgot to call previousScene.exit(), only newscene.enter() is called.
Test: added unit tests and tested manually
Change-Id: Ibd4d5a2cc17bbfe4aaa586357446da28d4b355af
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
For all remaining unannotated code.
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: I67c8b71ea535ebffb10bf577948bd4ccb8ca069d
Adding annotations to individual fields cannot be easily done when there
are two fields defined in a single statement. Put each definition in a
statement of its own.
See go/UnsupportedAppUsage for more context.
Bug: 110868826
Test: m
Change-Id: I34e163d0984fcb666c1ea8788791f5a7740c8892
doclava was accidentally suppressing all these broken links
in @see tags. This CL fixes issues so we can start enfocing
checks for broken @see links.
Test: make docs
Change-Id: If7830ece85f8d1f27c991eae282230814726e115
Exempt-From-Owner-Approval: Fixing @see javadoc link issues that are currently completely broken
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
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
Use the public API version of the same thing that the private API
access was doing. No behavior change.
Test: built
Change-Id: I4a9032cfb1d4e699f72df3b079ef363d308419e8
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
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
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
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
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
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
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
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
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
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
Bug: 29091742
This reverts commit 563df3b328.
This also fixes the problems experienced by b/29128683.
Change-Id: I8e3d485cb818ea9e03ca475cba88934f6f903f11