WO2017041682A1 - 一种滑屏事件冲突的处理方法及装置 - Google Patents

一种滑屏事件冲突的处理方法及装置 Download PDF

Info

Publication number
WO2017041682A1
WO2017041682A1 PCT/CN2016/098117 CN2016098117W WO2017041682A1 WO 2017041682 A1 WO2017041682 A1 WO 2017041682A1 CN 2016098117 W CN2016098117 W CN 2016098117W WO 2017041682 A1 WO2017041682 A1 WO 2017041682A1
Authority
WO
WIPO (PCT)
Prior art keywords
switching
webpage
label
sliding
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2016/098117
Other languages
English (en)
French (fr)
Inventor
杨德立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Publication of WO2017041682A1 publication Critical patent/WO2017041682A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method and an apparatus for processing a sliding screen event conflict.
  • the wireless browser is divided into a nucleus browser and a non-core browser.
  • the non-core browser has a lower cost and is more widely used because it does not load the kernel;
  • the inventor has found that when the currently loaded page has been added with a mechanism for processing the sliding event, and there are multiple loaded pages in the wireless browser, the user needs to switch the currently loaded page to switch the internal content of the page. When switching content, the entire page is switched.
  • the present invention has been made in order to provide a processing method for a sliding screen event conflict that overcomes the above problems or at least partially solves the above problems, and a corresponding processing device for a sliding screen event conflict.
  • a method for processing a sliding screen event conflict including:
  • the present invention provides a method for processing a sliding screen event conflict, including:
  • the switching identifier When the sliding event occurs on the webpage, if the switching identifier is obtained by means of reflection, the label having the switching attribute inside the webpage is correspondingly switched according to the switching identifier or between different webpages. Switching, the switching identifier indicates whether internal page switching or switching between different web pages is required;
  • the switching identifier is not obtained by means of the reflection, it is determined whether the sliding event occurs on the label having the switching attribute inside the webpage, and the label having the switching attribute inside the webpage is correspondingly switched; Otherwise, switch between different web pages.
  • the present invention provides a processing apparatus for a sliding screen event conflict, including:
  • a judging module configured to determine a location where a sliding event occurs
  • An intra-page switching module configured to switch a label having a switching attribute inside the webpage when a sliding event occurs on a label having a switching attribute inside the webpage;
  • the webpage switching module performs switching between different webpages when a sliding event occurs on a label other than the label having the switching attribute.
  • the present invention provides an apparatus for conflict detection of a sliding screen event, including:
  • the first determining module is configured to: when the sliding event occurs on the webpage, determine whether the switching identifier can be obtained by means of reflection;
  • the first processing module is configured to: when the switching identifier is obtained by means of the reflection, perform corresponding switching on the label having the switching attribute in the webpage according to the switching identifier, or perform switching between different webpages, where the switching identifier indicates Need to switch between internal pages or between different web pages;
  • a second determining module configured to: obtain the switching identifier by means of reflection, and determine whether the sliding event occurs on a label having a switching attribute inside the webpage;
  • a second processing module configured to: when the sliding screen event occurs on a label having a switching attribute inside the webpage, perform corresponding switching on a label having a switching attribute inside the webpage;
  • the third processing module is configured to perform switching between different web pages when the sliding screen event occurs on a portion other than the label having the switching attribute inside the webpage.
  • a computer program comprising computer readable code, when said computer readable code is run on a computing device, causing said computing device to perform said sliding event conflict Approach.
  • a computer readable medium wherein the computer program is stored.
  • the beneficial effects of the present invention are: when the screen is loaded, the tab having the switching attribute inside the webpage is switched when the sliding event occurs on the label having the switching attribute inside the webpage; when the monitoring has the switching attribute Switching between different web pages occurs when a slide event occurs on a label other than the label. Or, when the sliding event occurs on the webpage, if the switching identifier is obtained by means of reflection, the label having the switching attribute inside the webpage is switched according to the switching identifier or the switching between different webpages is performed, and the identifier is switched. Indicates whether the internal page switching or the switching between different web pages is required; if the switching identifier cannot be obtained by reflection, it is determined whether the sliding event occurs on the label having the switching attribute inside the webpage, and the switching attribute is inside the webpage. The label is switched accordingly; otherwise, switching between different web pages is performed.
  • FIG. 1 is a flowchart of a method for processing a sliding screen event conflict according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another method for processing a sliding screen event conflict according to an embodiment of the present invention
  • FIG. 3 is a block diagram of a processing device for a sliding screen event conflict according to an embodiment of the present invention.
  • FIG. 4 is a block diagram of another apparatus for processing a sliding screen event conflict according to an embodiment of the present invention.
  • Figure 5 shows schematically a block diagram of a computing device for performing the method according to the invention
  • Fig. 6 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • This embodiment provides a method for processing a sliding screen event conflict, as shown in FIG. 1 , which specifically includes:
  • Step 101 Listening to the loaded webpage
  • a sliding event is injected into the webpage, so that a sliding event occurs on a tab other than the label having the switching attribute or the label having the switching attribute in the webpage having the switching attribute inside the webpage.
  • the sliding screen event is registered in the label with the switching attribute in the webpage, and the sliding screen event is written into the listener of the monitoring sliding screen event, and the sliding screen event in the label with the switching attribute is Monitor.
  • the sliding event includes, but is not limited to, a click start event, a click move event, a click end event, and the like.
  • clicks include but are not limited to touch.
  • the click start event is a touchstart event
  • the click move event is a touchmove event
  • the click end event is a touchend event.
  • the execution entity may be a browser.
  • the browser includes, but is not limited to, a mobile terminal browser.
  • the mobile terminal browser itself supports switching between multiple web pages by using a sliding screen operation.
  • a sliding screen event is injected into the current webpage in the browser of the mobile terminal, a sliding event occurs when the user performs a sliding screen operation on the current webpage.
  • the conflict that is, the browser can't determine whether it should handle the sliding event in the webpage or the webpage supported by the browser itself.
  • the problem of the sliding event conflict occurring in the prior art is solved.
  • the browser when the browser loads the webpage, the browser injects JS into the webpage to listen to the webpage.
  • the listener When the sliding event is monitored, the listener also informs the browser that a sliding event has occurred in a recorded manner.
  • the monitoring may be mainly performed for the click start event and the click end event, and the listen processing method can enable the event to be monitored more effectively, reducing useless monitoring, improving the monitoring efficiency, and saving the monitoring time. resource of.
  • Step 102 When a sliding event occurs on a label having a switching attribute inside the webpage, the label having the switching attribute inside the webpage is correspondingly switched.
  • the switching direction of the label having the switching attribute is determined according to the gesture element corresponding to the sliding event, and the content corresponding to the label is switched according to the switching direction.
  • the sliding screen event when the user clicks the information of the area corresponding to the label having the switching attribute in the webpage, the sliding screen event is triggered, and the listener notifies the mobile terminal browser by the sliding screen event, and the mobile terminal browser receives the information.
  • the label having the switching attribute inside the webpage is switched correspondingly.
  • the sliding screen event is triggered, the sliding screen event is notified to the listener by broadcasting, and the listener notifies the mobile terminal browser by the sliding screen event, and the mobile terminal browser determines the sliding screen event, if it is a click
  • the label having the switching attribute specifically includes a translate label and a translate3d label.
  • the location touched by the user is obtained. Determining whether the page label corresponding to the location touched by the user is a label having a switching attribute, and if yes, determining that a sliding event occurs on the label having the switching attribute inside the webpage; otherwise, determining that the label is other than the label having the switching attribute in the webpage A sliding event occurred on the screen.
  • the result of the subtraction of the X coordinate of the pressed position and the X coordinate of the raised position is between the first preset value and the second preset value, and includes the first preset value and the second preset value When not switching.
  • the first preset value is 120; and the second preset value is -120.
  • Step 103 When a sliding event occurs on a tag other than the tag having the switching attribute, switching between different web pages is performed.
  • the X coordinate of the position pressed when the sliding event occurs on the screen, and the X coordinate of the position when the lifting is performed are acquired.
  • the direction of the switching webpage is determined, and if the X coordinate of the pressed position and the X coordinate of the position when the lifting is performed, the result of the subtraction is larger than the A preset value switches the web page to the left. If the result of the subtraction of the X coordinate of the pressed position and the X coordinate of the raised position is smaller than the second preset value, the web page is switched to the right.
  • the result of the subtraction of the X coordinate of the pressed position and the X coordinate of the raised position is between the first preset value and the second preset value, and includes the first preset value and the second preset value When not switching web pages.
  • the first preset value is 120; the second preset value is -120;
  • the method further includes: a processing mechanism for separately adapting a popular website, and the specific implementation manner is: when the browser receives the request to access the popular website, and loads the webpage, the content in the webpage is judged. If there is a first type of content, a click event is registered in a tag having a specific switching attribute in the first type of content, and the click event is written in a listener of the monitoring click event, in the tag having the switching attribute Click event to listen, when the slide event occurs on the label that has the switching attribute inside the webpage, the label with the switching attribute inside the webpage is entered.
  • the corresponding method is the same as the method disclosed in steps 101-102, and details are not described herein again.
  • the webpage is loaded and there is no first type of content in the webpage, it means that there is no label with the switching attribute in the currently loaded page.
  • the first category includes but is not limited to advertising.
  • the processing method of separately adding to the popular website is adopted to speed up the processing of the listening event in the page of the popular website.
  • the method specifically includes:
  • Step 201 Listening to the loaded webpage
  • the method when the webpage is loaded, the method further includes: determining whether the version of the operating system is less than the first version, and determining that the switching identifier can be obtained by means of reflection; otherwise, indicating that the switching identifier cannot be obtained by means of reflection;
  • a sliding event is injected into the webpage to monitor the occurrence of a sliding event on the webpage.
  • the gesture listener class is pre-exemplified, the sliding screen event is rewritten, and the sliding screen event is added to the sliding screen event listener, and the sliding screen event listener is injected into the webpage to listen to the webpage.
  • the instance gesture listening class enables the user to trigger a sliding screen event in the gesture listening class when the user performs a sliding operation on the page that has been injected into the sliding event listener, and sets the switching identifier in the rewritten sliding event, and
  • the sliding event listener on the page can listen for a sliding event.
  • the gesture monitoring class is specifically GestureDetector.
  • a sliding event is injected into the webpage, so that a sliding event occurs on a tab other than the label having the switching attribute or the label having the switching attribute in the webpage having the switching attribute inside the webpage.
  • the sliding screen event when the webpage is loaded, the sliding screen event is registered in the label with the switching attribute in the webpage, and the sliding screen event is written into the listener of the monitoring sliding screen event, and the sliding screen event in the label with the switching attribute is Monitor.
  • the sliding event includes but is not limited to a click start event, a click move event, and a click end event.
  • clicks include but are not limited to touch.
  • the click start event is a touchstart event
  • the click move event is a touchmove event
  • the click end event is a touchend event.
  • the click movement event is triggered; when the touch is needed
  • the click end event is triggered when the element being processed is to be switched.
  • the elements that need to be switched are specifically page elements in the web page with tags that have toggle properties.
  • the execution subject is a browser, and the browser includes but is not limited to a mobile terminal browser.
  • the monitoring is mainly performed for the click start event and the click end event.
  • the operating system is specifically an Android operating system, and the first version is 4.1.2.
  • Step 202 When the sliding event occurs on the webpage, it is determined whether the switching identifier can be obtained in a reflective manner, if yes, step 203 is performed; otherwise, step 204 is performed;
  • the version of the operating system is determined. If the version is the first version of the Android operating system, the switching identifier can be obtained in a reflective manner; otherwise, the switching identifier cannot be obtained in a reflective manner.
  • the switching identifier can be obtained in a reflective manner.
  • the switching identifier is generated according to a gesture element corresponding to the sliding screen event when a sliding event occurs.
  • the sliding event acquires a gesture element according to the sliding operation performed by the user, and sets the switching identifier according to the gesture element.
  • the gesture elements include a movement event at the beginning of the gesture, a movement event at the current gesture point, a pixel moving along the X-axis per second, and a pixel moving along the Y-axis per second.
  • the sliding length in the X-axis direction and the sliding speed in the X-axis direction can be obtained according to the sliding length in the X-axis direction and/or in the X-axis direction.
  • the sliding speed setting switching flag when the speed of sliding on the X axis is greater than the preset speed, if the length of sliding in the X axis direction is greater than the first preset value, the switching flag is set to the label with the switching attribute Switching to the left; if the length of the sliding in the X-axis direction is less than the second preset value, the switching flag is set to switch to the right with the label having the switching attribute.
  • the length of sliding in the X axis direction is between the first preset value and the second preset value
  • the switching identifier is set to switch to the left between the web pages; if the length of the sliding in the X-axis direction is less than 0, Then set the switching identifier to switch to the right between web pages; if the length of the sliding in the X-axis direction is 0, then Make a page switch.
  • the first preset value is 120
  • the second preset value is -120.
  • the sliding length in the Y-axis direction and the sliding speed in the Y-axis direction may be calculated according to the Y-axis direction.
  • the switching speed is set in the sliding length and/or the speed in the Y-axis direction, and will not be described here.
  • Step 203 Obtain a switching identifier by means of reflection, correspondingly switch the label having the switching attribute inside the webpage according to the switching identifier, or switch between different webpages, and the switching identifier indicates whether the internal page switching or the switching between different webpages is needed. .
  • the method further includes: determining whether the handover identifier is acquired, and performing, according to the handover identifier, a label that has a handover attribute in the webpage, or switching between different webpages, where the handover identifier indicates that the internal network of the webpage needs to be switched. Switching between different web pages;
  • Step 204 Determine whether the sliding event occurs on the label having the switching attribute inside the webpage, and then switch the label having the switching attribute inside the webpage; otherwise, switch between different webpages.
  • determining whether the sliding event occurs on a label having a switching attribute in the webpage specifically: acquiring a location where the sliding screen event occurs in the webpage, and obtaining a corresponding label in the webpage according to the location, if the obtained label is For a tag with a switch attribute, the slide event occurs on the tag with the switch attribute inside the page; if the obtained tag is not a tag with a switch attribute, the slide event does not occur on the tag with the switch attribute inside the page.
  • the switch that has the switching attribute in the webpage is correspondingly switched, and specifically includes:
  • the switching direction of the label having the switching attribute is determined according to the gesture element corresponding to the sliding screen event, and the content corresponding to the label is switched according to the switching direction.
  • the X coordinate of the position that is pressed when the sliding event occurs on the screen, and the X coordinate of the position when the sliding event is raised are determined according to the X coordinate of the pressed position and the X coordinate of the position when the lifting is performed.
  • the direction of switching if the result of the subtraction of the X coordinate of the pressed position and the X coordinate of the raised position is greater than the first preset value, it is switched to the left. If the result of the subtraction of the X coordinate of the pressed position and the X coordinate of the raised position is smaller than the second preset value, it is switched to the right.
  • the result of the subtraction of the X coordinate of the pressed position and the X coordinate of the raised position is between the first preset value and the second preset value, and includes the first preset value and the second preset value When not switching.
  • the first preset value is 120; the second preset value is -120;
  • the JS code that listens to the page click event is injected into the page, and when the user performs the sliding screen operation, the sliding screen event is captured, and when the captured sliding screen event is specifically a touchstart event,
  • the touchstart event is notified to the browser in a log manner, and the browser determines that it is a touchstart event notification, it sends a notification to the ontouch that a touchstart event has occurred on the label having the switching attribute, and has a switch in the ontouch according to the touchstart event pair.
  • the page content corresponding to the attribute tag is switched.
  • the X coordinate of the position where the touchstart event is pressed is 20, and the X coordinate 150 of the position when the cursor is raised is subtracted according to the X coordinate of the pressed position and the X coordinate of the position when the position is raised.
  • -130 is smaller than the second preset value, and the tag with the switchable attribute of the touchstart event is switched to the right in the corresponding content in the webpage.
  • the instance gesture listens to the class, and overrides the onFling event and adds it to the ViewFlipper's ontouch event listener.
  • the movement event e1 of the start point of the gesture generated when the user performs the sliding operation the movement event e2 of the current gesture point
  • the pixel X moving along the X axis every second
  • moving along the Y axis every second The pixel Y, in the onFling callback, sets the switching identifier according to e1, e2, X, Y, for example, to switch to the left with the label having the switching attribute.
  • the switching attribute identifier is determined in the ontouch event monitoring, wherein the switching identifier is specifically obtained by means of reflection, and the content corresponding to the switching attribute label is switched to the left according to the obtained switching attribute identifier, and the ViewFlipper is not Respond.
  • the embodiment further provides a processing device for conflicting event of the sliding screen. As shown in FIG. 3, the method includes:
  • the monitoring module 301 is configured to listen to the loaded webpage
  • the determining module 302 is configured to determine a location where a sliding event occurs
  • the intra-page switching module 303 is configured to switch a label having a switching attribute inside the webpage when a sliding event occurs on a label having a switching attribute inside the webpage;
  • the intra-page switching module 303 is specifically configured to use the gesture element corresponding to the sliding event The switching direction of the label having the switching attribute is determined, and the content corresponding to the label is switched according to the switching direction.
  • the webpage switching module 304 performs switching between different webpages when a sliding event occurs on a label other than the label having the switching attribute.
  • the device can also include:
  • the pre-processing module is configured to inject a sliding event into the webpage when the webpage is loaded, so as to monitor a sliding event occurring on a label other than the label with the switching attribute on the label having the switching attribute inside the webpage.
  • This embodiment further provides another apparatus for processing a sliding screen event conflict, as shown in FIG. 4, including:
  • the monitoring module 401 is configured to listen to the loaded webpage
  • the first determining module 402 is configured to determine, when the sliding event occurs on the webpage, whether the switching identifier can be obtained by means of reflection;
  • the switching identifier is generated according to a gesture element corresponding to the sliding screen event when a sliding event occurs.
  • the first processing module 403 is configured to: when the switching identifier is obtained by means of reflection, switch the label having the switching attribute inside the webpage according to the switching identifier, or switch between different webpages, and the switching identifier indicates that the internal webpage needs to be switched. Still switching between different web pages;
  • the second determining module 404 is configured to obtain the switching identifier by means of reflection, and determine whether the sliding event occurs on a label having a switching attribute inside the webpage;
  • the second determining module 404 is specifically configured to obtain a location where the sliding screen event occurs in the webpage, and obtain a corresponding label in the webpage according to the location. If the obtained label is a label with a switching attribute, the sliding screen event occurs. On the label with the switch attribute inside the page; if the obtained label is not a label with a switch attribute, the slide event does not occur on the label with the switch attribute inside the page.
  • the second processing module 405 is configured to switch the label having the switching attribute inside the webpage when the sliding screen event occurs on the label having the switching attribute inside the webpage.
  • the second processing module 405 is specifically configured to determine according to the gesture element corresponding to the sliding event The switching direction of the label having the switching attribute is broken, and the content corresponding to the label is switched according to the switching direction.
  • the third processing module 406 is configured to perform switching between different web pages when the sliding screen event occurs on a portion other than the label having the switching attribute inside the webpage.
  • the device may further include: a pre-processing module, configured to inject a sliding screen event into the webpage when the webpage is loaded, so as to monitor a sliding event on the webpage.
  • a pre-processing module configured to inject a sliding screen event into the webpage when the webpage is loaded, so as to monitor a sliding event on the webpage.
  • the device may further include: determining an operating system module, configured to determine whether the version of the operating system is less than the first version, and obtaining the switching identifier by means of reflection; otherwise, the switching identifier cannot be obtained by means of reflection.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • Those skilled in the art will appreciate that some or all of some or all of the components of the processing method and apparatus for sliding screen event conflicts in accordance with embodiments of the present invention may be implemented in practice using a microprocessor or digital signal processor (DSP).
  • DSP digital signal processor
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 5 illustrates a computing device that can implement a method of processing a sliding screen event conflict in accordance with the present invention.
  • the computing device conventionally includes a processor 510 and a computer program product or computer readable medium in the form of a memory 520.
  • the memory 520 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 520 has a memory space 530 for program code 531 for performing any of the method steps described above.
  • storage space 530 for program code may include various program code 531 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as described with reference to FIG.
  • the storage unit may have a similar arrangement to the memory 520 in the computing device of FIG. Storage section, storage space, etc.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 531 ', ie, code readable by a processor, such as 510, that when executed by a computing device causes the computing device to perform each of the methods described above step.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in the specification, including the accompanying claims, the abstract and the drawings may be provided by the same, equivalent, or A substitute feature like a destination is substituted.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or some of the components of a sliding screen event conflicting device in accordance with an embodiment of the present invention or All features.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals.
  • Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种滑屏事件冲突的处理方法,监听已加载的网页,当监听到网页内部具有切换属性的标签上发生滑屏事件时,对网页内部具有切换属性的标签进行对应的切换;当监听到具有切换属性的标签以外的其他标签上发生滑屏事件时,进行不同网页之间的切换。或者,当监听到网页上发生滑屏事件时,若能通过反射的方式获取切换标识,则根据切换标识对网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换;若不能通过反射的方式获取切换标识,并且滑屏事件发生在具有切换属性的标签上时,对该标签进行对应的切换;否则进行不同网页之间的切换。通过上述两种方式,都可以区分用户进行滑屏操作想要达到的滑屏效果,避免错误响应。

