1. Before this CL, preview layouts are not rendered in both the
BottomWidgetSheet and SearchPopupSheet because the preview
width & height are not set correctly.
2. Also applies the right padding to preview layouts.
Bug: 185374336
Test: Drag-n-drop preview layout from the full widgets picker,
the bottom widgets picker and the search widgets picker.
Change-Id: I2b6303bfe4eb86a4935a5569f6107e9d46448902
The behavior of the framework when we try to do so is undefined. In our
case, it almost work, but no clipping is applied, which is a problem for
Android S (before that, widget couldn't use clipping in the first
place).
Instead of drawing the view through a drawable, this really add the view
and adds also a badge ImageView for badges instead of drawing them
indirectly.
Note that, temporarily, we have to re-allow drawing the view after it
has been attached, but the underlying framework bug being fixed, this
should be fine (I tested it and it really seems to be).
Bug: 183609936
Test: Using hand designed app (see bug)
Change-Id: I929ef8fc81c98c49406f2d940cd5efc28319886d