From 47e8844564675cbc0e3f319371cc5252ccbbb870 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 15 May 2014 17:00:42 -0700 Subject: Simplify and optimize InCall animation * Remove the scrim and directly animate the call card container * ResizeAnimation is no longer needed, instead we animate the height of the card by using an ObjectAnimator and prevent any layout changes from happening during the duration of that animation * Change together Animators to remove some boilerplate * Remove now redundant outer FrameLayout in call_card.xml Bug: 14820894 Change-Id: Ifc847a47e6e03deed902c81740272a08e09a318b --- InCallUI/res/layout/call_card.xml | 203 +++++++++------------ .../src/com/android/incallui/CallCardFragment.java | 120 ++++++------ .../incallui/animation/ResizeAnimation.java | 52 ------ 3 files changed, 154 insertions(+), 221 deletions(-) delete mode 100644 InCallUI/src/com/android/incallui/animation/ResizeAnimation.java (limited to 'InCallUI') diff --git a/InCallUI/res/layout/call_card.xml b/InCallUI/res/layout/call_card.xml index a112d66f0..cfcd98073 100644 --- a/InCallUI/res/layout/call_card.xml +++ b/InCallUI/res/layout/call_card.xml @@ -16,144 +16,119 @@ ~ limitations under the License --> - - + android:layout_height="match_parent" + android:orientation="vertical" > - + The call_info blocks are stacked vertically inside a CallCard (LinearLayout), + each with layout_weight="1". If only one line is in use (i.e. the + common case) then the 2nd call info will be GONE and thus the 1st one + will expand to fill the full height of the CallCard. --> - - + + + + android:layout_height="match_parent" + android:orientation="vertical" > - - - - - - + android:layout_height="wrap_content" + android:orientation="vertical" + android:translationZ="@dimen/primary_call_translation_z" + android:background="@color/incall_call_banner_background_color" + > - + - - - - - - - - - - + android:layout_height="wrap_content" /> + android:layout_width="match_parent" + android:layout_height="match_parent" > + + + + + - + - - - - - + + + + + - - + + + + + - + - - + - - - - + android:layout_height="0dp" + android:layout_weight="1" /> - + diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 3cebb7fe8..60575c89d 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -16,9 +16,10 @@ package com.android.incallui; -import android.animation.Animator.AnimatorListener; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.app.Activity; import android.content.Context; @@ -32,18 +33,10 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.view.ViewGroup.LayoutParams; import android.view.ViewStub; import android.view.ViewTreeObserver; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.view.accessibility.AccessibilityEvent; -import android.view.animation.Animation; -import android.widget.ImageView; -import android.widget.TextView; - -import com.android.contacts.common.animation.AnimationListenerAdapter; -import com.android.contacts.common.util.ViewUtil; -import com.android.incallui.animation.ResizeAnimation; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; @@ -59,7 +52,7 @@ public class CallCardFragment extends BaseFragment