A set of Views which support any drawable supported by the support library (e.g. VectorDrawable) to be set as
- drawableTop
- drawableBottom
- drawableStart
- drawableEnd
allprojects {
repositories {
...
/* ADD THE FOLLOWING LINE */
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.kroegerama:ccviews:1.0.1'
}
<com.kroegerama.ccviews.CCButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/button_text"
app:drawableTopCompat="@drawable/button_top_drawable"
app:drawableBottomCompat="@drawable/button_bottom_drawable" />
<com.kroegerama.ccviews.CCTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello_world"
app:drawableStartCompat="@drawable/vec_hello"
app:drawableEndCompat="@drawable/vec_world" />
CCTextView tv = findViewById(R.id.cctv);
tv.setDrawableTopCompat(R.drawable.vector_top);