diff options
author | Brian Attwell <brianattwell@google.com> | 2014-09-03 17:37:04 -0700 |
---|---|---|
committer | Brian Attwell <brianattwell@google.com> | 2014-09-03 17:37:04 -0700 |
commit | 4f4ce6a88af40381ade60824081c9a8571e54afb (patch) | |
tree | fa8423fb9e53a2f2ccca6d84b0c9fac28b4a07e1 /src/com/android/contacts/widget | |
parent | 5c748642f7a2c88d8ceb5154c9c2803d3f297926 (diff) | |
download | Contacts-4f4ce6a88af40381ade60824081c9a8571e54afb.tar.gz |
Fade QC contact photo more slowly
What the spline looks like: http://jsfiddle.net/rc3rfrgc/
Bug: 17380032
Change-Id: I2edc76b068a3d848a535a6b54e82a2c8e91939dc
Diffstat (limited to 'src/com/android/contacts/widget')
-rw-r--r-- | src/com/android/contacts/widget/MultiShrinkScroller.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/contacts/widget/MultiShrinkScroller.java b/src/com/android/contacts/widget/MultiShrinkScroller.java index c631dd568..7965e8569 100644 --- a/src/com/android/contacts/widget/MultiShrinkScroller.java +++ b/src/com/android/contacts/widget/MultiShrinkScroller.java @@ -161,6 +161,12 @@ public class MultiShrinkScroller extends FrameLayout { private final PathInterpolator mTextSizePathInterpolator = new PathInterpolator(0.16f, 0.4f, 0.2f, 1); + /** + * Interpolator that starts and ends with nearly straight segments. At x=0 it has a y of + * approximately 0.25. We only want the contact photo 25% faded when half collapsed. + */ + private final PathInterpolator mWhiteBlendingPathInterpolator + = new PathInterpolator(1.0f, 0.4f, 0.9f, 0.8f); private final int[] mGradientColors = new int[] {0,0xAA000000}; private GradientDrawable mTitleGradientDrawable = new GradientDrawable( @@ -1075,7 +1081,8 @@ public class MultiShrinkScroller extends FrameLayout { EXPONENT_ALMOST_ONE); mColorMatrix.reset(); mColorMatrix.setSaturation(semiLinearBeforeMiddle); - mColorMatrix.postConcat(alphaMatrix(ratio, Color.WHITE)); + mColorMatrix.postConcat(alphaMatrix( + 1 - mWhiteBlendingPathInterpolator.getInterpolation(1 - ratio), Color.WHITE)); final float colorAlpha; if (mPhotoView.isBasedOffLetterTile()) { |