Merge changes from topic 'am-62871b14-7da8-4b31-b420-c5c87d1477d2' into ub-launcher3-master

* changes:
  [automerger] Handle null background or foreground when dragging adaptive icons am: 746c6c36b6
  Handle null background or foreground when dragging adaptive icons
This commit is contained in:
Tony Wickham
2017-07-26 22:07:11 +00:00
committed by Android (Google) Code Review
@@ -242,8 +242,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() {