is directed to "profile/" for this special link to "personal homepage" and can be modified by itself
such as: www.xxx.com/12/will represent www.xxx.com/profile/?uid=12 or www.xxx.com/profile?uid=12
$uid = Is_numeric ($req _temp)? $req _temp:strstr ($req _temp, '/', true);
$ufun = Is_numeric ($req _temp)? ' Index ': strstr ($req _temp, '/');
if (Is_numeric ($uid)) {
Self:: $uid = $uid;
if (!isset ($_get[' uid '))) $_get[' uid '] = $uid;
$fname = ' profile/'. $u
3 methods related to touch events:Public Boolean dispatchtouchevent (motionevent ev); Used to assign an eventPublic Boolean onintercepttouchevent (motionevent ev);//To intercept eventPublic Boolean ontouchevent (motionevent ev); Used to handle eventclasses that have these three methods:
Activity class:
Activity
Dispatchtouchevent ();Onto
mDeleteBtnWidth in the pressed point y; // The width of the delete button is private boolean isDeleteShown; // whether the delete button displays private ViewGroup mPointChild; // The currently processed itemprivate LinearLayout. layoutParams mLayoutParams; // LayoutParamspublic QQListView (Context context, AttributeSet attrs) {this (context, attrs, 0);} public QQListView (Context context, AttributeSet attrs, int defStyle) {super (context, attrs, defStyle); // obtain the screen width WindowMana
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 Touche event again.
My article on Android Touche event transfer mechanism is as follows:
Http://blog.csdn.net/yuanzeyao/article/details/37961997
Http://blog.csdn.net/yuanzeyao/article/details/38025165
I have come to the followin
thread reads the driver event and places it in the message queue. The specific implementation is:
Thread mthread = new thread ("inputdevicereader "){
Public void run (){
Rawinputevent EV = new rawinputevent ();
While (true ){
Inputdevice di;
Readevent (EV );
}
}
This thread continues to run and runs cyclically through readevent (); this function is a native method. The specific imple
of Android touch events and the source code of ViewGroup. (If you are not familiar with it, you can look at it:Android custom control Series 9: Android touch event distribution mechanism from the source code). After reading the previous article, we should know that the distribution of Andrioid events is carried out on a layer-by-layer basis. At the beginning, distribution always starts from the upper layer to the lower layer, from the Activity of the ActivityDecorViewAnd then to the layout we w
around a small change. (drop-down refresh)
B, swipe left or right, diagonal slide (ad bar)
The target was determined and the situation in 2 was clarified. We start from the drop-down refresh source, because this way of thinking more clear, compare event delivery, first passed from the parent class to the subclass. That process is no longer detailed, do not understand can look at other excellent blog, this is good: http://blog.csdn.net/hyp712/article/details/8777835
View Swiperefreshlayout so
most, the changes and then fix EV Ery problem that remains manually in the Python 3 code. You'll probably also want to go through all of the converted code and clean it up, as the 2to3 conversions could not alway S is the most elegant solution for your case.Separate branches for Python 2 and Python 3If you need to continue to support Python 2, the simplest case was having a branch on your source tree with the code for Py Thon 2 and another branch for
This article mainly explains the view and viewgroup event transfer mechanism from the perspective of source code. The dispatchtouchevent method of viewgroup:
Private touchtarget firsttouchtarget;
Public Boolean dispatchtouchevent (motionevent eV ){
Perform Security check first to see if the current window is blocked.
If (Action = action_down ){
Clear the last touchtargets status to avoid the impact of action_up and action_cancel events on this method
Override ViewGroup and use ViewDragHelper to implement various drag-and-drop interactions,
1. If the previous SlideUpLayout control contains a list such as ListView or RecyclerView during use, the following problems may occur:
The xml file is as follows:
Ii. Cause Analysis: there is a problem with the event dispatch interception. Remember that in the previous article, the event interception was completely handled by ViewDragHe
) {// calculate the total pixel length var slpx = sl * this. stepLen; // calculate the length of the drag box var cenLen = this. option. scrollType = "V "? This. centerRect. offsetHeight: this. centerRect. offsetWidth; var dragBoxLen = cenLen-slpx; // if the calculated drag button is too short, re-calculate the step size to ensure that the button does not shorten if (dragBoxLen
/*** Mouse down event */doMouseDown: function (ev) {this. base (
the "New Connection" event, and then calls the event's handler handler function to process the event.
It has already been said that handler has been set to the Ngx_event_accept function, so call ngx_event_accept for actual processing.
The following is an analysis of the Ngx_event_accept method, whose flowchart looks like this:
Following the streamlined code, the number in the comment corresponds to the number of the previous figure:
void Ngx_event_accept (ngx_event_t *
Here, we recommend a commonly used javascript function encapsulated by you. Basically, common operations are included. If you need it, take it directly. These are all common functions, so there will be no more nonsense here. Let's take a look.
Code:
The Code is as follows:
// CookieFunction setCookie (name, value, iDay){If (iDay! = False){Var oDate = new Date ();ODate. setDate (oDate. getDate () + iDay );Document. cookie = name + '=' + value + '; expires =' + oDate + '; path = /';}Else{Docume
obtain the province name through Baidu API Based on the latitude and longitude.
$ ('# EventCanvas '). mousedown (function (ev) {// obtain the coordinates var mouseX, mouseY, And if (ev. layerX | ev. layerX = 0) {mouseX = ev. layerX; mouseY = ev. layerY;} else if (
Share your own encapsulated common javascript Functions and encapsulate javascript Functions
These are all common functions, so there will be no more nonsense here. Let's take a look.
Code:
Copy codeThe Code is as follows:// CookieFunction setCookie (name, value, iDay){If (iDay! = False){Var oDate = new Date ();ODate. setDate (oDate. getDate () + iDay );Document. cookie = name + '=' + value + '; expires =' + oDate + '; path = /';}Else{Document. cookie = name + '=' + value;}}Function getCookie (n
be nice to see this place as a signal. YIf the condition is not true, the event will loop throughout the anyevent. So there is no send in the example above.
About Anyevent Other, you can play like Anyevent::http,twiggy after getting started. Look at these applications and projects.
In addition, we often use EV in anyevent. He is a C-Libev Perl interface that has very high performance. Read the above, look at the following
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.