Created
January 5, 2023 05:18
-
-
Save Bloody-Badboy/46abce756ab088269752d74ebb703877 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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