From afedca374ff6e13291fa681a71a1799e2d205a05 Mon Sep 17 00:00:00 2001 From: Sai Cheemalapati Date: Wed, 4 Jun 2014 16:36:29 -0700 Subject: Moving FAB logic to ContactsCommon. Moved FAB to ContactsCommon. Cleaned up FAB Controller. Replaced implementation of FAB in InCallUI with controller. Prevented animations from happening again in InCallUI on orientaton change. FAB also repositions correctly on orientation change in InCallUI. Bug: 15386162 Change-Id: I8ea4ef8acb49a83dabe5c18223ce5bac28260824 --- InCallUI/res/layout-land/call_card_content.xml | 78 ++++++++++++++++++++++ InCallUI/res/layout/call_card.xml | 77 +++------------------ InCallUI/res/layout/call_card_content.xml | 77 +++++++++++++++++++++ InCallUI/res/values/animation_constants.xml | 21 ++++++ InCallUI/res/values/dimens.xml | 1 + .../src/com/android/incallui/CallCardFragment.java | 77 +++++++++++++++++---- .../src/com/android/incallui/InCallActivity.java | 1 + 7 files changed, 251 insertions(+), 81 deletions(-) create mode 100644 InCallUI/res/layout-land/call_card_content.xml create mode 100644 InCallUI/res/layout/call_card_content.xml create mode 100644 InCallUI/res/values/animation_constants.xml diff --git a/InCallUI/res/layout-land/call_card_content.xml b/InCallUI/res/layout-land/call_card_content.xml new file mode 100644 index 000000000..b084e4ae3 --- /dev/null +++ b/InCallUI/res/layout-land/call_card_content.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/InCallUI/res/layout/call_card.xml b/InCallUI/res/layout/call_card.xml index 658cc493e..820397d52 100644 --- a/InCallUI/res/layout/call_card.xml +++ b/InCallUI/res/layout/call_card.xml @@ -36,77 +36,18 @@ android:layout_height="0dp" android:layout_weight="5" > - - - - - - - - - - - - - - - - - - - - - - - - - + - @@ -117,13 +58,13 @@ diff --git a/InCallUI/res/layout/call_card_content.xml b/InCallUI/res/layout/call_card_content.xml new file mode 100644 index 000000000..cb6f53309 --- /dev/null +++ b/InCallUI/res/layout/call_card_content.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/InCallUI/res/values/animation_constants.xml b/InCallUI/res/values/animation_constants.xml new file mode 100644 index 000000000..f3b2c66d9 --- /dev/null +++ b/InCallUI/res/values/animation_constants.xml @@ -0,0 +1,21 @@ + + + + + 333 + 333 + diff --git a/InCallUI/res/values/dimens.xml b/InCallUI/res/values/dimens.xml index 95f110118..a60b39227 100644 --- a/InCallUI/res/values/dimens.xml +++ b/InCallUI/res/values/dimens.xml @@ -101,6 +101,7 @@ 2dp 8dp + 70dp 50dp diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 5adb0521e..3be517b39 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -23,6 +23,7 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.app.Activity; import android.content.Context; +import android.content.res.Configuration; import android.graphics.Point; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -44,6 +45,7 @@ import android.widget.TextView; import com.android.contacts.common.animation.AnimUtils; import com.android.contacts.common.util.ViewUtil; +import com.android.contacts.common.widget.FloatingActionButtonController; import java.util.List; @@ -53,8 +55,9 @@ import java.util.List; public class CallCardFragment extends BaseFragment implements CallCardPresenter.CallCardUi { - private static final int REVEAL_ANIMATION_DURATION = 333; - private static final int SHRINK_ANIMATION_DURATION = 333; + private int mRevealAnimationDuration; + private int mShrinkAnimationDuration; + private boolean mIsLandscape; // Primary caller info private TextView mPhoneNumber; @@ -76,8 +79,10 @@ public class CallCardFragment extends BaseFragment