diff options
author | Tony Wickham <twickham@google.com> | 2017-07-26 14:32:25 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2017-07-26 14:32:25 -0700 |
commit | 746c6c36b656115076318c353418e3ecae303bbc (patch) | |
tree | a6bdf49d6f93512b32ccf0d4fbc6b59a427b539a /src/com/android/launcher3/dragndrop | |
parent | 4560d2f731f3e0a5c377a7dc5824ee66a58b3e04 (diff) | |
download | android_packages_apps_Trebuchet-746c6c36b656115076318c353418e3ecae303bbc.tar.gz android_packages_apps_Trebuchet-746c6c36b656115076318c353418e3ecae303bbc.tar.bz2 android_packages_apps_Trebuchet-746c6c36b656115076318c353418e3ecae303bbc.zip |
Handle null background or foreground when dragging adaptive icons
Bug: 64080513
Change-Id: I5e80e8a4b4a80ebd3bc052592283eee72d59c0e2
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragView.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index c11287a0a..cdc789b16 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -239,8 +239,14 @@ public class DragView extends View { (int) (-bounds.height() * AdaptiveIconDrawable.getExtraInsetFraction()) ); mBgSpringDrawable = adaptiveIcon.getBackground(); + if (mBgSpringDrawable == null) { + mBgSpringDrawable = new ColorDrawable(Color.TRANSPARENT); + } mBgSpringDrawable.setBounds(bounds); mFgSpringDrawable = adaptiveIcon.getForeground(); + if (mFgSpringDrawable == null) { + mFgSpringDrawable = new ColorDrawable(Color.TRANSPARENT); + } mFgSpringDrawable.setBounds(bounds); new Handler(Looper.getMainLooper()).post(new Runnable() { |