OSDN Git Service
Preview items on palette drags
This checkin renders previews of Android views as you drag them from
the palette, using the current theme settings you have for the
associated editor. If you are using version 5 or later of the layout
library, you get full alpha-blending on the rendered views (so for
example in an analog clock you see right through it), and on older
version it simply crops out the edge color.
The preview image is semi-translucent, and the image is centered under
the mouse pointer. The drag feedback operations all relate to the top
left corner of the dragged item, so they are passed in the mouse
cursor minus the delta to the top left corner of the image.
The size of the preview is also used to provide bounds for the drag
feedback, such that we can show a preview rectangle rather than just
the insert point over layouts that support drop feedback.
Some views can't be rendered (e.g. QuickContactBadge), and some views
don't have any pixels painted (e.g. all the empty layouts), and in
that case we fall back to showing the palette item itself (the icon
and label) as you're dragging.
There's also a new utility class for SWT common utilities, like image
conversion.
Change-Id: I315c2dd733317bbada8dae89f57280ced2d7bb51
12 files changed: