diff options
author | George Mount <mount@google.com> | 2014-06-24 09:36:18 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2014-06-25 13:45:16 -0700 |
commit | 990205eada00ad3e575761d19607bb03e12f9aa3 (patch) | |
tree | 5e3158f1ee3d41334f7e2830ae4df3eee3c0577e /core/java/android/widget | |
parent | 16ffa8d3ef3d0a45efbca9fa7b4b32ba4ebd1e07 (diff) | |
download | frameworks_base-990205eada00ad3e575761d19607bb03e12f9aa3.zip frameworks_base-990205eada00ad3e575761d19607bb03e12f9aa3.tar.gz frameworks_base-990205eada00ad3e575761d19607bb03e12f9aa3.tar.bz2 |
Don't use overlay to transition ImageViews.
Bug 15744992
MoveImage used an overlay to transition ImageViews. This
caused strange problems when ImageViews were contained in
other Views. The new ChangeImageTransform does a smooth
transition for changes in scale type and bounds.
Change-Id: Ia5021f4828f8f818a8699b3bdd38437aeba1cfc8
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/ImageView.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index 5d578ca..e97177d 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -1117,6 +1117,20 @@ public class ImageView extends View { } } + /** @hide */ + public void animateTransform(Matrix matrix) { + if (matrix == null) { + mDrawable.setBounds(0, 0, getWidth(), getHeight()); + } else { + mDrawable.setBounds(0, 0, mDrawableWidth, mDrawableHeight); + if (mDrawMatrix == null) { + mDrawMatrix = new Matrix(); + } + mDrawMatrix.set(matrix); + } + invalidate(); + } + @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); |