From b7a7fc9d233bad507ce893882352618b13647058 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Fri, 20 Sep 2013 16:33:08 -0700 Subject: Make fading transitions work better 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 --- core/java/com/android/internal/transition/ActionBarTransition.java | 6 +++--- core/java/com/android/internal/widget/ActionBarView.java | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'core/java/com') diff --git a/core/java/com/android/internal/transition/ActionBarTransition.java b/core/java/com/android/internal/transition/ActionBarTransition.java index 8beae8c..c1065e7 100644 --- a/core/java/com/android/internal/transition/ActionBarTransition.java +++ b/core/java/com/android/internal/transition/ActionBarTransition.java @@ -19,7 +19,7 @@ package com.android.internal.transition; import android.transition.ChangeBounds; import android.transition.Fade; -import android.transition.TextChange; +import android.transition.ChangeText; import android.transition.Transition; import android.transition.TransitionManager; import android.transition.TransitionSet; @@ -35,8 +35,8 @@ public class ActionBarTransition { static { if (TRANSITIONS_ENABLED) { - final TextChange tc = new TextChange(); - tc.setChangeBehavior(TextChange.CHANGE_BEHAVIOR_OUT_IN); + final ChangeText tc = new ChangeText(); + tc.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN); final TransitionSet inner = new TransitionSet(); inner.addTransition(tc).addTransition(new ChangeBounds()); final TransitionSet tg = new TransitionSet(); diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index a6566d5..b5d74e8 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -29,12 +29,6 @@ import android.os.Parcel; import android.os.Parcelable; import android.text.Layout; import android.text.TextUtils; -import android.transition.ChangeBounds; -import android.transition.Fade; -import android.transition.TextChange; -import android.transition.Transition; -import android.transition.TransitionManager; -import android.transition.TransitionSet; import android.util.AttributeSet; import android.view.CollapsibleActionView; import android.view.Gravity; -- cgit v1.1