A simple library to add gradient color to textView in android native
- You can change color of textView into gradient combination of two colors
- You can set the orientation of gradient to either vertical or horizontal
- Supports both kotlin and java
dependencies {
implementation 'com.github.veeyaarVR:SuperGradientTextView:(latest version)'
}
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
Add Gradient text view in your xml
<com.veeyaar.supergradienttextview.GradientTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Gradient Text View"
app:startColor="@color/Blue"
app:endColor="@color/Green"
app:isVertical="false"
/>
Attributes
app:startColor="@color/Blue"
app:endColor="@color/Green"
If you haven't defined any color, default color will be used (Color.BLUE, Color.GREEN)
app:isVertical="false"
If true, it sets the gradient from left to right. Else it sets from right to left If not defined, it sets the default value as false