Recently, a multi-touch scaling function is required. Then I checked the information online and summarized it as follows:
First, the android SDK version is very important. For example, if you specify Android: minsdkversion = "4" in androidmanifest. xml and select Android 2.2 when creating the project, your application
The job of the former is to add a touch effect (a view) to the Desktop (launcher launcher, which is actually an activity), and this special effect is available every time you touch it, no matter what you do on the desktop, it will show the effects! have been groping to do not know how to start, and then slowly after the experiment to know that there is an Android
. These three events identify the most basic user touch screen operations and have a clear meaning. Although they are used every day, please note that the importance of the ACTION_DOWN event as the starting event is greater than ACTION_MOVE and ACTION_UP. If ACTION_MOVE or ACTION_UP occurs, therefore, ACTION_DOWN must have occurred. Some interaction mechanisms implemented based on the understanding of different importance can be seen from the
The processing of Android touch events mainly involves several methods: Onintercepttouchevent (), Dipatchtouchevent (), Ontouchevent (), OnTouch (). Onintercepttouchevent () is used to intercept events and change the direction of event delivery. Explain the event delivery. For example, an activity that shows a user may be a multi-layered nesting of viewgroup and view, by default the
Android multi-touch is essentially supported by LCD drivers and programming. Currently, mobile phones that use capacitive screen touch can support multi-touch multitouch technology, provides a better user experience for webpage scaling and gesture operations. On the Android
Android-developed friends often deal with a variety of touch events, but in the process of touching events, there are three main methods: Dispatchtouchevent (), Onintercepttouchevent (), and ontouchevent (). Believe that this troubled a lot of friends, the following through the text to you about the transfer process between them.Tools/Materials
Android
The methods associated with Touch events in Android include:dispatchtouchevent (motionevent ev),onintercepttouchevent (motionevent ev) ,ontouchevent (motionevent ev), controls that respond to these methods include:viewgroup,View,Activity. The corresponding relationship between the method and the control is shown in the following table:
Touch Event-re
Distribution and Consumption of Touch events in Android programming
Methods related to Touch events in Android include dispatchTouchEvent (MotionEvent ev), onInterceptTouchEvent (MotionEvent ev), and onTouchEvent (MotionEvent ev). controls that can respond to these methods include: viewGroup, View, and Activity. The
Because many of the Code has been designed for the first five advanced steps, we will not repeat them here. List the core code.Part 1: xml fileSelect an image with one button and save the image with one buttonThe Code is as follows:1. 2. 3. android: layout_width = "fill_parent"4. android: layout_height = "fill_parent"5. android: orientation = "vertical">6.7. 8.
A widget in Android can register multiple events at the same time, such as a Button. It can listen to touch events, click events, and hold events at the same time. Different operations can be performed under different circumstances, so how is it done?
First, the onTouch event occurs first. The returned value of this event also determines whether a long-press event or a click event can occur.
Android's Touch Icon processing solution, androidiconApple's Touch Icon is familiar to us. It is an Icon Apple needs to add network applications (or web pages) to the desktop, web links with these Touch icons are more similar to Native applications. Because Apple devices such as IPod, IPhone, and IPad are widely used, many web pages provide icons such as
Respect for the original: http://blog.csdn.net/yuanzeyao/article/details/38025165Download resources: http://download.csdn.net/detail/yuanzeyao2008/7660997In the previous article, I focused on the transfer of touch events in the Android source code, and now I want to use a demo and an example to learn about the Touch event processing in Andorid.In
);Matrix.setrotatem (Mrotationmatrix,0, MAngle,0,0, -1.0f);//Combine the rotation matrix with the projection and camera view //Note that the Mmvpmatrix factor *must is first* in order //For the matrix multiplication product to be correct.Matrix.multiplymm (Scratch,0, Mmvpmatrix,0, Mrotationmatrix,0);//Draw triangleMtriangle.draw (scratch);}If you have completed the steps described above, start the program and then drag on the screen to rotate the triangle:
Android has two classesAndroid. View. gesturedetectorAndroid. View. gesturedetector. simpleongesturelistener
(In addition, Android. widget. gallery seems to be a better ongesturelistener)
1)Create a class that inherits the simpleongesturelistener and hahagesturedetectorlistenerYou can implement the following Event Events.
Boolean ondoubletap (motionevent E)Explanation: triggered when the second
Cases triggered by the Android Touch event Transfer Mechanism
I have also written two articles about the Android Touch event transfer mechanism. I think the Touche event is still well understood, but I have encountered a problem recently, let me learn about the Android Touc
Today, I converted an Email web version written with sencha touch into an Android mobile phone version.
Several problems were found.
One Eclipse plug-in is MDS.
MDS applaud 1.2-https://svn.codespot.com/a/eclipselabs.org/mobile-web-development-with-phonegap/tags/r1.2/download
1. Although the plug-in provides integrated options for sencha and phonegap, it still cannot run after the project is created. T
-view no consumption events, the event will be anti-yearning to pass, then the parent view (ViewGroup) can be consumed, if still not consumed, The Ontouchevent () function of the activity is finally reached. (4) If the view does not consume the action_down, then other events will not be passed over. (5) Ontouchlistener takes precedence over ontouchevent () to consume the event. The above consumption means that the corresponding function return value is true. read more directly in PDF: Mastering
Android Touch event distribution mechanism: androidtouch
Preface
The delivery of touch events in Android is worth studying. I have never seen you introduce a ListView slide function, so that ListView will not follow your finger's call to scroll. I also don't know why the Button has set onClick and onTouch. Who will fir
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.