Description

一种滑屏事件冲突的处理方法及装置
本申请要求在2015年9月9日提交中国专利局、申请号为201510572015.X、发明名称为“一种滑屏事件冲突的处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及互联网技术领域,具体涉及一种滑屏事件冲突的处理方法及装置。
背景技术
现有技术中,无线浏览器分为有核浏览器和无核浏览器,与有核浏览器相比,无核浏览器因为没有加载内核,因此成本较低,得到更广泛的使用;在使用无核浏览器时,经常出现同时加载多个页面的情况,用户一般通过左右滑屏的方式实现这些页面之间的切换,与此同时,有些页面内部的某些区域也存在需要切换的内容,通过向页面内部增加处理滑屏事件的机制,使用户通过滑屏的方式切换页面内部需要切换的内容。
本发明人发现,当当前加载的页面内部已经增加了处理滑屏事件的机制,并且无线浏览器中存在多个加载的页面时,用户对当前加载的页面进行滑屏操作想切换该页面内部需要切换的内容时,整个页面却被切换。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种滑屏事件冲突的处理方法和相应的一种滑屏事件冲突的处理装置。
依据本发明的一个方面,提供了一种滑屏事件冲突的处理方法,包括:
监听已加载的网页;
当监听到所述网页内部具有切换属性的标签上发生滑屏事件时,对所述网页内部具有切换属性的标签进行对应的切换;
当监听到所述具有切换属性的标签以外的其他标签上发生滑屏事件时,进行不同网页之间的切换。
另一方面,本发明提供了一种滑屏事件冲突的处理方法,包括:
监听已加载的网页;
当监听到所述网页上发生滑屏事件时,如果能通过反射的方式获取切换标识,则根据所述切换标识对所述网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换,所述切换标识表明需要进行网页内部切换还是不同网页之间的切换;
如果不能通过反射的方式获取所述切换标识,则判断所述滑屏事件是否发生在所述网页内部具有切换属性的标签上,是则对所述网页内部具有切换属性的标签进行对应的切换;否则进行不同网页之间的切换。
另一方面,本发明提供一种滑屏事件冲突的处理装置,包括:
监听模块,用于监听已加载的网页;
判断模块,用于判断发生滑屏事件的位置;
网页内切换模块,用于所述网页内部具有切换属性的标签上发生滑屏事件时,对所述网页内部具有切换属性的标签进行对应的切换;
网页切换模块,用于所述具有切换属性的标签以外的其他标签上发生滑屏事件时,进行不同网页之间的切换。
另一方面,本发明提供一种滑屏事件冲突处理的装置,包括:
监听模块,用于监听已加载的网页;
第一判断模块,用于当监听到所述网页上发生滑屏事件时,判断是否能通过反射的方式获取切换标识;
第一处理模块,用于能通过反射的方式获取切换标识时,根据所述切换标识对所述网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换,所述切换标识表明需要进行网页内部切换还是不同网页之间的切换;
第二判断模块,用于不能通过反射的方式获取所述切换标识,则判断所述滑屏事件是否发生在所述网页内部具有切换属性的标签上;
第二处理模块,用于所述滑屏事件发生在所述网页内部具有切换属性的标签上时,对所述网页内部具有切换属性的标签进行对应的切换;
第三处理模块,用于所述滑屏事件发生在所述网页内部具有切换属性的标签以外的其他部分上时,进行不同网页之间的切换。
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行所述的滑屏事件冲突的处理方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了所述的计算机程序。
本发明的有益效果:通过监听已加载的网页,当监听到网页内部具有切换属性的标签上发生滑屏事件时,对网页内部具有切换属性的标签进行对应的切换;当监听到具有切换属性的标签以外的其他标签上发生滑屏事件时,进行不同网页之间的切换。或者,当监听到网页上发生滑屏事件时,如果能通过反射的方式获取切换标识,则根据切换标识对网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换,切换标识表明需要进行网页内部切换还是不同网页之间的切换;如果不能通过反射的方式获取切换标识,则判断滑屏事件是否发生在网页内部具有切换属性的标签上,是则对网页内部具有切换属性的标签进行对应的切换;否则进行不同网页之间的切换。通过上述两种方式,都可以区分用户进行滑屏操作想要达到的滑屏效果,避免错误响应。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本 领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1是本发明实施例提供的一种滑屏事件冲突的处理方法流程图;
图2是本发明实施例提供的另一种滑屏事件冲突的处理方法流程图;
图3是本发明实施例提供的一种滑屏事件冲突的处理装置框图;
图4是本发明实施例提供的另一种滑屏事件冲突的处理装置框图;
图5示意性地示出了用于执行根据本发明的方法的计算设备的框图;
图6示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
本实施例提供一种滑屏事件冲突的处理方法,如图1所示,具体包括:
步骤101:监听已加载的网页;
本实施例中,当加载完网页时,向网页中注入滑屏事件,以便监听网页内部具有切换属性的标签上发生滑屏事件或者具有切换属性的标签以外的其他标签上发生滑屏事件。
具体的,当加载完网页时,向网页内具有切换属性的标签中注册滑屏事件,并将滑屏事件写入监听滑屏事件的监听器中,对具有切换属性的标签中的滑屏事件进行监听。其中,滑屏事件包括但不限于点击开始事件、点击移动事件、点击结束事件等。其中,点击包括但不限于触摸。优选的,点击开始事件为touchstart事件、点击移动事件为touchmove事件、点击结束事件为touchend事件。当开始触摸需要切换处理的元素时,触发点击开始事件;当触摸需要切换处理的元素,并且拖拽时,触发点击移动事件;当结束触摸需 要切换处理的元素时,触发点击结束事件。本实施例中,执行主体可以是浏览器,具体的,该浏览器包括但不限于移动终端浏览器。
移动终端浏览器本身支持通过滑屏操作实现多个网页之间的切换,当移动终端浏览器中的当前网页中注入滑屏事件时,用户对当前网页进行滑屏操作时,会出现滑屏事件冲突,即浏览器无法确定,应该处理的是网页中的滑屏事件,还是进行浏览器本身支持的网页之间切换。在本实施例中,通过监听当前网页,根据发生滑屏事件的位置对应的网页标签所属的类型区分滑屏操作,解决了现有技术中的出现的滑屏事件冲突的问题。
本实施例中,浏览器加载完网页时,向网页中注入JS,以监听该网页。当监听到滑屏事件时,还包括,监听器以记录的方式通知浏览器已发生滑屏事件。在本实施例中,可以主要针对点击开始事件和点击结束事件进行监听,采用这种监听处理方式,能使事件更有效的被监听,减少了无用监听,提高了监听效率,节省了监听时耗费的资源。
步骤102:当监听到网页内部具有切换属性的标签上发生滑屏事件时,对网页内部具有切换属性的标签进行对应的切换;
本实施例中,当监听到网页内部具有切换属性的标签上发生滑屏事件时,根据滑屏事件对应的手势元素判断具有切换属性的标签的切换方向,根据切换方向切换该标签对应的内容。
具体的,当获取到用户点击具有切换属性的标签在网页中对应的区域范围的信息时,触发滑屏事件,监听器将滑屏事件以记录的方式通知移动终端浏览器,移动终端浏览器接收到滑屏事件时,对网页内部具有切换属性的标签进行对应的切换。其中,触发滑屏事件时,将滑屏事件以广播的方式通知监听器,监听器将滑屏事件以记录的方式通知移动终端浏览器,移动终端浏览器对滑屏事件进行判断,如果是点击开始事件,则对被监听的具有切换属性的标签进行对应的切换,并且继续监听;如果是点击结束事件,则结束本次监听。优选的,具有切换属性的标签具体包括,translate标签以及translate3d标签。
在本实施例中,当用户对网页进行滑动操作时,获取用户触摸的位置, 判断用户触摸的位置对应的页面标签是否为具有切换属性的标签,如果是,则确定网页内部具有切换属性的标签上发生滑屏事件;否则,确定是网页中具有切换属性的标签以外的其他标签上发生滑屏事件。
获取屏幕上发生滑屏事件时被按下的位置的X坐标,以及抬起时的位置的X坐标,根据被按下的位置的X坐标和抬起时的位置的X坐标,判断切换的方向,如果按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果大于第一预设值,则向左切换。如果按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果小于第二预设值,则向右切换。当按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果在第一预设值与第二预设值之间,并且包括第一预设值和第二预设值时,不切换。优选的,第一预设值为120;第二预设值为-120。
步骤103:当监听到具有切换属性的标签以外的其他标签上发生滑屏事件时,进行不同网页之间的切换。
本实施例中,当监听到具有切换属性的标签以外的其他标签上发生滑屏事件时,获取屏幕上发生滑屏事件时被按下的位置的X坐标,以及抬起时的位置的X坐标,根据被按下的位置的X坐标和抬起时的位置的X坐标,判断切换网页的方向,如果按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果大于第一预设值,则向左切换网页。如果按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果小于第二预设值,则向右切换网页。当按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果在第一预设值与第二预设值之间,并且包括第一预设值和第二预设值时,不切换网页。优选的,第一预设值为120;第二预设值为-120;
进一步的,本实施例中,还包括:对热门网站进行单独适配的处理机制,具体实施方式为,当浏览器接收到访问热门网站请求,并且加载完网页时,对网页中的内容进行判断,如果存在第一类内容时,则对第一类内容中的具体有切换属性的标签中注册点击事件,并将点击事件写入监听点击事件的监听器中,对具有切换属性的标签中的点击事件进行监听,当监听到网页内部具有切换属性的标签上发生滑屏事件时,对网页内部具有切换属性的标签进 行对应的切换,具体方法与步骤101-102中公开的方法相同,此处不再赘述。如果加载完网页,在该网页中没有第一类内容时,则说明当前加载的页面中不存在具有切换属性的标签。其中,第一类内容包括但不限于广告。本实施例中,采用这种增加对热门网站单独适配的处理方法,加快了对热门网站的页面中的监听事件处理的速度。
本实施例中,还提供另一种滑屏事件冲突的处理方法,如图2所示,具体包括:
步骤201:监听已加载的网页;
本实施例中,当加载完网页时,还包括:判断操作系统的版本是否为第一版本以下,是则标识能通过反射的方式获取切换标识;否则表示不能通过反射的方式获取切换标识;
具体的,当操作系统的版本为第一版本以下的版本时,向网页中注入滑屏事件,以便监听网页上发生滑屏事件。本实施例中,预先实例手势监听类,重写滑屏事件,并且将滑屏事件加入滑屏事件监听器中,将滑屏事件监听器注入到网页中,对网页进行监听。通过实例手势监听类使用户在已经注入滑屏事件监听器的页面上进行滑屏操作时,触发手势监听类中的滑屏事件,并在被重写的滑屏事件中设置切换标识,同时,页面中的滑屏事件监听器能够监听到滑屏事件。其中,手势监听类具体为GestureDetector。
当操作系统不是第一版本以下的版本时,则向网页中注入滑屏事件,以便监听网页内部具有切换属性的标签上发生滑屏事件或者具有切换属性的标签以外的其他标签上发生滑屏事件。
具体的,当加载完网页时,向网页内具有切换属性的标签中注册滑屏事件,并将滑屏事件写入监听滑屏事件的监听器中,对具有切换属性的标签中的滑屏事件进行监听。其中,滑屏事件包括但不限于点击开始事件、点击移动事件、点击结束事件。其中,点击包括但不限于触摸。优选的,点击开始事件为touchstart事件、点击移动事件为touchmove事件、点击结束事件为touchend事件。当开始触摸需要切换处理的元素时,触发点击开始事件。当触摸需要切换处理的元素,并且拖拽时,触发点击移动事件;当结束触摸需 要切换处理的元素时,触发点击结束事件。需要切换处理的元素具体是在网页中与具有切换属性的标签的页面元素。本实施例中,执行主体为浏览器,该浏览器包括但不限于移动终端浏览器。优选的,主要针对点击开始事件和点击结束事件进行监听。本实施例中,操作系统具体为Android操作系统,第一版本为4.1.2;
步骤202:当监听到网页上发生滑屏事件时,判断是否能够以反射的方式获取切换标识,是则执行步骤203;否则执行步骤204;
本实施例中,判断操作系统的版本,如果是Android操作系统第一版本,则能够以反射的方式获取切换标识;否则不能够以反射的方式获取切换标识。
Android操作系统第一版本以下的版本中均能够以反射的方式获取切换标识。其中,切换标识是在发生滑屏事件时,根据滑屏事件对应的手势元素触发产生的。
具体的,当用户在已经注入滑屏事件监听器的网页上进行滑屏操作时,滑屏事件根据用户进行的滑屏操作获取手势元素,根据手势元素设置切换标识。手势元素包括,手势起点的移动事件,当前手势点的移动事件,每秒沿X轴上移动的像素,每秒沿Y轴上移动的像素。
本实施例中,根据手势元素以及预设的计算方法,可以得到在X轴方向上滑动长度,在X轴方向上滑动的速度,根据在X轴方向上滑动长度和/或在X轴方向上滑动的速度设置切换标识,当在X轴上滑动的速度大于预设速度时,如果在X轴方向上滑动的长度大于第一预设值,则将切换标识设置为对具有切换属性的标签向左切换;如果在X轴方向上滑动的长度小于第二预设值,则将切换标识设置为对具有切换属性的标签向右切换。
当X轴上滑动的速度不大于预设速度,或者当在X轴上滑动的速度大于预设速度,但在X轴方向上滑动的长度在第一预设值与第二预设值之间,包括第一预设值和第二预设值时,如果X轴方向上滑动的长度大于0,则将切换标识设置为网页之间向左切换;如果X轴方向上滑动的长度小于0,则将切换标识设置为网页之间向右切换;如果X轴方向上滑动的长度为0,则不 进行页面切换。其中,第一预设值为120,第二预设值为-120;本实施例中,也可以计算在Y轴方向上滑动长度,在Y轴方向上滑动的速度,根据在Y轴方向上滑动长度和/或Y轴方向上滑动的速度设置切换标识,此处不再赘述。
步骤203:通过反射的方式获取切换标识,根据切换标识对网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换,切换标识表明需要进行网页内部切换还是不同网页之间的切换。
本实施例中,还包括,判断是否获取到切换标识,是则根据切换标识对网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换,切换标识表明需要进行网页内部切换还是不同网页之间的切换;
步骤204:判断滑屏事件是否发生在网页内部具有切换属性的标签上,是则对网页内部具有切换属性的标签进行对应的切换;否则进行不同网页之间的切换。
本实施例中,判断滑屏事件是否发生在网页内部具有切换属性的标签上,具体包括:获取滑屏事件在网页中发生的位置,根据位置获取网页中对应的标签,如果获取到的标签是具有切换属性的标签,则滑屏事件发生在页面内部具有切换属性的标签上;如果获取到的标签不是具有切换属性的标签,则滑屏事件未发生在网页内部具有切换属性的标签上。
其中,对网页内部具有切换属性的标签进行对应的切换,具体包括:
根据滑屏事件对应的手势元素判断具有切换属性的标签的切换方向,根据切换方向切换标签对应的内容。
具体地,获取屏幕上发生滑屏事件时被按下的位置的X坐标,以及抬起时的位置的X坐标,根据被按下的位置的X坐标和抬起时的位置的X坐标,判断切换的方向,如果按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果大于第一预设值,则向左切换。如果按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果小于第二预设值,则向右切换。当按下的位置的X坐标与抬起时的位置的X坐标做减法运算的结果在第一预设值与第二预设值之间,并且包括第一预设值和第二预设值时,不切换。优选的, 第一预设值为120;第二预设值为-120;
为更好地理解本发明实施例提供的上述技术方案,下面通过一个实际应用中的例子,对前述方法进行介绍。
例如:当Android系统版本不低于4.1.2时,向页面内注入监听页面点击事件的JS代码,当用户进行滑屏操作时,捕捉滑屏事件,当捕捉到的滑屏事件具体为touchstart事件时,以log的方式将touchstart事件通知给浏览器,并且浏览器判断是touchstart事件通知时,向ontouch发送通知在具有切换属性的标签上发生了touchstart事件,在ontouch中根据该touchstart事件对具有切换属性的标签对应的页面内容进行切换。例如:获取发生touchstart事件时被按下的位置的X坐标为20,以及抬起时的位置的X坐标150,根据被按下的位置的X坐标和抬起时的位置的X坐标做减法运算的结果为-130小于第二预设值,则将发生touchstart事件的具有可切换属性的标签在网页中对应的内容向右切换。
当Android系统版本低于4.1.2时,实例手势监听类,并且重写onFling事件,将其加入ViewFlipper的ontouch事件监听中。当用户进行滑屏操作时,获取用户进行滑屏操作时产生的手势起点的移动事件e1,当前手势点的移动事件e2,每秒沿X轴上移动的像素X,每秒沿Y轴上移动的像素Y,在onFling回调中根据e1、e2、X、Y设置切换标识,例如设置为对具有切换属性的标签向左切换。在ontouch事件监听中判断该切换属性标识,其中切换标识具体是通过反射的方式获取到的,根据获取到的切换属性标识将具有切换属性标签在页面中对应的内容向左切换,此时ViewFlipper不做响应。
本实施例还提供一种滑屏事件冲突的处理装置,如图3所示,包括:
监听模块301,用于监听已加载的网页;
判断模块302,用于判断发生滑屏事件的位置;
网页内切换模块303,用于网页内部具有切换属性的标签上发生滑屏事件时,对网页内部具有切换属性的标签进行对应的切换;
本装置中,网页内切换模块303,具体用于根据滑屏事件对应的手势元素 判断具有切换属性的标签的切换方向,根据切换方向切换标签对应的内容。
网页切换模块304,用于具有切换属性的标签以外的其他标签上发生滑屏事件时,进行不同网页之间的切换。
本装置中还可以包括:
预处理模块,用于当加载完网页时,向网页中注入滑屏事件,以便监听网页内部具有切换属性的标签上发生滑屏事件或者具有切换属性的标签以外的其他标签上发生滑屏事件。
本实施例还提供另外一种滑屏事件冲突处理的装置,如图4所示,包括:
监听模块401,用于监听已加载的网页;
第一判断模块402,用于当监听到网页上发生滑屏事件时,判断是否能通过反射的方式获取切换标识;
本技术方案中,切换标识是在发生滑屏事件时,根据滑屏事件对应的手势元素触发产生的。
第一处理模块403,用于能通过反射的方式获取切换标识时,根据切换标识对网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换,切换标识表明需要进行网页内部切换还是不同网页之间的切换;
第二判断模块404,用于不能通过反射的方式获取切换标识,则判断滑屏事件是否发生在网页内部具有切换属性的标签上;
本装置中,第二判断模块404,具体用于获取滑屏事件在网页中发生的位置,根据位置获取网页中对应的标签,如果获取到的标签是具有切换属性的标签,则滑屏事件发生在页面内部具有切换属性的标签上;如果获取到的标签不是具有切换属性的标签,则滑屏事件未发生在网页内部具有切换属性的标签上。
第二处理模块405,用于滑屏事件发生在网页内部具有切换属性的标签上时,对网页内部具有切换属性的标签进行对应的切换。
本装置中,第二处理模块405,具体用于根据滑屏事件对应的手势元素判 断具有切换属性的标签的切换方向,根据切换方向切换标签对应的内容。
第三处理模块406,用于滑屏事件发生在网页内部具有切换属性的标签以外的其他部分上时,进行不同网页之间的切换。
本装置中还可以包括:预处理模块,用于当加载完网页时,向网页中注入滑屏事件,以便监听网页上发生滑屏事件。
本装置中还可以包括:判断操作系统模块,用于判断操作系统的版本是否为第一版本以下,是则能通过反射的方式获取切换标识;否则不能通过反射的方式获取切换标识。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的滑屏事件冲突的处理方法和装置的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图5示出了可以实现根据本发明的滑屏事件冲突的处理方法的计算设备。该计算设备传统上包括处理器510和以存储器520形式的计算机程序产品或者计算机可读介质。存储器520可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器520具有用于执行上述方法中的任何方法步骤的程序代码531的存储空间530。例如,用于程序代码的存储空间530可以包括分别用于实现上面的方法中的各种步骤的各个程序代码531。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图6所述的便携式或者固定存储单元。该存储单元可以具有与图5的计算设备中的存储器520类似布置的存 储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码531’,即可以由例如诸如510之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相 似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的一种滑屏事件冲突的处理装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。

