[中文](https://github.com/whataa/noDrawable/blob/master/README.md) | English # NoDrawable [![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16) [![platform](https://img.shields.io/badge/platform-android-brightgreen.svg)](https://developer.android.com/index.html) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/whataa/noDrawable/blob/master/LICENSE) [![Build Status](https://travis-ci.org/whataa/noDrawable.svg?branch=master)](https://travis-ci.org/whataa/noDrawable) NoDrawable is a library aim to reduce the drawable.xml file by 99%, you can define the drawable attributes on any View directly in the layout file. ## Feature #### ① Low cost Just let your project support DataBinding. And the library has only one core method. #### ② Highly readable Directly declare the drawable attributes in the View of the layout, and see the final effect of the View at a glance; #### ③ Support any view Just like using the attributes of View itself, it works on any View; ## Set-up 1. Add the JitPack repository to your root build file: ``` allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` 2. Add the dependency to your app build.gradle [![](https://jitpack.io/v/whataa/noDrawable.svg)](https://jitpack.io/#whataa/noDrawable) ``` dependencies { ... implementation 'com.github.whataa:noDrawable:${RELEASE}' } ``` 3. let your project support DataBinding: ``` android { ... dataBinding { enabled = true } } ``` ## Usage 1. Convert your layout to the form of DataBinding: ``` ``` 2. Declare the drawable attributes in the your View: > Suppose there is a Button background is rounded and red ``` ...