https://github.com/ztiany/android-drawable-view
An android library for developers to avoid writing drawable XML files.
https://github.com/ztiany/android-drawable-view
android drawable material-design
Last synced: about 2 months ago
JSON representation
An android library for developers to avoid writing drawable XML files.
- Host: GitHub
- URL: https://github.com/ztiany/android-drawable-view
- Owner: Ztiany
- License: apache-2.0
- Created: 2022-11-04T10:44:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-01-02T08:52:04.000Z (over 1 year ago)
- Last Synced: 2025-03-24T00:55:26.275Z (over 1 year ago)
- Topics: android, drawable, material-design
- Language: Kotlin
- Homepage:
- Size: 17.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lib Shape/Drawable View
An android library for developers to avoid writing drawable XML files.
That would be very convenient if we can define various drawables by view's attributes. And that is
what this library can do.
## 1 Lib ShapeView
The Lib-ShapeView harnesses the ability
of [MaterialShapeDrawable](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable)
We can use views in Lib-ShapeView to define their background directly by attributes like the picture
below shown.

code snippet:
```xml
```
## 2 Lib DrawableView
But if we need a gradient drawable as a view's background. We then need views in The
Lib-DrawableView.

code snippet:
```xml
```
Acknowledgment: The core code of Lib DrawableView is copied from [又一个减少冗余 Drawable 资源的解决方案](https://mp.weixin.qq.com/s/qxMoI7UTw3WtiRR6oIDGKA)。
## 3 Installation
```groovy
implementation "io.github.ztiany:android-drawable-view:1.2.6"
```