Handle null background or foreground when dragging adaptive icons

Bug: 64080513
Change-Id: I5e80e8a4b4a80ebd3bc052592283eee72d59c0e2
This commit is contained in:
Tony Wickham
2017-07-26 14:32:25 -07:00
parent 4560d2f731
commit 746c6c36b6
@@ -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() {