summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-03-17 19:05:53 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-17 19:05:53 +0000
commitd698941b52c70a3e61bd723404c2ffc49616c25b (patch)
tree333f68acf32cff7d95d1eb60bb61d538d4f668aa
parentebd8f491645332b270bbe08e03261589cd0f7276 (diff)
parentf7b727e1123db8103b664a1c8404becdf0b90985 (diff)
am f7b727e1: am 21ed6cb1: DO NOT MERGE Fade out favorites screen when dialpad is displayed
* commit 'f7b727e1123db8103b664a1c8404becdf0b90985': DO NOT MERGE Fade out favorites screen when dialpad is displayed
-rw-r--r--src/com/android/dialer/DialtactsActivity.java33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index c51035537..5ec0863ac 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -119,7 +119,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;
@@ -371,10 +371,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);
@@ -592,17 +598,22 @@ 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) {
mFragmentsFrame.setTranslationY(0);
}
});
+
+ if (!mInDialpadSearch && !mInRegularSearch) {
+ // If the favorites fragment is showing, fade to blank.
+ mFragmentsFrame.animate().alpha(0.0f);
+ }
}
public void showSearchBar() {
@@ -611,7 +622,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);
@@ -619,7 +630,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
@@ -854,7 +866,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
}
final FragmentTransaction transaction = getFragmentManager().beginTransaction();
- transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
SearchFragment fragment;
if (mInDialpadSearch) {
@@ -900,6 +911,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 */
@@ -988,7 +1003,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
@@ -996,7 +1011,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
@@ -1026,7 +1041,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);
}