A container layout that allows you to use ShapeDrawable attributes immediately in layout xml without creating a separate ShapeDrawable

ShapeContainer
ShapeContainer is a container layout that allows you to use ShapeDrawable attributes immediately in layout xml without creating a separate ShapeDrawable.
Preview
Install
Project: build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
App: build.gradle
dependencies {
implementation 'com.github.dylan-kwon:ShapeContainer:$latest-version'
}
Attributes
<dylan.kwon.shapecontainer.ShapeContainer
android:layout_width="100dp"
android:layout_height="100dp"
android:clickable="true"
android:focusable="true"
app:solidColor="@color/white"
app:strokeColor="@color/black"
app:strokeWidth="5dp"
app:strokeDashWidth="5dp"
app:strokeDashGap="5dp"
app:cornerRadius="8dp"
app:rippleColor="@color/red"
app:enabled="true"
app:useClip="true" />
name | description |
---|---|
app:solidColor | Background color in enabled. |
app:strokeColor | Stroke color in enabled. |
app:strokeWidth | Stroke width in enabled. |
app:strokeDashWidth | Stroke dash width in enabled. |
app:strokeDashGap | Stroke dash gap in enabled. |
app:cornerRadius | Radius in enabled. |
app:rippleColor | Container ripple color. |
app:enabled | container activation status. |
app:useClip | Whether to cut corner radius. |