Claims (20)

  1. 一种滑屏事件冲突的处理方法,其特征在于,包括:
    监听已加载的网页;
    当监听到所述网页内部具有切换属性的标签上发生滑屏事件时,对所述网页内部具有切换属性的标签进行对应的切换;
    当监听到所述具有切换属性的标签以外的其他标签上发生滑屏事件时,进行不同网页之间的切换。
  2. 如权利要求1所述的方法,其特征在于,所述对所述网页内部具有切换属性的标签进行对应的切换,具体包括:
    根据所述滑屏事件对应的手势元素判断所述具有切换属性的标签的切换方向,根据所述切换方向切换所述标签对应的内容。
  3. 如权利要求1所述的方法,其特征在于,还包括:当加载完所述网页时,向所述网页中注入滑屏事件,以便监听所述网页内部具有切换属性的标签上发生滑屏事件或者所述具有切换属性的标签以外的其他标签上发生滑屏事件。
  4. 一种滑屏事件冲突的处理方法,其特征在于,包括:
    监听已加载的网页;
    当监听到所述网页上发生滑屏事件时,如果能通过反射的方式获取切换标识,则根据所述切换标识对所述网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换,所述切换标识表明需要进行网页内部切换还是不同网页之间的切换;
    如果不能通过反射的方式获取所述切换标识,则判断所述滑屏事件是否发生在所述网页内部具有切换属性的标签上,是则对所述网页内部具有切换属性的标签进行对应的切换;否则进行不同网页之间的切换。
  5. 如权利要求4所述的方法,其特征在于,所述切换标识是在发生滑屏 事件时,根据所述滑屏事件对应的手势元素触发产生的。
  6. 如权利要求4所述的方法,其特征在于,还包括:当加载完所述网页时,向所述网页中注入滑屏事件,以便监听所述网页上发生滑屏事件。
  7. 如权利要求4所述的方法,其特征在于,所述判断所述滑屏事件是否发生在所述网页内部具有切换属性的标签上,具体包括:
    获取所述滑屏事件在所述网页中发生的位置,根据所述位置获取所述网页中对应的标签,如果获取到的标签是具有切换属性的标签,则所述滑屏事件发生在页面内部具有切换属性的标签上;如果获取到的标签不是具有切换属性的标签,则所述滑屏事件未发生在所述网页内部具有切换属性的标签上。
  8. 如权利要求4所述的方法,其特征在于,所述对所述网页内部具有切换属性的标签进行对应的切换,具体包括:
    根据所述滑屏事件对应的手势元素判断所述具有切换属性的标签的切换方向,根据所述切换方向切换所述标签对应的内容。
  9. 如权利要求4所述的方法,其特征在于,还包括:判断操作系统的版本是否为第一版本以下,是则能通过反射的方式获取所述切换标识;否则不能通过反射的方式获取所述切换标识。
  10. 一种滑屏事件冲突的处理装置,其特征在于,包括:
    监听模块,用于监听已加载的网页;
    判断模块,用于判断发生滑屏事件的位置;
    网页内切换模块,用于所述网页内部具有切换属性的标签上发生滑屏事件时,对所述网页内部具有切换属性的标签进行对应的切换;
    网页切换模块,用于所述具有切换属性的标签以外的其他标签上发生滑屏事件时,进行不同网页之间的切换。
  11. 如权利要求10所述的装置,其特征在于,所述网页内切换模块,具体用于根据所述滑屏事件对应的手势元素判断所述具有切换属性的标签的切换方向,根据所述切换方向切换所述标签对应的内容。
  12. 如权利要求10所述的装置,其特征在于,还包括:
    预处理模块,用于当加载完所述网页时,向所述网页中注入滑屏事件,以便监听所述网页内部具有切换属性的标签上发生滑屏事件或者所述具有切换属性的标签以外的其他标签上发生滑屏事件。
  13. 一种滑屏事件冲突处理的装置,其特征在于,包括:
    监听模块,用于监听已加载的网页;
    第一判断模块,用于当监听到所述网页上发生滑屏事件时,判断是否能通过反射的方式获取切换标识;
    第一处理模块,用于能通过反射的方式获取切换标识时,根据所述切换标识对所述网页内部具有切换属性的标签进行对应的切换或者进行不同网页之间的切换,所述切换标识表明需要进行网页内部切换还是不同网页之间的切换;
    第二判断模块,用于不能通过反射的方式获取所述切换标识,则判断所述滑屏事件是否发生在所述网页内部具有切换属性的标签上;
    第二处理模块,用于所述滑屏事件发生在所述网页内部具有切换属性的标签上时,对所述网页内部具有切换属性的标签进行对应的切换;
    第三处理模块,用于所述滑屏事件发生在所述网页内部具有切换属性的标签以外的其他部分上时,进行不同网页之间的切换。
  14. 如权利要求13所述的装置,其特征在于,所述切换标识是在发生滑屏事件时,根据所述滑屏事件对应的手势元素触发产生的。
  15. 如权利要求13所述的装置,其特征在于,还包括:预处理模块,用于当加载完所述网页时,向所述网页中注入滑屏事件,以便监听所述网页上发生滑屏事件。
  16. 如权利要求13所述的装置,其特征在于,所述第二判断模块,具体用于获取所述滑屏事件在所述网页中发生的位置,根据所述位置获取所述网页中对应的标签,如果获取到的标签是具有切换属性的标签,则所述滑屏事件发生在页面内部具有切换属性的标签上;如果获取到的标签不是具有切换 属性的标签,则所述滑屏事件未发生在所述网页内部具有切换属性的标签上。
  17. 如权利要求13所述的装置,其特征在于,所述第二处理模块,具体用于根据所述滑屏事件对应的手势元素判断所述具有切换属性的标签的切换方向,根据所述切换方向切换所述标签对应的内容。
  18. 如权利要求13所述的装置,其特征在于,还包括:判断操作系统模块,用于判断操作系统的版本是否为第一版本以下,是则能通过反射的方式获取所述切换标识;否则不能通过反射的方式获取所述切换标识。
  19. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-9中的任一个所述的滑屏事件冲突的处理方法。
  20. 一种计算机可读介质,其中存储了如权利要求19所述的计算机程序。
