36.13 Implementing the onGesturePerformed Method
All that remains before an initial test run of the application can be performed is to implement the OnGesturePerformed callback method. This is the method which will be called when a gesture is performed on the GestureOverlayView instance:
package com.ebookfrenzy.customgestures
.
.
import android.widget.Toast
import android.gesture.Gesture
class MainActivity : AppCompatActivity(), OnGesturePerformedListener {
.
.
override fun onGesturePerformed(overlay: GestureOverlayView,
gesture: Gesture) {
val predictions = gLibrary?.recognize(gesture)
predictions?.let {
...