diff options
author | Nancy Chen <nancychen@google.com> | 2014-08-14 21:15:23 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-08-14 21:15:23 +0000 |
commit | 3077e7b320fd5e5b32d39ff3409f51d332aaf636 (patch) | |
tree | 855786e805428a3012137ac889b6ea3774f83649 /InCallUI | |
parent | fb18cb55adbc32dcc73d82ff8a74b5c40bf11814 (diff) | |
parent | 043bfe40b226819a0497c928dc3f40444731be3c (diff) |
am e8ff1b55: Reveal InCallUI starting from the user\'s touch point
* commit 'e8ff1b5549d15b7892740687ed204e6a723894b6':
Reveal InCallUI starting from the user's touch point
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 20 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 13 |
2 files changed, 26 insertions, 7 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index e17b9dff6..6127a1d99 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -32,6 +32,7 @@ import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.view.Display; import android.view.LayoutInflater; +import android.view.MotionEvent; import android.view.View; import android.view.ViewAnimationUtils; import android.view.ViewGroup; @@ -55,7 +56,6 @@ import java.util.List; */ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPresenter.CallCardUi> implements CallCardPresenter.CallCardUi { - private int mRevealAnimationDuration; private int mShrinkAnimationDuration; private boolean mIsLandscape; @@ -814,8 +814,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } } - public void animateForNewOutgoingCall() { + public void animateForNewOutgoingCall(Point touchPoint, Call call) { final ViewGroup parent = (ViewGroup) mPrimaryCallCardContainer.getParent(); + final Point startPoint = touchPoint; final ViewTreeObserver observer = getView().getViewTreeObserver(); observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @@ -827,11 +828,11 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr } observer.removeOnGlobalLayoutListener(this); - final int originalHeight = mPrimaryCallCardContainer.getHeight(); final LayoutIgnoringListener listener = new LayoutIgnoringListener(); mPrimaryCallCardContainer.addOnLayoutChangeListener(listener); // Prepare the state of views before the circular reveal animation + final int originalHeight = mPrimaryCallCardContainer.getHeight(); mPrimaryCallCardContainer.setBottom(parent.getHeight()); // Set up FAB. @@ -850,7 +851,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr mCallTypeLabel.setAlpha(0); mCallNumberAndLabel.setAlpha(0); - final Animator revealAnimator = getRevealAnimator(); + final Animator revealAnimator = getRevealAnimator(startPoint); final Animator shrinkAnimator = getShrinkAnimator(parent.getHeight(), originalHeight); @@ -903,15 +904,22 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr return shrinkAnimator; } - private Animator getRevealAnimator() { + private Animator getRevealAnimator(Point touchPoint) { final Activity activity = getActivity(); final View view = activity.getWindow().getDecorView(); final Display display = activity.getWindowManager().getDefaultDisplay(); final Point size = new Point(); display.getSize(size); + int startX = size.x / 2; + int startY = size.y / 2; + if (touchPoint != null) { + startX = touchPoint.x; + startY = touchPoint.y; + } + final Animator valueAnimator = ViewAnimationUtils.createCircularReveal(view, - size.x / 2, size.y / 2, 0, Math.max(size.x, size.y)); + startX, startY, 0, Math.max(size.x, size.y)); valueAnimator.setDuration(mRevealAnimationDuration); return valueAnimator; } diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 1f7db588c..03ccf157f 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -25,6 +25,7 @@ import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.content.res.Configuration; +import android.graphics.Point; import android.os.Bundle; import android.telephony.DisconnectCause; import android.text.TextUtils; @@ -39,6 +40,7 @@ import android.view.accessibility.AccessibilityEvent; import com.android.phone.common.animation.AnimUtils; import com.android.phone.common.animation.AnimationListenerAdapter; +import com.android.contacts.common.interactions.TouchPointManager; import com.android.incallui.Call.State; import java.util.Locale; @@ -450,7 +452,16 @@ public class InCallActivity extends Activity { if (intent.getBooleanExtra(NEW_OUTGOING_CALL, false)) { intent.removeExtra(NEW_OUTGOING_CALL); - mCallCardFragment.animateForNewOutgoingCall(); + + Call call = CallList.getInstance().getOutgoingCall(); + if (call == null) { + call = CallList.getInstance().getPendingOutgoingCall(); + } + + Bundle extras = call.getTelecommCall().getDetails().getExtras(); + Point touchPoint = (Point) (extras == null? + null : extras.getParcelable(TouchPointManager.TOUCH_POINT)); + mCallCardFragment.animateForNewOutgoingCall(touchPoint, call); } if (CallList.getInstance().getWaitingForAccountCall() != null) { |