PCT/CN2016/098117 2015-09-09 2016-09-05 一种滑屏事件冲突的处理方法及装置 Ceased WO2017041682A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510572015.XA CN105892894B (zh) 2015-09-09 2015-09-09 一种滑屏事件冲突的处理方法及装置
CN201510572015.X 2015-09-09

Publications (1)

Publication Number Publication Date
WO2017041682A1 true WO2017041682A1 (zh) 2017-03-16

Family

ID=57002783

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/098117 Ceased WO2017041682A1 (zh) 2015-09-09 2016-09-05 一种滑屏事件冲突的处理方法及装置

Country Status (2)

Country Link
CN (1) CN105892894B (zh)
WO (1) WO2017041682A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104177A (zh) * 2018-10-25 2020-05-05 阿里巴巴集团控股有限公司 视图组件的切换方法、装置及终端设备

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105892894B (zh) * 2015-09-09 2020-08-11 北京奇虎科技有限公司 一种滑屏事件冲突的处理方法及装置
CN106445376B (zh) * 2016-08-30 2020-03-03 北京小米移动软件有限公司 一种网页的操作方法及装置
CN107844346A (zh) * 2016-09-20 2018-03-27 天脉聚源(北京)科技有限公司 一种移动网页元素显示动态效果的方法和系统
CN107870720A (zh) * 2016-09-26 2018-04-03 广州市动景计算机科技有限公司 用于触摸屏的视图切换方法、装置和客户端设备
CN106502655A (zh) * 2016-10-09 2017-03-15 山东浪潮商用系统有限公司 一种数据处理的方法、装置及机顶盒
CN108108113B (zh) * 2017-12-19 2020-02-18 维沃移动通信有限公司 网页切换方法及装置
CN108388393B (zh) 2018-01-02 2020-08-28 阿里巴巴集团控股有限公司 移动终端点击事件的识别方法和装置
CN108363525B (zh) * 2018-02-01 2020-12-11 阿里巴巴(中国)有限公司 一种响应网页中用户手势操作的方法、装置和终端设备
CN113051017B (zh) * 2021-03-30 2024-03-15 北京字节跳动网络技术有限公司 应用程序页面上的手势处理方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515220A (zh) * 2009-04-13 2009-08-26 青岛海信移动通信技术股份有限公司 对触摸屏幕中窗口移动、缩放和控制的方法及相关装置
US20110057907A1 (en) * 2009-09-10 2011-03-10 Samsung Electronics Co., Ltd. Apparatus and method for determining user input pattern in portable terminal
CN103034683A (zh) * 2012-11-26 2013-04-10 北京奇虎科技有限公司 用于浏览器的页面切换方法和装置
CN103052947A (zh) * 2010-08-16 2013-04-17 乐天株式会社 万维网管理装置、万维网管理方法、万维网管理程序、记录了该程序的计算机可读取记录介质以及万维网系统
CN103092496A (zh) * 2011-11-02 2013-05-08 腾讯科技(深圳)有限公司 一种控制浏览器的方法、装置及移动设备
CN105892894A (zh) * 2015-09-09 2016-08-24 北京奇虎科技有限公司 一种滑屏事件冲突的处理方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013544412A (ja) * 2010-11-18 2013-12-12 グーグル・インコーポレーテッド マルチモードウェブブラウジング
US20140096092A1 (en) * 2011-03-20 2014-04-03 William J. Johnson System and Method for Indirect Manipulation of User Interface Object(s)
CN103019557B (zh) * 2012-11-26 2016-06-01 北京奇虎科技有限公司 页面切换方法和装置
CN104346088A (zh) * 2013-07-29 2015-02-11 华为技术有限公司 一种进行页面切换的方法及装置
CN103440107A (zh) * 2013-09-04 2013-12-11 北京奇虎科技有限公司 电子设备触摸操作处理的方法和装置
CN104462567B (zh) * 2014-12-26 2018-01-09 北京奇虎科技有限公司 web页面的切换方法和装置及综合页面提供装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515220A (zh) * 2009-04-13 2009-08-26 青岛海信移动通信技术股份有限公司 对触摸屏幕中窗口移动、缩放和控制的方法及相关装置
US20110057907A1 (en) * 2009-09-10 2011-03-10 Samsung Electronics Co., Ltd. Apparatus and method for determining user input pattern in portable terminal
CN103052947A (zh) * 2010-08-16 2013-04-17 乐天株式会社 万维网管理装置、万维网管理方法、万维网管理程序、记录了该程序的计算机可读取记录介质以及万维网系统
CN103092496A (zh) * 2011-11-02 2013-05-08 腾讯科技(深圳)有限公司 一种控制浏览器的方法、装置及移动设备
CN103034683A (zh) * 2012-11-26 2013-04-10 北京奇虎科技有限公司 用于浏览器的页面切换方法和装置
CN105892894A (zh) * 2015-09-09 2016-08-24 北京奇虎科技有限公司 一种滑屏事件冲突的处理方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104177A (zh) * 2018-10-25 2020-05-05 阿里巴巴集团控股有限公司 视图组件的切换方法、装置及终端设备
CN111104177B (zh) * 2018-10-25 2024-04-26 阿里巴巴集团控股有限公司 视图组件的切换方法、装置及终端设备

