Add to project
compile 'iam.thevoid.hatchdrawable:hatchdrawable:0.1'
Written in Kotlin with @JvmOverloads constructor
@JvmOverloads constructor(
private val lineWidth: Float = 1f,
private val lineSpacing: Float = 4f,
private val lineColor: Int = Color.BLACK,
degree: Float = 225f
)
Only thing you need to do - set correct vales to constructor and set this drawable as background, foreground or either something for your View.
val drawable = HatchDrawable(3, 6, Color.BLACK, 30)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
hatch.background = drawable
else {
@Suppress("DEPRECATION")
hatch.setBackgroundDrawable(drawable)
}
Demo app attached. Some screenshots below: