Advanced Android Touches
summary
Traces how Android routes MotionEvent objects through dispatchTouchEvent and onInterceptTouchEvent down to onTouchEvent, shows why getRawX/Y and action masks matter, and recommends GestureDetector and ViewConfiguration constants instead of reimplementing basics. Presents a working GitHub demo with logs and a real build: a custom translucent bottom bar over a RecyclerView that forwards scroll gestures (a hacky but functional dispatch) so clicks pass through while scrolls are captured.
AI-written summary · about
chapters (17)
- 0:00Start
- 1:19How do those Android APIs really work?
- 2:40Motivations for you
- 3:03What happens when a user touches a screen?
- 4:12View on a screen
- 4:49boolean onTouchEvent()
- 5:56Custom 'click' listener
- 8:37Swipe down to dismiss
- 9:47Why have we been extending the View class?
- 10:13boolean dispatchTouchEvent()
- 10:34boolean onInterceptTouchEvent()
- 11:48How MotionEvents are propagated
- 15:19GestureDetector
- 15:36ViewConfiguration.java
- 16:02Multitouch
- 16:36In Summary
- 17:00Other great talks
related talks
34mHandle gestures and touch events for CustomView
42mAdvanced Scrolling Techniques on Android (en)
33mGesture navigation best practices
36mSmoke & Mirrors the Magic behind Wonderful UI in Android
44mAdvanced Scrolling Techniques on Android
21mThe Curious Case of Android Gesture Animation
39mUnderstand touch event mechanics and master gestures
27mView into the abyss
