Yesterday, someone in the group asked an event source location problem, the simple description is like this.
On a page that isn't written by yourself, how can you quickly locate the event code he's bound to? (The page is in jquery)This question, say difficult, say simple also not so simple, in case of use is commissioned and so will trouble point.
There's an
event Test.click
button.addeventlistener (' Test.click ', FN);
var testevent = document.createevent (' customevent ');
Customevent can also be initialized as a mouse event, not necessarily a custom event
testevent.initcustomevent (' Test.click ', false, false, NULL);
Button.dispatchevent (testevent); ' Click '
JS native simulation of the
() methodAppconfig.getbusinstance (). Register (this);3. Define subscription methods@Subscribepublic void Onwallpaperupdate (MyObject obj) { //logical processing required for obj}4. Send a messageAppconfig.getbusinstance (). Post (myobj);5. UnbindNote that when the class is destroyed or is temporarily not required to receive the message, it is generally in the activity's OnDestroy () or Onresume () methodAppconfig.getbusinstance (). Unregister (this);Third, Otto
Overview
have been trying to write an article on the Android event distribution mechanism, but has not written, these two days is just the weekend, have time, think about writing a bar, or always only stay at the level of use but not understand its internal mechanism. I use 4.4 source code, open look, very complex, especially how the event is distributed from th
Copyright Notice
Respect Original Works. Reprinted, please maintain the integrity of the article, and in the form of a hyperlink to indicate the original author "tingsking18" and the main site address, so that other friends can ask and correct.
Qt source code parsing (1) Qt creates window programs, message loops, and winmain Functions
Qt source code analysis (2) in-depth analysis of QT Object System and s
. Live ().(4), on method: In fact,. bind (),. Live (),. Delegate () are all implemented by. On (),. Unbind (),. Die (),. Undelegate () The same is done by. Off (), This interface simply provides a way to uniformly bind eventsGenerally speaking, although the bind/delegate/live three methods can implement the DOM node event binding, but can use. On () to replace the above 3 methodsSpeaking so much, the specific use of the process should use that method?
In the previous article "uiautomator source code analysis-uiautomatorbridge framework", we described uiautomatorbridge and its related classes. Next we will try to concatenate these classes based on two instances, I am going to use the following two representative instances:
Injection event
Get control
In this article, we will analyze the presshome method of uidevice to analyze how uiautom
Native side events distributed to the Java side and the framework of the distribution of events to the UI, the process to see the source code, here is not redundant,The working class diagram of the native side distribution event is as follows: The class diagram for the framework side distribution event is as follows: Starting with activity.dispatchtouchevent, the
Package of 6.1 Event
Browser event compatibility is a troubling issue. IE's event is under the Global window, and Mozilla's event is the incident source parameter passed into the callback function. There are also many ways to handle events.
jquery provides a package of
Android View event distribution mechanism source code analysis (I)
I have always wanted to write an article about the event distribution mechanism. Whatever the case, I have to study the source code of event distribution and write my own experiences ~
First, let's write a si
, handlenonezeroinput){Expect_eq (4, M_foo.calc (12,16));} Test_f (foocalctest, handlenonezeroinput_error){Expect_eq (5, M_foo.calc (12,16));} V. Summary The three event mechanisms provided by gtest are very simple and flexible. At the same time, by inheriting the test class and using the test_f macro, we can share some common methods and resources between cases. This makes our cases more concise and clear. Series links: 1. Go to Google's open-
(Deletelistener)Delete This. _listeners[id]; } return This; } }; //Regular expression used to split event strings. varEventsplitter =/\s+/; //Implement Fancy features of the Events API such as multiple event //names ' "Change Blur" ' and Jquery-style event maps ' {change:action} ' //In terms of the existing API.
has been to view the event distribution mechanism is not very clear, in the project development also encountered, in the online also found some problem-solving methods, but its principle is not very understanding, now resigned to have time, today write a view of the event distribution, combined with the Android source code together to learn, if not speaking, Go t
Reprinted statement: This article can be reproduced at will, but the original address must be specified. Thank you!
The high performance of nginx should be an event-driven credit. The relevant code for nginx event processing is located in the src/event directory, and the event driver is the core of nginx, so the amoun
Android event distribution mechanism source code analysis
I am a little touched by the fact that I have been using android for some time. I have always been used to organizing my notes and saving my notes on youdao. I have no habit of writing a blog. In the future, we will sort it out gradually, and we will also calculate "Review -_-.
Android event Distribution i
SourcecounterConstruction methodPublic Sourcecounter (String name) { super (MonitoredCounterGroup.Type.SOURCE, name, ATTRIBUTES); }Called by the Doconfigure (context context) of the class JmssourceAnd this method is called by the Configure of the Basicsourcesemantics class.At the meeting back to the entrance application Loadmonitoring method, this chain will passThe above constructor method calls the parent class construction methodProtected Monitoredcountergroup (type type, string name, st
Please look at the following three blog, the idea is still pretty clear, but still did not write custom control series Buddy's idea is clear:Android Touch screen event distribution mechanism detailed and source analysis one (view article)http://blog.csdn.net/yanbober/article/details/45887547Android Touch screen event distribution mechanism and
The previous chapter, which is probably an overview, describes the purpose and use of event binding, knowing what kind of process it is inside, from which function to which function. Whether jquery's source code is simple or complex, it is certain that jquery is committed to solving browser compatibility issues and ultimately serving users. Some legacy issues
When we first introduced Bind, delegate and thei
.
Finally, the default behavior is triggered with the native Event trigger function (Click,focus). and setting a jQuery.event.triggered flag to flag is to trigger the default behavior and avoid triggering the event again.Finally, the source code.Triggerfunction(Event, data, Elem, onlyhandlers) {//events can be
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.