This article original, reproduced Please note: http://blog.csdn.net/cloudzfy1/article/details/6582707
Google summer College Students' blog sharing competition-2011 android
If you like this article, please vote: http://www.google.com/intl/zh-CN/daxue/blog/vote.html#tab2Thank you.
Recently, I need to build an android project that requires multi-touch functionality.
common downtime. When the view receives an event with a new downtime, it considers that the previous action has been processed.This piece is rarely mentioned, and usually not used. But it's important.Although the parameter of this method is an event, it actually intercepts a complete action. This means that if you return true for a down event or a move event (meaning to tell the view: "I'm going to intercept, this action I'll handle!"), all events after that are no longer passed to the child vi
There are three functions for event handling in Android, Dispatchtouchevent, Onintercepttouchevent, and Ontouchevent, and these three functions return the True/false value to manage the distribution mechanism of events. In fact, three functions can be used from its function name to understand the usefulness of these functions, need to be analyzed from the wholeThe first is dispatchtouchevent, the event is passed from the parent control to the child co
Thank you !!!
Reprinted Please note: http://blog.csdn.net/richway2010/archive/2011/06/29/6574987.aspx
Bloggers: All bloggers, netizens, and everyone on the Internet! Welcome to this blog. You are welcome to have more exchanges, give more comments, learn from each other, and make mutual progress. Our slogan is: study hard and make progress every day .]
Go directly to the topic to see the effect:
Touch the screen from right to left:
Implementation:
Ideas:1. Based on View.dispatchtoucheventRole:1. When clicked, pass the container point to the control that is not its child control,!2. Pass the event to the activity below, through transparent activity or dialog!Note:1> is also available through Motionevent.obtain (downtime, eventtime, action, X, Y, metaState), simulated events, such as for booting,.The container to be clicked:public class Mylinearlayout extends LinearLayout {public mylinearlayout (Context arg0, AttributeSet arg1) {//TODO Auto
touching?
2. Does the Android system know what you want to do? For example, click, scroll, long press, or others?
5. Explain the above 2nd questions in sequence, because the view must be first found based on the guess, and then the view is specified for corresponding processing. The event Learning Series is going to learn from bottom to bottom. Let's take a look at the second question. How does the system know what users want? (What is a user's gest
Reprinted from Http://www.cnblogs.com/xiaoweiz/p/3833079.htmlFirst, let's look at the definition of touch mode. It is a state of the view hierarchy when the user interacts with the phone. It's very easy to understand,Represents whether the most recent interaction occurred through a touchscreen, because there are other ways of interacting on Android devices, such as d-pad, scrolling balls, and so on.Why is
Li huaming himiOriginal, reprinted must be explicitly noted:Reprinted from[Heimi gamedev block]Link: http://www.himigame.com/android-game/384.html
,
This chapter is part of the game development book being created. It has not been updated for a long time due to the writing of the book. Sorry, I am sorry for everyone. So let's release a part of the book today and let everyone get started first;
On Android p
Android Application Development-full solution to custom View touch-related toolsBackground
Recently, there have been some chaos, various things, and various intersections. Fortunately, there is a bit more self-motivated, so we will continue to sort out the core knowledge of the custom series. As mentioned in the previous blog on custom controls, we will not teach you how to take things, but how to teach the
Opening language: The recent program in a small effect, to use the touch, the results of the cloud inside the fog, and simply a good look at the Android touch mechanism, hehe.Each ViewGroup subclass in the Android system has the following methods that are closely related to the next three and touchevent processing:1) P
The recent news list of dropdown down the up move and so on let me very headache, inadvertently saw a very good post, reproduced as follows:Opening language: The recent program in a small effect, to use the touch, the results of the cloud inside the fog, and simply a good look at the Android touch mechanism, hehe.Each ViewGroup subclass in the
Nothing to visit the forum, inadvertently saw a very good post, reproduced as follows:Opening language: The recent program in a small effect, to use the touch, the results of the cloud inside the fog, and simply a good look at the Android touch mechanism, hehe.Each ViewGroup subclass in the Android system has the follo
The previous article layer describes the transfer mechanism for Android Touch events (Motionevent) from the framework layer. This article will detail some of the members and methods of Motionevent. Understand that Motionevent has a great effect on developing some effects, such as dragging controls or multipoint scaling controls. At the same time, mastering the Motionevent class is also the foundation of lea
findpointerindex () method to get the index of the pointer of the specified ID in the current event.Like what:private int Mactivepointerid; public boolean ontouchevent (Motionevent event) { .... Get the pointer ID mactivepointerid = Event.getpointerid (0); // ... Many touch events later ... Use the pointer ID to find the index of the active pointer //and fetch its position int pointerindex = EVENT.F Indpointerindex (Mactivepoint
Background knowledge:
Touch screen can have multiple touch points
Managing touch points in Android is managed by an array that involves index and ID two variables,
The index represents the subscript in the array, and the ID indicates that the id,pointer of the tou
The touch event handling mechanism of Android is more complex, especially after multi-touch and event interception are considered.Android's Touch event processing is divided into 3 levels: Activity layer, ViewGroup layer, view layer.Let's start with a few basic rules for touch
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.