summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author George Mount <mount@google.com> 2017-09-08 15:38:30 -0700
committer George Mount <mount@google.com> 2017-09-08 16:01:10 -0700
commit476aeeaba2e3b955c73bd7f9838291d57577c8dd (patch)
tree7f0299538194263492b147ebf01dad6718c04406
parent56b7e5689065215f7397f2255dee9a22f4fb2029 (diff)
Fix showing views after failed transition to translucent window.
Bug: 65268614 When an activity transition was used with the top activity being translucent, and the top activity calls finish() instead of finishAfterTransition(), the transitioned views were not being drawn properly. The source of the problem was that setTransitionVisibility() was being used instead of setVisibility(). Transitions normally use setTransitionVisibility() to modify the view's visibility without triggering an invalidation. But when we want the view to be invalidated by the visibility change, setTransitionVisibility() prevents the invalidate() from actually invalidating the view. Test: manual Change-Id: I250ea232052d1a1309d3341504cba77543a94eec
-rw-r--r--core/java/android/app/ActivityTransitionCoordinator.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index 7d4d70d49d53..9b2bfc5702cb 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -1006,9 +1006,12 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
final int numElements = mTransitioningViews == null ? 0 : mTransitioningViews.size();
for (int i = 0; i < numElements; i++) {
final View view = mTransitioningViews.get(i);
- view.setTransitionVisibility(visiblity);
if (invalidate) {
- view.invalidate();
+ // Allow the view to be invalidated by the visibility change
+ view.setVisibility(visiblity);
+ } else {
+ // Don't invalidate the view with the visibility change
+ view.setTransitionVisibility(visiblity);
}
}
}