diff options
author | Andrew Lee <anwlee@google.com> | 2014-05-06 15:33:35 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2014-05-06 18:09:12 -0700 |
commit | cdfa6c66fa29ee0de675cd77b3bc72f6fba5ef0c (patch) | |
tree | 8e1b530b04bf60b7c85bdf42b011336528e90544 /src | |
parent | 3d3ff68ffb5f0f30e03d4456892cf3e1912e39d4 (diff) |
Modify the calls in Dialer to animate the dialpad in.
Bug: 14471388
Change-Id: I7b8b59ffd49f3e5512798cd6d9e86f2f9d0417d6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 6 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 17 |
2 files changed, 14 insertions, 9 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index ce7124531..e0e976285 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -56,7 +56,6 @@ import android.widget.AbsListView.OnScrollListener; import android.widget.EditText; import android.widget.PopupMenu; import android.widget.RelativeLayout; -import android.widget.SearchView; import android.widget.Toast; import com.android.contacts.common.CallUtil; @@ -548,7 +547,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } private void showDialpadFragment(boolean animate) { - mDialpadFragment.setAdjustTranslationForAnimation(animate); + mDialpadFragment.setAnimate(animate); + final FragmentTransaction ft = getFragmentManager().beginTransaction(); if (animate) { ft.setCustomAnimations(R.anim.slide_in, 0); @@ -565,7 +565,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mDialpadFragment.clearDialpad(); } if (!mDialpadFragment.isVisible()) return; - mDialpadFragment.setAdjustTranslationForAnimation(animate); + mDialpadFragment.setAnimate(animate); final FragmentTransaction ft = getFragmentManager().beginTransaction(); if (animate) { ft.setCustomAnimations(0, R.anim.slide_out); diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 5b86c739e..245629474 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -260,7 +260,7 @@ public class DialpadFragment extends Fragment private boolean mStartedFromNewIntent = false; private boolean mFirstLaunch = false; - private boolean mAdjustTranslationForAnimation = false; + private boolean mAnimate = false; private static final String PREF_DIGITS_FILLED_BY_INTENT = "pref_digits_filled_by_intent"; @@ -358,7 +358,7 @@ public class DialpadFragment extends Fragment public boolean onPreDraw() { if (isHidden()) return true; - if (mAdjustTranslationForAnimation && fragmentView.getTranslationY() == 0) { + if (mAnimate && fragmentView.getTranslationY() == 0) { ((DialpadSlidingLinearLayout) fragmentView).setYFraction( DIALPAD_SLIDE_FRACTION); } @@ -567,8 +567,9 @@ public class DialpadFragment extends Fragment } private void configureKeypadListeners(View fragmentView) { - final int[] buttonIds = new int[] {R.id.zero, R.id.one, R.id.two, R.id.three, R.id.four, - R.id.five, R.id.six, R.id.seven, R.id.eight, R.id.nine, R.id.star, R.id.pound}; + final int[] buttonIds = new int[] {R.id.one, R.id.two, R.id.three, R.id.four, R.id.five, + R.id.six, R.id.seven, R.id.eight, R.id.nine, R.id.star, R.id.zero, R.id.pound}; + DialpadKeyButton dialpadKey; for (int i = 0; i < buttonIds.length; i++) { @@ -1611,13 +1612,17 @@ public class DialpadFragment extends Fragment if (hidden) { activity.onDialpadHidden(); } else { + if (mAnimate) { + DialpadView dialpadView = (DialpadView) getView().findViewById(R.id.dialpad_view); + dialpadView.animateShow(); + } activity.onDialpadShown(); mDigits.requestFocus(); } } - public void setAdjustTranslationForAnimation(boolean value) { - mAdjustTranslationForAnimation = value; + public void setAnimate(boolean value) { + mAnimate = value; } public void setYFraction(float yFraction) { |