diff options
author | Yorke Lee <yorkelee@google.com> | 2014-03-17 17:46:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-03-17 17:46:29 +0000 |
commit | 623990946713902be520539f7b0cdb94b7210b41 (patch) | |
tree | 8d891c3061afad395798d9730773eedff21fba7a | |
parent | b1ac0865767a6e2ceba4ce70a0d2bf1bbae7ade5 (diff) | |
parent | 7eccf4559e3660da5715b69840b325fd7aa677a4 (diff) |
Merge "Fade out favorites screen when dialpad is displayed"
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index b0162e360..8bca7dd8b 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -121,7 +121,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private static final int ACTIVITY_REQUEST_CODE_VOICE_SEARCH = 1; - private static final int FADE_ANIMATION_DURATION = 200; + private static final int ANIMATION_DURATION = 200; private String mFilterText; @@ -387,10 +387,16 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mSmartDialSearchFragment = (SmartDialSearchFragment) fragment; mSmartDialSearchFragment.setOnPhoneNumberPickerActionListener( mPhoneNumberPickerActionListener); + if (mFragmentsFrame != null) { + mFragmentsFrame.setAlpha(1.0f); + } } else if (fragment instanceof SearchFragment) { mRegularSearchFragment = (RegularSearchFragment) fragment; mRegularSearchFragment.setOnPhoneNumberPickerActionListener( mPhoneNumberPickerActionListener); + if (mFragmentsFrame != null) { + mFragmentsFrame.setAlpha(1.0f); + } } else if (fragment instanceof PhoneFavoriteFragment) { mPhoneFavoriteFragment = (PhoneFavoriteFragment) fragment; mPhoneFavoriteFragment.setListener(mPhoneFavoriteListener); @@ -609,11 +615,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mSearchAndRemoveViewContainer.setAlpha(1); mSearchAndRemoveViewContainer.setTranslationY(0); mSearchAndRemoveViewContainer.animate().withLayer().alpha(0) - .translationY(-height).setDuration(200) + .translationY(-height).setDuration(ANIMATION_DURATION) .setListener(mHideListener); mFragmentsFrame.animate().withLayer() - .translationY(-height).setDuration(200).setListener( + .translationY(-height).setDuration(ANIMATION_DURATION).setListener( new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { @@ -624,6 +630,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mFragmentsSpacer.setVisibility(View.VISIBLE); } }); + + if (!mInDialpadSearch && !mInRegularSearch) { + // If the favorites fragment is showing, fade to blank. + mFragmentsFrame.animate().alpha(0.0f); + } } public void showSearchBar() { @@ -632,7 +643,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mSearchAndRemoveViewContainer.setAlpha(0); mSearchAndRemoveViewContainer.setTranslationY(-height); mSearchAndRemoveViewContainer.animate().withLayer().alpha(1).translationY(0) - .setDuration(200).setListener(new AnimatorListenerAdapter() { + .setDuration(ANIMATION_DURATION).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { mSearchAndRemoveViewContainer.setVisibility(View.VISIBLE); @@ -640,7 +651,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O }); mFragmentsFrame.setTranslationY(-height); - mFragmentsFrame.animate().withLayer().translationY(0).setDuration(200) + mFragmentsFrame.animate().withLayer().translationY(0).setDuration(ANIMATION_DURATION) + .alpha(1.0f) .setListener( new AnimatorListenerAdapter() { @Override @@ -847,7 +859,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } final FragmentTransaction transaction = getFragmentManager().beginTransaction(); - transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); SearchFragment fragment; if (mInDialpadSearch) { @@ -893,6 +904,10 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O // transitioned between search fragments getFragmentManager().popBackStack(0, FragmentManager.POP_BACK_STACK_INCLUSIVE); setNotInSearchUi(); + + if (isDialpadShowing()) { + mFragmentsFrame.setAlpha(0); + } } /** Returns an Intent to launch Call Settings screen */ @@ -981,7 +996,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onDragStarted(int itemIndex, int x, int y, PhoneFavoriteTileView view) { - crossfadeViews(mRemoveViewContainer, mSearchViewContainer, FADE_ANIMATION_DURATION); + crossfadeViews(mRemoveViewContainer, mSearchViewContainer, ANIMATION_DURATION); } @Override @@ -989,7 +1004,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onDragFinished(int x, int y) { - crossfadeViews(mSearchViewContainer, mRemoveViewContainer, FADE_ANIMATION_DURATION); + crossfadeViews(mSearchViewContainer, mRemoveViewContainer, ANIMATION_DURATION); } @Override @@ -1019,7 +1034,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O fadeIn.setVisibility(View.VISIBLE); fadeIn.setAlpha(0); - fadeIn.animate().alpha(1).setDuration(FADE_ANIMATION_DURATION) + fadeIn.animate().alpha(1).setDuration(ANIMATION_DURATION) .setListener(null); } |