From 7e9763e4b3806c9edaf3df4f59a3d5a6452a361c Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 26 Mar 2015 16:33:15 -0700 Subject: Fix some jank during shrink animation * Prevent call updates while animation is running * Create hardware layers for animating views before animation starts. Alpha animations on the text elements require a hardware layer to be built beforehand. Do this before the animation starts instead of after the first frame is drawn. Change-Id: I21a8a9096f36adc4688597f7469a2f05a1b5234c --- InCallUI/src/com/android/incallui/Call.java | 3 +++ .../src/com/android/incallui/CallCardFragment.java | 30 ++++++++++++++++------ InCallUI/src/com/android/incallui/CallList.java | 5 ++++ .../src/com/android/incallui/InCallPresenter.java | 16 ++++++++++++ 4 files changed, 46 insertions(+), 8 deletions(-) (limited to 'InCallUI/src') diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index 9a5228f7e..d8e76c7b5 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -22,6 +22,7 @@ import com.android.contacts.common.testing.NeededForTesting; import android.content.Context; import android.net.Uri; import android.os.Bundle; +import android.os.Trace; import android.telecom.CallProperties; import android.telecom.DisconnectCause; import android.telecom.GatewayInfo; @@ -212,6 +213,7 @@ public class Call { } private void update() { + Trace.beginSection("Update"); int oldState = getState(); updateFromTelecommCall(); if (oldState != getState() && getState() == Call.State.DISCONNECTED) { @@ -219,6 +221,7 @@ public class Call { } else { CallList.getInstance().onUpdate(this); } + Trace.endSection(); } private void updateFromTelecommCall() { diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 5f5146e19..56c099053 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -21,6 +21,8 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.LayoutTransition; import android.animation.ObjectAnimator; +import android.animation.ValueAnimator; +import android.animation.ValueAnimator.AnimatorUpdateListener; import android.app.Activity; import android.content.Context; import android.content.res.Configuration; @@ -110,6 +112,8 @@ public class CallCardFragment extends BaseFragment