Launch Your First Android app with our TOP course at 82% OFF (24 hrs ONLY) HERE
https://goo.gl/7veBXc
"Learn How To Design + Code A Complete App From Scratch To Playstore"
➨ https://www.youtube.com/watch?v=aWGGZ...
-~-~~-~~~-~~-~-
This Android Tutorial shows an example of onTouchEvent with the help of a custom ViewGroup and a custom View. The Activity forwards the ACTION_DOWN MotionEvent through its dispatchTouchEvent where we call the super implementation to forward this event to the custom ViewGroup's dispatchTouchEvent. Here we can forward this to onInterceptedTouchEvent to decide whether we want to process the MotionEvent here in the ViewGroup or pass the event to the children of this ViewGroup. If we return false here, it means let the children process the event and hence the dispatchTouchEvent is called for the children where the onTouchEvent will be triggered. if the View returns true , it means the View is interested in consuming the event thus breaking the cycle, otherwise the parents are given a chance to process the same event bubbling up from the child inside their onTouchEvent respectively. The last call is to the Activity's onTouchEvent after which the event is lost if none of them are willing to process it. By default, all of them return false in their super implementation.
OUR WEBSITE
http://slidenerd.com
How to LEARN ANDROID from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list...
2 https://www.youtube.com/playlist?list...
3 https://www.youtube.com/playlist?list...
4 https://www.youtube.com/playlist?list...
5 https://www.youtube.com/playlist?list...
How to learn JAVA from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list...
2 https://www.youtube.com/playlist?list...
How to LEARN JAVASCRIPT from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list...
How to LEARN PYTHON from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list...
OUR SOCIAL LINKS
https://www.facebook.com/groups/Andro...
Follow us on
http://google.com/+slidenerd
http://facebook.com/slidenerd
https://twitter.com/slidenerdtech
http://pinterest.com/slidenerd
WHERE TO GET CODE?
http://github.com/slidenerd
"Learn How To Design + Code A Complete App From Scratch To Playstore"
➨ https://www.youtube.com/watch?v=aWGGZ...
-~-~~-~~~-~~-~-
This Android Tutorial shows an example of onTouchEvent with the help of a custom ViewGroup and a custom View. The Activity forwards the ACTION_DOWN MotionEvent through its dispatchTouchEvent where we call the super implementation to forward this event to the custom ViewGroup's dispatchTouchEvent. Here we can forward this to onInterceptedTouchEvent to decide whether we want to process the MotionEvent here in the ViewGroup or pass the event to the children of this ViewGroup. If we return false here, it means let the children process the event and hence the dispatchTouchEvent is called for the children where the onTouchEvent will be triggered. if the View returns true , it means the View is interested in consuming the event thus breaking the cycle, otherwise the parents are given a chance to process the same event bubbling up from the child inside their onTouchEvent respectively. The last call is to the Activity's onTouchEvent after which the event is lost if none of them are willing to process it. By default, all of them return false in their super implementation.
OUR WEBSITE
http://slidenerd.com
How to LEARN ANDROID from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list...
2 https://www.youtube.com/playlist?list...
3 https://www.youtube.com/playlist?list...
4 https://www.youtube.com/playlist?list...
5 https://www.youtube.com/playlist?list...
How to learn JAVA from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list...
2 https://www.youtube.com/playlist?list...
How to LEARN JAVASCRIPT from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list...
How to LEARN PYTHON from slidenerd?
Follow this-
1 https://www.youtube.com/playlist?list...
OUR SOCIAL LINKS
https://www.facebook.com/groups/Andro...
Follow us on
http://google.com/+slidenerd
http://facebook.com/slidenerd
https://twitter.com/slidenerdtech
http://pinterest.com/slidenerd
WHERE TO GET CODE?
http://github.com/slidenerd
232 Android onTouchEvent Part 2 | | |
26,153 views views | 149,094 followers |
169 Likes | 169 Dislikes |
Education | Upload TimePublished on 7 Jan 2015 |
Không có nhận xét nào:
Đăng nhận xét