Skip to content

Instantly share code, notes, and snippets.

@Bloody-Badboy
Created January 5, 2023 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bloody-Badboy/46abce756ab088269752d74ebb703877 to your computer and use it in GitHub Desktop.
Save Bloody-Badboy/46abce756ab088269752d74ebb703877 to your computer and use it in GitHub Desktop.
package com.traveller
import com.google.android.material.shape.EdgeTreatment
import com.google.android.material.shape.ShapePath
class NotchEdgeTreatment(private val notchRadius: Float) : EdgeTreatment() {
override fun getEdgePath(
length: Float,
center: Float,
interpolation: Float,
shapePath: ShapePath
) {
shapePath.lineTo(center, 0f)
shapePath.addArc(
center - notchRadius,
-notchRadius,
center + notchRadius,
notchRadius,
180f,
-180f
)
shapePath.lineTo(length, 0f)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment