Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to preview xml drawable?

I'm working on pretty complex xml drawable and i was wondering if there is any tool/plugins which allow me to preview my drawable ?

I'm looking for something similar to the "Graphical layout" tab available for layout.

For example if i have something like this :

<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">      <item android:left="0dp" android:right="0dp">          <shape android:shape="rectangle">              <gradient android:angle="-90" android:startColor="#2B2B2B"                 android:endColor="#000000" />          </shape>     </item>     <item android:top="1sp" android:bottom="26sp" >          <shape android:shape="rectangle">             <solid android:color="#10ffffff"/>     </shape>      </item> </layer-list> 

How can i preview the shape and gradient ? And i'm probably dreaming , but is there any graphical tools to build a drawable ?

like image 873
grunk Avatar asked Jun 13 '12 15:06

grunk


People also ask

What is drawable XML file?

A drawable resource is a general concept for a graphic that can be drawn to the screen and which you can retrieve with APIs such as getDrawable(int) or apply to another XML resource with attributes such as android:drawable and android:icon . There are several different types of drawables: Bitmap File.

How do I open a drawable file?

Inside Android Studio go to File -> Settings -> Plugins -> Browse repositories. Search Android Drawable Preview.


1 Answers

In Android Studio do this: View -> Tool Windows -> Preview

like image 73
Bessem Mouelhi Avatar answered Sep 27 '22 20:09

Bessem Mouelhi