Search code examples
androidgradientpreviewshapes

How to preview gradients and shapes in Android?


Is there an application or tool that can do a preview of Android XML gradients and shapes? Is very annoying having to run app in emulator each time I modify XML, it should be a better way but Google says nothing.


Solution

  • As of ADT 11, the eclipse plugin allows for a preview of gradients and drawables from the View mode of the xml. In ADT 12, there is even a drawable preview within the resource chooser dialog.

    Make sure you have updated to ADT 12 along with SDK Tools r12. Here are the relevant release notes:

    ADT 12.0.0 (July 2011)

    Visual Layout Editor:

    • Previews of drawables and colors in the resource chooser dialogs (more info).

    ADT 11.0.0 (June 2011)

    Visual Layout Editor:

    • This is the update to the layout editor you've been waiting for! It includes (almost) all the goodies demonstrated at Google I/O. Watch the video on YouTube.
    • The palette supports custom views. You can pick up any custom implementations of the View class you've created in your project or from included libraries and drag them into your layout (more info).

    I have personally been using ADT 12, and can view gradients and custom views from within the graphical layout editor itself.