Also Published As

Publication number Publication date
CN105892894A (zh) 2016-08-24
CN105892894B (zh) 2020-08-11

Similar Documents

Publication Publication Date Title
CN105892894B (zh) 一种滑屏事件冲突的处理方法及装置
CA2856268C (en) Methods of detection of software exploitation
US8914496B1 (en) Tracking user behavior relative to a network page
US9229745B2 (en) Identifying load-hit-store conflicts
WO2017107834A1 (zh) 页面切换方法、装置、计算机程序及可读介质
JP2015503152A (ja) ウェブページのレンダリング時間の測定
WO2016107325A1 (zh) 基于移动终端的页面资源加载方法及装置
US20130328788A1 (en) Method and apparatus for choosing an intended target element from an imprecise touch on a touch screen display
CN103703454A (zh) 按需的标签再水化
CN106162362B (zh) 一种视频播放方法及播放器
WO2017107833A1 (zh) 浏览器标签内的页面切换方法及装置
WO2017107654A1 (zh) 一种页面入口图标的显示方法及装置
CN104951700A (zh) 网页漏洞检测方法和装置
CN104750536B (zh) 一种实现虚拟机自省的方法和装置
EP3566150B1 (en) Data consistency check in distributed system
US20120287063A1 (en) System and method for selecting objects of electronic device
CN115454552A (zh) 内容处理方法、装置、计算机设备及计算机可读存储介质
WO2017133229A1 (zh) 一种移动终端的图片显示方法和装置
US20150169153A1 (en) Enhancing a viewing area around a cursor
US9262523B2 (en) Enhancement of touch user experiences
CN102930200A (zh) 进程识别方法、装置和终端设备
JP2019528497A (ja) 一次情報に関する追加情報を提供する方法及びシステム
US20160259762A1 (en) Webpage layout method and apparatus, computer storage medium and terminal
CN107741992B (zh) 会议记录的网络存储方法、装置、智能平板和存储介质
CN102945346B (zh) 一种用于枚举系统进程的方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16843620

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16843620

Country of ref document: EP

Kind code of ref document: A1