I can't figure out how to use a gesture detector in a custom view.
I want to useonLongPress, but I don't know where to put it or how to use it.
class CustomView(context: Context, attr: AttributeSet) : View(context, attr) {
val listener = object :
GestureDetector.SimpleOnGestureListener() {
}
}
val detector = GestureDetector(context, listener)
}
Maybe someone can help me. Thank you.