Handle Swipe Left, Right, Top, Bottom gesture events in Android Kotlin Example HD

23.03.2020
Createa a GestureDetector.SimpleOnGestureListener inner class of an Activity to trigger events when a user swipes left, right, up, down (bottom/top). Handle down event, move event, velocityX, velocityY to figure out what type of event is occurring. Delegate these events to our enclosing class, by using this@ . Show a few Kotlin secrets, too: the Elvis operator, to handle nulls, getting return value for an if test, and declaring a number literal as a float. We invoke methods in an enclosing class from an inner class. We override methods onFling() and onTouchEvent() This video is part of a playlist, available at: https://www.youtube.com/watch?v=kPen2ayMWIg&list=PL73qvSDlAVVgRp1aUnPHO0P1nzU1HPj0- All source code is freely available on GitHub, at: https://github.com/discospiff/MyPlantDiaryQ

Похожие видео

Показать еще