WO2025201261A1 - 滑动参数的获取方法、装置、电子设备及存储介质 - Google Patents
滑动参数的获取方法、装置、电子设备及存储介质Info
- Publication number
- WO2025201261A1 WO2025201261A1 PCT/CN2025/084475 CN2025084475W WO2025201261A1 WO 2025201261 A1 WO2025201261 A1 WO 2025201261A1 CN 2025084475 W CN2025084475 W CN 2025084475W WO 2025201261 A1 WO2025201261 A1 WO 2025201261A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- sliding
- application
- page
- application type
- interface
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04847—Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction 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/0488—Interaction 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 application belongs to the field of communication technology, and specifically relates to a method, device, electronic device and storage medium for obtaining sliding parameters.
- the electronic device obtains the sliding parameters of the page displayed on the foreground, such as the sliding speed, by plugging a stub into the OverScroller sliding engine to listen to a callback function related to the OverScroller sliding engine.
- the purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for obtaining sliding parameters, which can improve the flexibility of the method for obtaining the sliding parameters of a page.
- an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
- an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored.
- the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
- an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.
- an embodiment of the present application provides a computer program/program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
- a touch event corresponding to the sliding input is reported; the application type of the first application corresponding to the first page is determined; and sliding parameters for the first page are obtained through an operating system API corresponding to the application type of the first application.
- the electronic device can first determine the application type of the first application corresponding to the first page, and then obtain the sliding parameters for the first page through an operating system API corresponding to the application type of the first application, thereby increasing the flexibility of the method for obtaining page sliding parameters.
- FIG1 is a schematic diagram of an operating system architecture according to an embodiment of the present application.
- FIG2 is a flow chart of a method for obtaining sliding parameters according to an embodiment of the present application.
- FIG3 is a second schematic diagram of the architecture of an operating system provided in an embodiment of the present application.
- FIG4 is a second flow chart of a method for obtaining sliding parameters provided in an embodiment of the present application.
- FIG5 is a schematic diagram of an example of a page including a View component provided in an embodiment of the present application.
- FIG7 is a fourth flow chart of a method for obtaining sliding parameters provided in an embodiment of the present application.
- FIG10 is a schematic diagram of an example of a sliding fitting curve diagram provided in an embodiment of the present application.
- FIG11 is a sixth flow chart of a method for obtaining sliding parameters provided in an embodiment of the present application.
- FIG13 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application.
- FIG14 is a second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
- first,” “second,” and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first,” “second,” and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more.
- the term “and/or” in the specification and claims represents at least one of the connected objects, and the character “/" generally indicates that the objects associated with each other are in an "or” relationship.
- At least one and “at least one of” in the specification and claims of this application refer to any one, any two, or a combination of more than two of the objects included.
- at least one of a, b, and c can be represented by: “a”, “b”, “c”, “a and b”, “a and c", “b and c”, and "a, b, and c", where a, b, and c can be single or multiple.
- at least two means two or more, and its meaning is similar to "at least one”.
- the software environment used in the method for obtaining sliding parameters in the embodiment of the present application can be an Android operating system, an iOS operating system, or other possible operating systems, and the embodiment of the present application does not make specific limitations.
- the View layer is responsible for displaying the foreground page.
- the corresponding interface of the View layer is the OverScroller interface.
- the HWUI layer located below the View layer, is used to handle the rendering operations of the user interface (UI).
- the interface corresponding to the HWUI layer is called the HWUI interface.
- the Skia layer is located below the HWUI layer.
- the Skia layer provides basic drawing functions, including graphics, text, bitmaps, etc.
- the Skia layer can be understood as the underlying graphics engine.
- the interface corresponding to the Skia layer is the Skia engine interface.
- the Skia layer can also be understood as a Skia rendering library.
- the target layer is located below the Skia layer.
- the target layer corresponds to two interfaces, namely the OpenGL ES (OpenGL for Embedded Systems) interface and the Vulkan interface.
- OpenGL ES OpenGL for Embedded Systems
- Vulkan interface Vulkan interface
- the OpenGL ES interface can be used for processing and rendering 2D or 3D images.
- the Vulkan interface can significantly reduce drawing command overhead, improve multi-threading performance, and achieve faster rendering performance.
- GPU hardware located at the lowest level of the operating system, is used to perform the intensive calculations required to render images, videos, and animations on electronic devices.
- the GPU hardware includes a touch screen, which can collect input parameters of the user when inputting on the touch screen, such as input position and input time.
- the touch screen corresponds to a touch interface, and the electronic device can obtain input parameters of the user when inputting on the touch screen through the touch interface.
- the method for obtaining sliding parameters in the embodiment of the present application can be applied to the scenario of sliding pages.
- the Android system provides the OverScroller sliding engine for applications to choose from, and the system side can listen to the sliding events of the OverScroller sliding engine to obtain the sliding speed of the page components of the foreground application.
- the webview component and the Flutter component typically use the application's own integrated skia rendering library or impller rendering library for their entire 2D rendering engine, and do not call the system-side integrated skia rendering library. Therefore, the system cannot monitor and identify the sliding speed of Flutter components.
- the sliding speed identification method based on the operating system's OverScroller sliding engine cannot cover a wide range of applications and be applicable to a wider range of monitoring scenarios.
- the method for obtaining the page's sliding speed is too simple.
- the electronic device can first determine the application type of the first application corresponding to the first page, and then obtain the sliding parameters of the first page through the API of the operating system corresponding to the application type of the first application, thereby improving the flexibility of the method for obtaining the sliding parameters of the page.
- the method for obtaining sliding parameters provided in the embodiments of the present application may be performed by a sliding parameter obtaining device, which may be an electronic device, or a functional module or entity in the electronic device.
- a sliding parameter obtaining device which may be an electronic device, or a functional module or entity in the electronic device.
- the technical solution provided in the embodiments of the present application will be described below using an electronic device as an example.
- the present invention provides a method for obtaining sliding parameters.
- FIG2 shows a flowchart of the method for obtaining sliding parameters provided in the present invention. The method can be applied to electronic devices. As shown in FIG2, the method for obtaining sliding parameters provided in the present invention can include the following steps 201 to 203.
- Step 201 Upon receiving a sliding input from a user on a displayed first page, the electronic device reports a touch event corresponding to the sliding input.
- the first page may be a chat page, a game page, a shopping page, an information page, etc. This embodiment of the present application does not limit this.
- the sliding input may be a sliding input of the user on the first page through a touch device such as a finger or a stylus.
- the electronic device can detect the user's sliding input on the first page through the touch screen.
- the electronic device after detecting a user's sliding input to a first page, can report a touch event corresponding to the sliding input to the operating system, so that after determining the application type of the first application corresponding to the first page, the sliding parameters of the first page can be obtained through the API of the operating system corresponding to the application type of the first application.
- Step 202 The electronic device determines the application type of the first application corresponding to the first page.
- different application types call different operating system APIs.
- step 202 can be specifically implemented through the following step 202a or step 202b or step 202c or step 202d.
- Step 202a When the page name of the first page carries the character suffix "webView", the electronic device determines that the first application belongs to the first application type.
- the electronic device can determine the application type to which the first application belongs by determining whether the page name of the first page displayed by the first application carries the character suffix webView.
- the page name of the first page can be understood as the name of the foreground activity of the application.
- the first application type may be a WebView type.
- the application corresponding to the first application type does not directly use the standard View component of the operating system, but uses the WebView component.
- the WebView component is used to display browser-like content.
- Step 202b When the page name of the first page carries the character suffix "Flutter", the electronic device determines that the first application belongs to the second application type.
- the electronic device can determine the application type to which the first application belongs by determining whether the page name of the first page displayed by the first application carries the Flutter character suffix.
- the list included in the first page includes 3 View components, that is, a ViewGroup includes 3 sub-View components. If the sliding direction and sliding distance of each sub-View component are consistent, it means that the list included in the first page is sliding as a whole, that is, the user's input is sliding input.
- Step 302 The electronic device obtains the sliding parameters of the first page based on the sliding parameters of the view component.
- the electronic device may use the sliding speed of any View component calculated based on the sliding direction and sliding distance of any View component as the sliding speed of the first page.
- the electronic device can obtain the sliding parameters of the view component in the first page through the HWUI interface corresponding to the fourth application type in the operating system, and then obtain the sliding parameters of the first page, thereby improving the flexibility of the electronic device in obtaining the sliding parameters of the first page.
- the above-mentioned first application belongs to the first application type, and the API of the operating system corresponding to the first application type is the Skia engine interface; the above-mentioned step 203 can be specifically implemented through the following steps 401 and 402.
- the application corresponding to the first application type does not directly use the standard View component of the operating system, but uses the WebView component, it is less dependent on the operating system than the fourth application type.
- the WebView component calls the Skia rendering library of the operating system, the electronic device can obtain the sliding parameters of the view component in the Skia layer corresponding to the Skia engine interface through the Skia engine interface, thereby obtaining the sliding parameters of the view component in the first page, and thus obtaining the sliding parameters of the first page.
- the electronic device can obtain the sliding parameters of the view component in the first page through the Skia engine interface.
- Step 402 The electronic device obtains the sliding parameters of the first page based on the sliding parameters of the view component.
- the electronic device can obtain the sliding parameters of the view component in the first page through a touch interface.
- the electronic device may obtain the touch position information of each frame of sliding input reported by the touch screen to obtain the touch position change information between every two frames.
- the electronic device can first obtain the touch position change information of the sliding input in the i-1th frame and the first page of the i-th frame through the touch position information of the sliding input in the first page of the i-1th frame and the touch position information of the sliding input in the first page of the i-th frame, so as to obtain the sliding distance of the sliding input between the i-1th frame and the i-th frame; then, the first time interval between the i-1th frame and the i-th frame can be obtained through the sliding duration of the sliding input reported by the touch screen of the i-1th frame and the i-th frame; finally, based on the sliding distance and the first time interval, the sliding speed of the first page during the input process of the sliding input between the i-1th frame and the i-th frame can be calculated.
- the above sliding fitting curve is used to characterize the mapping relationship between the sliding speed and sliding time of the view component in the first application.
- the electronic device can measure the sliding time and sliding speed of the view component in the first application after multiple groups of users stop sliding input, and then fit the sliding fitting curve corresponding to the first application based on the multiple sets of measured data.
- Step 602 The electronic device obtains the sliding speed at the end of the sliding input reported by the touch screen through the touch interface.
- the electronic device can obtain the sliding speed at the end time of the sliding input reported by the touch screen through the touch interface.
- the electronic device can obtain the sliding duration and touch position information of the sliding input reported by the touch screen in each frame through the touch interface to obtain the sliding speed during the sliding input process, the electronic device can obtain the sliding time at the end of the sliding input, that is, the time when the user raises his hand, and the touch position information at the end of the sliding input through the touch interface, and then calculate the sliding speed at the end of the sliding input based on the sliding time at the end of the sliding input and the touch position information at the end of the sliding input.
- the above-mentioned sliding input end time can be understood as the time when the user's finger leaves the touch screen.
- the duration corresponding to the above-mentioned first time period can be understood as the total duration of the first page being subjected to inertial sliding after the user stops sliding input.
- the start time of the above-mentioned first time period is the time when the user stops sliding input
- the end time of the first time period is the time when the first page stops sliding
- the electronic device when the user stops sliding input, can correspond the sliding speed at the end moment of the sliding input to the above-mentioned sliding fitting curve, so as to obtain the time length of the first time period and the sliding speed of the first page at each moment in the first time period.
- the curve in Figure 10 is the sliding fitting curve corresponding to the first application.
- the sliding speed of the sliding input obtained is S
- S can be corresponded to Figure 10.
- T1 the sliding time corresponding to the sliding speed S
- T2 the sliding time of the first page due to inertial sliding
- the method for obtaining sliding parameters provided in the embodiment of the present application may include the following steps S1 to S11 .
- the electronic device receives a sliding input from a user on a displayed first page.
- the electronic device determines that the first application belongs to the Flutter type.
- the electronic device determines that the first application belongs to the WebView type, the electronic device executes the following step S8; if the electronic device determines that the first application belongs to the Flutter type, the electronic device executes the following step S9; if the electronic device determines that the first application belongs to the third application type, the electronic device executes the following step S10; if the electronic device determines that the first application belongs to the fourth application type, the electronic device executes the following step S11;
- the electronic device Before stopping the sliding input, the electronic device obtains the sliding duration and touch position change information of the sliding input reported by the touch screen through the touch interface to obtain the sliding parameters of the first page. After stopping the sliding input, the electronic device obtains the sliding fitting curve and obtains the sliding speed at the end of the sliding input reported by the touch screen through the touch interface to obtain the sliding parameters of the first page.
- the electronic device obtains the sliding parameters of the View component in the first page through the HWUI interface to obtain the sliding parameters of the first page.
- step S8 or step S9 or step S10 or step S11 after executing the above step S8 or step S9 or step S10 or step S11, if the acquired sliding speed of the first page is 0, monitoring of the sliding speed of the first page is stopped.
- the sliding parameter acquisition method provided in the embodiment of the present application can be executed by a sliding parameter acquisition device.
- the sliding parameter acquisition method performed by the sliding parameter acquisition device is taken as an example to illustrate the sliding parameter acquisition device provided in the embodiment of the present application.
- FIG12 shows a possible structural diagram of a sliding parameter acquisition device 70 involved in an embodiment of the present application.
- the sliding parameter acquisition device 70 may include: a reporting module 71 , a determination module 72 , and an acquisition module 73 .
- the determination module 72 is configured to determine the application type of the first application corresponding to the first page.
- the acquisition module 73 is configured to acquire the sliding parameters of the first page through an API of the operating system corresponding to the application type of the first application determined by the determination module 72 .
- An embodiment of the present application provides a device for obtaining sliding parameters.
- the device for obtaining sliding parameters can first determine the application type of the first application corresponding to the first page, and then obtain the sliding parameters of the first page through the API of the operating system corresponding to the application type of the first application, thereby improving the flexibility of the method for obtaining the sliding parameters of the page.
- the determination module 72 is specifically configured to:
- the page name of the first page carries the character suffix webView, it is determined that the first application belongs to the first application type; or,
- the application type of the first application does not belong to the first application type and does not belong to the second application type
- the first application calls the OverScroller interface of the operating system, then it is determined that the first application belongs to the third application type
- the application type of the first application does not belong to the first application type and does not belong to the second application type
- the first application does not call the OverScroller interface, it is determined that the first application belongs to the fourth application type.
- the first application belongs to a first application type, and the API of the operating system corresponding to the first application type is a Skia engine interface; the acquisition module 73 is specifically used to obtain the sliding parameters of the view component in the first page through the Skia engine interface; and based on the sliding parameters of the view component, obtain the sliding parameters of the first page.
- the first application belongs to the second application type, and the API of the operating system corresponding to the second application type is a touch interface; the acquisition module 73 is specifically used to obtain a pre-stored sliding fitting curve corresponding to the first application, and the sliding fitting curve is used to characterize the mapping relationship between the sliding speed and sliding time of the view component in the first application; and through the touch interface, obtain the sliding speed at the end moment of the sliding input reported by the touch screen; and obtain the sliding parameters of the first page based on the sliding speed and the sliding fitting curve.
- the first application belongs to the second application type, and the operating system API corresponding to the second application type is a touch interface; the acquisition module 73 is specifically used to obtain the sliding duration and touch position change information of the sliding input reported by the touch screen through the touch interface; and obtain the sliding parameters of the first page based on the sliding duration and touch position change information.
- the first application belongs to the fourth application type, and the operating system API corresponding to the fourth application type is the HWUI interface; the acquisition module 73 is specifically used to obtain the sliding parameters of the view component in the first page through the HWUI interface; and based on the sliding parameters of the view component, obtain the sliding parameters of the first page.
- the device for obtaining the sliding parameters in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip.
- the electronic device can be a terminal or a device other than a terminal.
- the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (MID), an augmented reality (AR)/virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc.
- It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), an ATM or a self-service machine, etc., and the embodiment of the present application does not make specific limitations.
- the device for obtaining the sliding parameter in the embodiment of the present application may be a device having an operating system.
- the operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
- the sliding parameter acquisition device provided in the embodiment of the present application can implement each process implemented in the above method embodiment. To avoid repetition, it will not be described here.
- the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
- FIG14 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
- the electronic device 100 includes but is not limited to components such as a radio frequency unit 101 , a network module 102 , an audio output unit 103 , an input unit 104 , a sensor 105 , a display unit 106 , a user input unit 107 , an interface unit 108 , a memory 109 , and a processor 110 .
- the electronic device 100 may further include a power source (such as a battery) for powering various components.
- the power source may be logically connected to the processor 110 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption.
- the electronic device structure shown in FIG14 does not limit the electronic device.
- the electronic device may include more or fewer components than shown, or may combine certain components, or have different component arrangements, which will not be described in detail here.
- the processor 110 is used to report the touch event corresponding to the sliding input when receiving the user's sliding input on the displayed first page; and determine the application type of the first application corresponding to the first page; and obtain the sliding parameters of the first page through the API of the operating system corresponding to the application type of the first application.
- the page name of the first page carries the character suffix webView, it is determined that the first application belongs to the first application type; or,
- the application type of the first application does not belong to the first application type and does not belong to the second application type
- the first application calls the OverScroller interface of the operating system, then it is determined that the first application belongs to the third application type
- the first application belongs to a first application type, and the API of the operating system corresponding to the first application type is a Skia engine interface; the processor 110 is specifically used to obtain the sliding parameters of the view component in the first page through the Skia engine interface; and obtain the sliding parameters of the first page based on the sliding parameters of the view component.
- the first application belongs to the second application type, and the API of the operating system corresponding to the second application type is a touch interface; the processor 110 is specifically used to obtain a pre-stored sliding fitting curve corresponding to the first application, and the sliding fitting curve is used to characterize the mapping relationship between the sliding speed and sliding time of the view component in the first application; and obtain the sliding speed at the end moment of the sliding input reported by the touch screen through the touch interface; and obtain the sliding parameters of the first page based on the sliding speed and the sliding fitting curve.
- the first application belongs to the second application type, and the API of the operating system corresponding to the second application type is a touch interface; the processor 110 is specifically used to obtain the sliding duration and touch position change information of the sliding input reported by the touch screen through the touch interface; and based on the sliding duration and touch position change information, obtain the sliding parameters of the first page.
- the first application belongs to a fourth application type, and the API of the operating system corresponding to the fourth application type is a HWUI interface; the processor 110 is specifically used to obtain the sliding parameters of the view component in the first page through the HWUI interface; and obtain the sliding parameters of the first page based on the sliding parameters of the view component.
- the electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.
- the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode.
- the display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc.
- the user input unit 107 includes a touch panel 1071 and at least one of the other input devices 1072.
- the touch panel 1071 is also called a touch screen.
- the touch panel 1071 may include two parts: a touch detection device and a touch controller.
- Other input devices 1072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
- the memory 109 can be used to store software programs and various data.
- the memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.).
- the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories.
- the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
- the volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct RAM bus random access memory (DRRAM).
- the memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
- Processor 110 may include one or more processing units.
- processor 110 integrates an application processor and a modem processor.
- the application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 110.
- An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored.
- a program or instruction is stored.
- the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
- the processor is the processor in the electronic device described in the above embodiment.
- the readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
- An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.
- the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
- An embodiment of the present application provides a computer program/program product, which is stored in a storage medium.
- the program/program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
- the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
- a storage medium such as ROM/RAM, magnetic disk, optical disk
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)
Abstract
一种滑动参数的获取方法、装置、电子设备及存储介质,属于通信领域。该方法包括:在接收到用户对显示的第一页面的滑动输入的情况下,将滑动输入对应的触摸事件上报;确定第一页面对应的第一应用的应用类型;通过与第一应用的应用类型对应的操作系统的API,获取第一页面的滑动参数。
Description
相关申请的交叉引用
本申请主张在2024年03月29日在中国提交的申请号为202410377308.1的中国专利的优先权,其全部内容通过引用包含于此。
本申请属于通信技术领域,具体涉及一种滑动参数的获取方法、装置、电子设备及存储介质。
随着电子设备的不断更新发展,电子设备中应用的功能和特效也越来越丰富。
在相关技术中,电子设备通过在OverScroller滑动引擎中插桩的方式,来监听与OverScroller滑动引擎相关的回调函数来获取前台显示的页面的滑动参数,例如滑动速度。
可见,页面的滑动速度的获取方式过于单一。
本申请实施例的目的是提供一种滑动参数的获取方法、装置、电子设备及存储介质,能够提升页面的滑动参数的获取方式的灵活性。
第一方面,本申请实施例提供了一种滑动参数的获取方法,该方法包括:在接收到用户对显示的第一页面的滑动输入的情况下,将滑动输入对应的触摸事件上报;确定第一页面对应的第一应用的应用类型;通过与第一应用的应用类型对应的操作系统的应用程序编程接口(Application Programming Interface,API),获取第一页面的滑动参数。
第二方面,本申请实施例提供了一种滑动参数的获取装置,该装置包括:上报模块、确定模块和获取模块。上报模块,用于在接收到用户对显示的第一页面的滑动输入的情况下,将滑动输入对应的触摸事件上报;确定模块,用于确定第一页面对应的第一应用的应用类型;获取模块,用于通过与确定模块确定的第一应用的应用类型对应的操作系统的API,获取第一页面的滑动参数。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。
第六方面,本申请实施例提供一种计算机程序/程序产品,所述计算机程序/程序产品被存储在存储介质中,所述程序/程序产品被至少一个处理器执行以实现如第一方面所述的方法。
在本申请实施例中,在接收到用户对显示的第一页面的滑动输入的情况下,将滑动输入对应的触摸事件上报;确定第一页面对应的第一应用的应用类型;通过与第一应用的应用类型对应的操作系统的API,获取第一页面的滑动参数。本方案中,电子设备可以先确定第一页面对应的第一应用的应用类型,然后通过与第一应用的应用类型对应的操作系统的API,获取到第一页面的滑动参数,因此提升了页面的滑动参数的获取方式的灵活性。
图1是本申请实施例提供的一种操作系统的架构示意图之一;
图2是本申请实施例提供的一种滑动参数的获取方法的流程示意图之一;
图3是本申请实施例提供的一种操作系统的架构示意图之二;
图4是本申请实施例提供的一种滑动参数的获取方法的流程示意图之二;
图5是本申请实施例提供的一种页面中包括View组件的实例示意图;
图6是本申请实施例提供的一种滑动参数的获取方法的流程示意图之三;
图7是本申请实施例提供的一种滑动参数的获取方法的流程示意图之四;
图8是本申请实施例提供的一种滑动参数的获取方法的流程示意图之五;
图9是本申请实施例提供的一种滑动输入对应的滑动曲线图的实例示意图;
图10是本申请实施例提供的一种滑动拟合曲线图的实例示意图;
图11是本申请实施例提供的一种滑动参数的获取方法的流程示意图之六;
图12是本申请实施例提供的一种滑动参数的获取装置的结构示意图;
图13是本申请实施例提供的一种电子设备的硬件结构示意图之一;
图14是本申请实施例提供的一种电子设备的硬件结构示意图之二。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请的说明书和权利要求书中的术语“至少一个(项)”、“至少之一”等指其包含对象中的任意一个、任意两个或两个以上的组合。例如,a、b、c中的至少一个(项),可以表示:“a”、“b”、“c”、“a和b”、“a和c”、“b和c”以及“a、b和c”,其中a,b,c可以是单个,也可以是多个。同理,“至少两个(项)”是指两个或两个以上,其表达的含义与“至少一个(项)”类似。
本申请实施例中的滑动参数的获取方法所应用的软件环境可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
以下将介绍一下本申请实施例提供的技术方案所应用的软件环境。
图1为本申请实施例提供的一种可能的操作系统的架构示意图。如图1所示,该操作系统的架构包括5层,分别为:View层、HWUI层、Skia层、目标层、图形处理器(GraphicProcessing Unit,GPU)硬件,其中:
View层,用于负责前台页面的显示,View层对应的接口为OverScroller接口。
HWUI层,位于View层的下层,用于处理用户界面(User Interface,UI)的渲染操作,HWUI层对应的接口称为HWUI接口。
Skia层,位于HWUI层的下层,Skia层提供了基本的绘制功能,包括:图形、文本、位图等,Skia层可以理解为底层的图形引擎,Skia层对应的接口为Skia引擎接口,Skia层也可以理解为一个Skia渲染库。
目标层,位于Skia层的下层,目标层对应两个接口,分别为OpenGL ES(OpenGL for Embeddled Systems)接口和Vulkan接口。
其中,OpenGL ES接口,可用于二维或三维图像的处理和渲染。Vulkan接口,能够大幅降低绘制命令开销,改善多线程性能,渲染性能更快。
其中,在应用调用第三方集成的渲染库时,第三方集成的渲染库可以调用OpenGL ES接口和Vulkan接口,OpenGL ES接口和Vulkan接口也可以为两个绘制库。
GPU硬件,位于操作系统的最底层,用于执行在电子设备上渲染图像、视频和动画所需的密集计算。
其中,GPU硬件包括一个触摸屏,触控屏可以采集用户在触摸屏进行输入时的输入参数,例如:输入位置和输入时间等。
其中,触摸屏对应触控接口,电子设备可以通过该触控接口获取用户在触摸屏进行输入时的输入参数。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的滑动参数的获取方法进行详细地说明。
本申请实施例中的滑动参数的获取方法可以应用于滑动页面的场景。
随着客制化系统对原生操作系统的定制越来越深入,很多客制化需求需要精准获取用户的使用场景,从而针对特定场景做深度优化和定制。类似需求,例如,通过识别用户界面的滑动操作的速度,来做其他定制化操作,例如,滑动变帧,以动态改变系统帧率和屏幕刷新率从而达到功耗和性能的最佳平衡。
以Android系统为例,针对页面滑动的需求,Android系统提供了OverScroller滑动引擎供应用选用,而系统端可以监听OverScroller滑动引擎的滑动事件获取前台应用的页面组件的滑动速度。
常见的滑动组件如ListView、RecyclerView、ScrollView等都是基于OverScroller滑动引擎设计。但是,由于Android系统相对开放,因此,部分应用完全可以定制自己的滑动引擎,甚至不采用Android系统所提供的滑动组件,而是采用跨平台的view组件来实现该应用的滑动效果。例如,webview组件用于显示类似浏览器的内容,fluttel组件用于跨平台显示非Android系统控件等。由于Android生态的复杂性和应用的多样性,目前没有一种通用的方法能够实现所有场景的滑动速度的识别方案。
在相关技术中,电子设备主要通过在Android系统的OverScroller滑动引擎中插桩的方式,来监听与OverScroller滑动引擎相关的回调函数来获取前台显示的页面的滑动速度,例如,getCurrentVelocity()或者computeScrollOffet()。这样,经过一定运算获取滑动速度后,便可根据滑动速度来做其他定制化操作。
然而,由于上述在Android系统的OverScroller滑动引擎中插桩的方式,仅限于接入了Android系统的OverScroller滑动引擎的应用,导致UI组件的滑动速度的监听方式过于单一,无法适用更多的监听场景。例如,一部分应用为了实现更丰富的滑动效果,很多并不会通过接入操作系统的OverScroller滑动引擎来实现滑动效果,而是自己定制滑动引擎,通过自己制定的滑动引擎来监听UI组件的滑动速度。另一部分应用为了实现跨平台的特性,如,同时部分应用可以同时跑在Android操作系统和iOS操作系统上,通常会采用的跨平台的UI组件,而Android操作系统无法监控跨平台的UI组件的滑动速度。例如,webview组件和Flutter组件,其中,Flutter组件的整个2D绘制引擎通常采用的是应用自己集成的skia渲染库或者impller渲染库,不会调用到系统端所集成的skia渲染库,所以系统端也是无法监控识别到Flutter组件的滑动速度。
综上,由于应用和UI实现方式的多样性,基于操作系统的OverScroller滑动引擎的滑动速度识别方法,无法覆盖多种应用,来适用更多的监听场景。如此,导致页面的滑动速度的获取方式过于单一。
在本申请实施例提供的滑动参数的获取方法、装置、电子设备及存储介质中,电子设备可以先确定第一页面对应的第一应用的应用类型,然后通过与第一应用的应用类型对应的操作系统的API,获取到第一页面的滑动参数,因此提升了页面的滑动参数的获取方式的灵活性。
本申请实施例提供的滑动参数的获取方法的执行主体可以为滑动参数的获取装置,该滑动参数的获取装置可以为电子设备,或电子设备中的功能模块或实体。以下以电子设备为例,对本申请实施例提供的技术方案进行说明。
本申请实施例提供一种滑动参数的获取方法,图2示出了本申请实施例提供的一种滑动参数的获取方法的流程图,该方法可以应用于电子设备。如图2所示,本申请实施例提供的滑动参数的获取方法可以包括下述的步骤201至步骤203。
步骤201、在接收到用户对显示的第一页面的滑动输入的情况下,电子设备将滑动输入对应的触摸事件上报。
本申请的一些实施例中,上述第一页面可以为聊天页面、游戏页面、购物页面、资讯页面等。本申请实施例对此不作限定。
本申请的一些实施例中,上述滑动输入可以为用户通过手指或者手写笔等触控装置对第一页面的滑动输入。
本申请的一些实施例中,电子设备可以通过触摸屏检测到用户对第一页面的滑动输入。
本申请的一些实施例中,电子设备可以在检测到用户对第一页面的滑动输入后,可以将滑动输入对应的触摸事件上报至操作系统,以在确定第一页面对应的第一应用的应用类型后,可以通过与第一应用的应用类型对应的操作系统的API,获取到第一页面的滑动参数。
步骤202、电子设备确定第一页面对应的第一应用的应用类型。
本申请的一些实施例中,不同的应用类型调用的操作系统的API不同。
本申请的一些实施例中,上述步骤202具体可以通过下述的步骤202a或步骤202b或步骤202c或步骤202d实现。
步骤202a、在第一页面的页面名称中携带webView字符后缀的情况下,电子设备确定第一应用属于第一应用类型。
可以理解,电子设备可以通过判断第一应用显示的第一页面的页面名称中是否携带有webView字符后缀,来确定第一应用所属的应用类型。
本申请的一些实施例中,上述第一页面的页面名称可以理解为应用前台activity的名称。
可以理解,Webview类型的页面的activity名字里面会自动带有一个webview字符后缀,因此可以通过识别第一页面的页面名称中是否携带webView字符后缀,来确定第一应用所属的应用类型。
本申请的一些实施例中,上述第一应用类型可以为WebView类型。
本申请的一些实施例中,上述第一应用类型对应的应用不直接采用操作系统的标准View组件,采用了WebView组件。
示例性地,上述WebView组件用于显示类似浏览器的内容。
本申请的一些实施例中,上述第一应用类型对应的应用调用操作系统的Skia引擎接口;可以理解,由于WebView组件会调用操作系统的Skia渲染库,因此第一应用类型对应的应用调用操作系统的Skia引擎接口。
步骤202b、在第一页面的页面名称中携带Flutter字符后缀的情况下,电子设备确定第一应用属于第二应用类型。
可以理解,电子设备可以通过判断第一应用显示的第一页面的页面名称中是否携带有Flutter字符后缀,来确定第一应用所属的应用类型。
具体地,Flutter类型的页面的activity名字里面会自动带有一个Flutter字符后缀,因此可以通过识别第一页面的页面名称中是否携带Flutter字符后缀,来确定第一应用所属的应用类型。
本申请的一些实施例中,上述第二应用类型可以为Flutter类型。
本申请的一些实施例中,上述第二应用类型对应的应用不采用操作系统的标准View组件,也不调用操作系统的Skia渲染库,采用了跨平台的第三方渲染库Flutter(Skia或者Impeller),第三方渲染库Flutter调用操作系统的Vulkan接口和OpenGL ES接口。
本申请的一些实施例中,上述第二应用类型对应的应用调用操作系统的触控接口。可以理解,由于Vulkan接口和OpenGL ES接口所对应的层级的下一层级为GPU,GPU包括的触摸屏对应触控接口,因此第二应用类型对应的应用调用操作系统的触控接口。
如此,由于可以通过识别第一页面的页面名称中是否携带webView或Flutter字符后缀,来确定第一应用所属的应用类型,因此可以快速确定第一应用所属的应用类型。
步骤202c、在确定第一应用的应用类型不属于第一应用类型且不属于第二应用类型的情况下,若第一应用调用了操作系统的OverScroller接口,则电子设备确定第一应用属于第三应用类型。
可以理解,电子设备可以先基于第一页面的页面名称判断第一应用的应用类型是否属于第一应用类型或第二应用类型,然后在确定第一应用的应用类型不属于第一应用类型或第二应用类型时,再基于第一应用是否调用了OverScroller,来判断第一应用的应用类型属于第三应用类型还是第四应用类型。
本申请的一些实施例中,上述第三应用类型对应的应用调用OverScroller接口。
本申请的一些实施例中,上述OverScroller接口为与操作系统的OverScroller滑动引擎对应的接口。
本申请的一些实施例中,上述第三应用类型对应的应用采用操作系统的标准View组件。
本申请的一些实施例中,在第一应用调用操作系统的OverScroller滑动引擎时,第一应用需要调用操作系统的OverScroller接口,因此在确定第一应用调用了操作系统的OverScroller接口时,电子设备可以确定第一应用的应用类型属于第三应用类型。
步骤202d、在确定第一应用的应用类型不属于第一应用类型且不属于第二应用类型的情况下,若第一应用未调用OverScroller接口,则电子设备确定第一应用属于第四应用类型。
本申请的一些实施例中,上述第四应用类型对应的应用调用操作系统的HWUI接口。
本申请的一些实施例中,上述第四应用类型对应的应用采用操作系统的标准View组件,但是自定了滑动引擎。
本申请的一些实施例中,在第一应用自定义滑动引擎,未调用操作系统的OverScroller滑动引擎时,第一应用也就不调用操作系统的OverScroller接口,需要调用操作系统的HWUI接口,因此在确定第一应用未调用操作系统的OverScroller接口时,电子设备可以确定第一应用的应用类型属于第四应用类型。
举例说明,如图3所示,为操作系统的架构示意图,第三应用类型对应的应用采用操作系统的标准View组件,并且调用了操作系统的OverScroller滑动引擎。第四应用类型对应的应用采用操作系统的标准View组件,但是自定了滑动引擎。第一应用类型对应的应用不直接采用操作系统的标准View组件,采用了WebView组件。第二应用类型对应的应用不采用操作系统的标准View组件,也不调用操作系统的Skia渲染库,采用了跨平台的第三方渲染库,该第三方渲染库调用操作系统的Vulkan接口和OpenGL ES接口。
如此,由于电子设备可以先判断第一应用的应用类型是否属于第一应用类型或第二应用类型,然后在确定第一应用的应用类型不属于第一应用类型或第二应用类型时,再基于第一应用是否调用了操作系统的OverScroller接口,来判断第一应用的应用类型属于第三应用类型还是第四应用类型,从而提高了电子设备确定第一应用所属的应用类型的灵活性。
步骤203、电子设备通过与第一应用的应用类型对应的操作系统的API,获取第一页面的滑动参数。
本申请的一些实施例中,上述滑动参数可以包括以下至少一项:滑动速度、滑动距离、滑动方向。
本申请的一些实施例中,由于上述第一应用类型对应的应用调用操作系统的Skia引擎接口,因此第一应用类型对应的操作系统的API可以理解为Skia引擎接口;第二应用类型对应的应用调用操作系统的触控接口,因此第二应用类型对应的操作系统的API可以理解为触控接口;第三应用类型对应的应用调用OverScroller接口,因此第三应用类型对应的操作系统的API可以理解为OverScroller接口;第四应用类型对应的应用调用HWUI接口,因此第四应用类型对应的操作系统的API可以理解为HWUI接口。
本申请的一些实施例中,在第一应用属于第三应用类型的情况下,由于第三应用类型对应的应用采用操作系统的标准View组件,并且调用了操作系统的OverScroller滑动引擎。因此,第三应用类型的应用对操作系统的依赖程度最高,电子设备更容易获取到应用中页面的滑动参数。
本申请的一些实施例中,电子设备可以通过操作系统的OverScroller接口,监听OverScroller滑动引擎相关的回调函数getCurrentVelocity()或者computeScrollOffet(),以获取第一页面的滑动参数。
可以理解,电子设备可以通过OverScroller接口,来实现获取第一页面的滑动参数。
本申请的一些实施例中,结合图1,如图4所示,上述第一应用属于第四应用类型,与第四应用类型对应的操作系统的API为HWUI接口;上述步骤203具体可以通过下述的步骤301和步骤302实现。
步骤301、电子设备通过HWUI接口,得到第一页面中的视图组件的滑动参数。
可以理解,第四应用类型对应的应用虽然也采用操作系统的标准View组件,但是调用的滑动引擎为自定义滑动引擎,因此,第四应用类型的应用对操作系统的依赖相比于第三应用类型的应用有所降低。因此电子设备可以通过HWUI接口,获取HWUI接口对应的HWUI层中的视图组件的滑动参数,从而得到第一页面中的视图组件的滑动参数,以得到第一页面的滑动参数。
可以理解,电子设备可以通过HWUI接口,来实现获取第一页面中的视图组件的滑动参数。
本申请的一些实施例中,上述视图组件可以理解为View组件。
本申请的一些实施例中,电子设备可以通过HWUI接口,得到每帧View组件的滑动方向和滑动距离,来计算出View组件的滑动速度。
本申请的一些实施例中,电子设备可以通过监听HWUI层的所有子view组件的平移矩阵,来推算出View组件的滑动速度。
示例性地,HWUI层的所有子view组件对应HWUI层的绘制节点RenderNode。
本申请的一些实施例中,电子设备可以基于每帧View组件的滑动方向和滑动距离,得到View组件的平移矩阵。
示例性地,电子设备可以通过每帧View组件所处的位置信息,获取View组件的滑动方向和滑动距离。
本申请的一些实施例中,电子设备可以基于第一页面中包括的多个View组件的滑动距离和滑动方向,确定用户的输入是否为滑动输入。
具体地,在第一页面中包括一个列表,且该列表中包括多个View组件时,若该多个View组件的滑动距离和滑动方向相同,即多个View组件发生相同的位移,则说明这个列表正在滑动,即用户的输入为滑动输入。
本申请的一些实施例中,第一页面的列表中包括的多个View组件,可以理解为一个ViewGroup里包括的多个组件。
举例说明,如图5所示,在第一页面包括的列表中包括3个View组件,即一个ViewGroup里包括3个子View组件时,若各个子View组件的滑动方向和滑动距离一致,则说明第一页面包括的列表整体在滑动,即用户的输入为滑动输入。
步骤302、电子设备基于视图组件的滑动参数,得到第一页面的滑动参数。
可以理解,由于第一页面中的视图组件滑动时,第一页面也在同时滑动,因此可以将视图组件的滑动参数,作为第一页面的滑动参数。
本申请的一些实施例中,在第一页面的列表中包括多个View组件时,电子设备可以将基于任一View组件的滑动方向和滑动距离计算出的任一View组件的滑动速度,作为第一页面的滑动速度。
如此,由于在确定第一应用属于第四应用类型时,电子设备可以通过操作系统中与第四应用类型对应的HWUI接口,得到第一页面中的视图组件的滑动参数,进而得到第一页面的滑动参数,因此提高了电子设备获取第一页面的滑动参数的灵活性。
本申请的一些实施例中,结合图1,如图6所示,上述第一应用属于第一应用类型,与第一应用类型对应的操作系统的API为Skia引擎接口;上述步骤203具体可以通过下述的步骤401和步骤402实现。
步骤401、电子设备通过Skia引擎接口,得到第一页面中的视图组件的滑动参数。
可以理解,由于第一应用类型对应的应用不直接采用操作系统的标准View组件,采用了WebView组件。因此,相比于第四应用类型对操作系统的依赖更低。但是,由于WebView组件会调用操作系统的Skia渲染库,因此电子设备可以通过Skia引擎接口,获取该Skia引擎接口对应的Skia层中的视图组件的滑动参数,从而得到第一页面中的视图组件的滑动参数,以得到第一页面的滑动参数。
可以理解,电子设备可以通过Skia引擎接口,来实现获取第一页面中的视图组件的滑动参数。
本申请的一些实施例中,电子设备可以通过Skia引擎接口,得到每帧View组件的滑动方向和滑动距离,来计算出View组件的滑动速度。
本申请的一些实施例中,电子设备可以通过监听Skia层的所有子view组件的平移矩阵,来推算出View组件的滑动速度。
本申请的一些实施例中,电子设备可以基于每帧View组件的滑动方向和滑动距离,得到View组件的平移矩阵。
步骤402、电子设备基于视图组件的滑动参数,得到第一页面的滑动参数。
如此,由于在确定第一应用属于第一应用类型时,电子设备可以通过操作系统中与第一应用类型对应的Skia引擎接口,得到第一页面中的视图组件的滑动参数,进而得到第一页面的滑动参数,因此提高了电子设备获取第一页面的滑动参数的灵活性。
本申请的一些实施例中,结合图1,如图7所示,上述第一应用属于第二应用类型,与第二应用类型对应的操作系统的API为触控接口;上述步骤203具体可以通过下述的步骤501和步骤502实现。
步骤501、电子设备通过触控接口,获取触摸屏上报的滑动输入的滑动时长和触控位置变化信息。
可以理解,由于第二应用类型对应的应用不采用操作系统的标准View组件,也不调用操作系统的Skia渲染库,采用了跨平台的第三方集成的渲染库,因此相比于第一应用类型的应用对操作系统的依赖程度进一步降低。
可以理解,电子设备可以通过触控接口,来实现获取第一页面中的视图组件的滑动参数。
可以理解,由于用户进行滑动输入时,是在电子设备的触摸屏上进行的滑动输入,因此电子设备可以通过与触摸屏对应触控接口,获取滑动输入的滑动时长和触控位置变化信息。
本申请的一些实施例中,电子设备可以获取触摸屏上报的每帧滑动输入的触控位置信息,以得到每两帧间的触控位置变化信息。
步骤502、电子设备基于滑动时长和触控位置变化信息,得到第一页面的滑动参数。
本申请的一些实施例中,在用户的滑动输入的过程中,电子设备可以通过触摸屏上报的滑动输入的滑动时长和触控位置信息,计算出滑动输入对应的滑动速度。
具体地,电子设备可以先通过第i-1帧第一页面中的滑动输入的触控位置信息与第i帧第一页面中的滑动输入的触控位置信息,得到第i-1帧与第i帧第一页面中的滑动输入的触控位置变化信息,以得到第i-1帧与第i帧滑动输入的滑动距离;然后可以通过第i-1帧和第i帧触摸屏上报的滑动输入的滑动时长,得到第i-1帧与第i帧间的第一时间间隔;最后可以基于滑动距离和第一时间间隔,计算得到第i-1帧与第i帧间滑动输入的输入过程中第一页面的滑动速度。
如此,由于用户进行滑动输入时,是在电子设备的触摸屏上进行的滑动输入,因此电子设备可以通过与触摸屏对应触控接口,获取滑动输入的滑动时长和触控位置变化信息,然后基于该滑动输入的滑动时长和触控位置变化信息,得到第一页面的滑动参数,因此提高了电子设备获取第一页面的滑动参数的灵活性。
本申请的一些实施例中,结合图1,如图8所示,上述第一应用属于第二应用类型,与第二应用类型对应的操作系统的API为触控接口;上述步骤203具体可以通过下述的步骤601至步骤603实现。
步骤601、电子设备获取预先存储的第一应用对应的滑动拟合曲线。
本申请的实施例中,上述滑动拟合曲线用于表征第一应用中的视图组件的滑动速度和滑动时间的映射关系。
本申请的一些实施例中,在用户停止上述滑动输入时,电子设备可以获取上述滑动拟合曲线。
本申请的一些实施例中,每个应用对应一条滑动拟合曲线。
本申请的一些实施例中,针对第一应用,电子设备可以测量多组用户停止滑动输入后,第一应用中的视图组件的滑动时间与滑动速度,然后基于测量的多组数据,拟合出第一应用对应的滑动拟合曲线。
举例说明,如图9所示,图中的曲线表征的是针对第一应用测量的一组数据,由图可知,用户在滑动输入后的第3秒,停止对第一应用中的视图组件的滑动输入,然后该视图组件在第7秒停止滑动,以及第3秒至第7秒间,第一应用中的视图组件自由滑动的滑动速度随时间的变化关系。
本申请的一些实施例中,电子设备可以将拟合得到的滑动拟合曲线保存到数据库中。
步骤602、电子设备通过触控接口,获取触摸屏上报的滑动输入结束时刻的滑动速度。
可以理解,电子设备可以通过触控接口,来实现获取触摸屏上报的滑动输入结束时刻的滑动速度。
本申请的一些实施例中,由于在用户的滑动输入的过程中,电子设备可以通过触控接口,获取每帧触摸屏上报的滑动输入的滑动时长和触控位置信息,以得到滑动输入过程中的滑动速度,因此电子设备可以通过触控接口,获取滑动输入结束时刻的滑动时间,即用户抬手时的时间,以及滑动输入结束时刻的触控位置信息,然后基于滑动输入结束时刻的滑动时间和滑动输入结束时刻的触控位置信息,计算得到滑动输入结束时刻的滑动速度。
本申请的一些实施例中,上述滑动输入结束时刻可以理解为用户手指离开触摸屏的时刻。
步骤603、电子设备基于滑动速度和滑动拟合曲线,得到第一页面的滑动参数。
本申请的一些实施例中,在停止滑动输入后,电子设备可以获取滑动输入结束时刻的滑动速度,并基于该滑动速度和滑动拟合曲线,得到第一时间段内的每个时间点第一页面的滑动速度。
本申请的一些实施例中,上述第一时间段对应的时长可以理解为用户停止滑动输入后,第一页面受惯性滑动的总时长。
本申请的一些实施例中,上述第一时间段的开始时刻为用户停止滑动输入的时刻,第一时间段的结束时刻为第一页面停止滑动的时刻。
本申请的一些实施例中,在用户停止滑动输入时,电子设备可以将获取到的滑动输入结束时刻的滑动速度对应到上述滑动拟合曲线中,从而可以获取到第一时间段的时间长度,以及第一时间段内每个时刻,第一页面的滑动速度。
举例说明,如图10所示,图10中的曲线图为第一应用对应的滑动拟合曲线,假设在滑动输入的结束时刻,获取到的滑动输入的滑动速度为S,则可以将S对应到图10中,在滑动速度S对应的滑动时间为T1时,可以得知第一页面在停止滑动输入后,受惯性滑动的滑动时长为T1至T2间的时长,以及用户停止滑动输入后,第一页面在T1至T2时长内,每个时刻的滑动速度。
可以理解,在用户停止滑动输入时,即用户脱手之后,第一页面会有一个自由滑动的过程,直到最后停止滑动。
可以理解,用户脱手瞬间,第一页面的滑动速度越高,脱手后第一页面滑动的时间越长。
如此,由于每个应用对应一个滑动拟合曲线,因此电子设备可以通过滑动输入结束时刻的滑动速度和滑动拟合曲线,预测出停止滑动输入后,第一页面的滑动速度,从而提升了获取第一页面的滑动速度的灵活性。
本申请的一些实施例中,电子设备可以只在进入第一页面时,判断一次第一应用的应用类型。如此,不会产生大的时延开销,且不会影响到滑动的整个过程。
本申请的一些实施例中,在获取的第一页面的滑动速度为0时,停止监听第一页面的滑动速度。
本申请实施例提供的滑动参数的获取方法中,电子设备可以先确定第一页面对应的第一应用的应用类型,然后通过与第一应用的应用类型对应的操作系统的API,获取到第一页面的滑动参数,因此提升了页面的滑动参数的获取方式的灵活性。
在本申请的一些实施例中,如图11所示,本申请实施例提供的滑动参数的获取方法可以包括下述的步骤S1至步骤S11。
S1、电子设备接收到用户对显示的第一页面的滑动输入。
S2、电子设备将滑动输入对应的触摸事件上报。
S3、电子设备判断第一页面对应的第一应用的应用类型。
S4、电子设备确定第一应用属于WebView类型。
S5、电子设备确定第一应用属于Flutter类型类型。
S6、电子设备确定第一应用属于第三应用类型。
S7、电子设备确定第一应用属于第四应用类型。
若电子设备确定第一应用属于WebView类型,则电子设备执行下述步骤S8;若电子设备确定第一应用属于Flutter类型类型,则电子设备执行下述步骤S9;若电子设备确定第一应用属于第三应用类型,则电子设备执行下述步骤S10;若电子设备确定第一应用属于第四应用类型,则电子设备执行下述步骤S11;
S8、电子设备通过Skia引擎接口,得到第一页面中的View组件的滑动参数,以得到第一页面的滑动参数。
S9、在停止滑动输入之前,电子设备通过触控接口,获取触摸屏上报的滑动输入的滑动时长和触控位置变化信息,以得到第一页面的滑动参数,在停止滑动输入之后,电子设备获取滑动拟合曲线,以及通过触控接口,获取触摸屏上报的滑动输入结束时刻的滑动速度,以得到第一页面的滑动参数。
S10、电子设备通过OverScroller滑动引擎相关的回调函数,获取第一页面的滑动参数。
S11、电子设备通过HWUI接口,得到第一页面中的View组件的滑动参数,以得到第一页面的滑动参数。
本申请的一些实施例中,在执行上述步骤S8或步骤S9或步骤S10或步骤S11后,若获取的第一页面的滑动速度为0,则停止监听第一页面的滑动速度。
需要说明的是,针对步骤S1至步骤S11的相关描述,可以参见上述实施例中的内容,此处不再赘述。
需要说明的是,本申请实施例提供的滑动参数的获取方法,执行主体可以为滑动参数的获取装置。本申请实施例中以滑动参数的获取装置执行滑动参数的获取方法为例,说明本申请实施例提供的滑动参数的获取装置。
图12示出了本申请实施例中涉及的滑动参数的获取装置70的一种可能的结构示意图。如图12所示,该滑动参数的获取装置70可以包括:上报模块71、确定模块72和获取模块73。
其中,上报模块71,用于在接收到用户对显示的第一页面的滑动输入的情况下,将滑动输入对应的触摸事件上报。
确定模块72,用于确定第一页面对应的第一应用的应用类型。
获取模块73,用于通过与确定模块72确定的第一应用的应用类型对应的操作系统的API,获取第一页面的滑动参数。
本申请实施例提供一种滑动参数的获取装置,滑动参数的获取装置可以先确定第一页面对应的第一应用的应用类型,然后通过与第一应用的应用类型对应的操作系统的API,获取到第一页面的滑动参数,因此提升了页面的滑动参数的获取方式的灵活性。
在一种可能的实现方式中,确定模块72,具体用于:
在第一页面的页面名称中携带webView字符后缀的情况下,确定第一应用属于第一应用类型;或者,
在第一页面的页面名称中携带Flutter字符后缀的情况下,确定第一应用属于第二应用类型;或者,
在确定第一应用的应用类型不属于第一应用类型且不属于第二应用类型的情况下,若第一应用调用了操作系统的OverScroller接口,则确定第一应用属于第三应用类型;或者,
在确定第一应用的应用类型不属于第一应用类型且不属于第二应用类型的情况下,若第一应用未调用OverScroller接口,则确定第一应用属于第四应用类型。
在一种可能的实现方式中,第一应用属于第一应用类型,与第一应用类型对应的操作系统的API为Skia引擎接口;获取模块73,具体用于通过Skia引擎接口,得到第一页面中的视图组件的滑动参数;并基于视图组件的滑动参数,得到第一页面的滑动参数。
在一种可能的实现方式中,第一应用属于第二应用类型,与第二应用类型对应的操作系统的API为触控接口;获取模块73,具体用于获取预先存储的第一应用对应的滑动拟合曲线,滑动拟合曲线用于表征第一应用中的视图组件的滑动速度和滑动时间的映射关系;并通过触控接口,获取触摸屏上报的滑动输入结束时刻的滑动速度;以及基于滑动速度和滑动拟合曲线,得到第一页面的滑动参数。
在一种可能的实现方式中,第一应用属于第二应用类型,与第二应用类型对应的操作系统的API为触控接口;获取模块73,具体用于通过触控接口,获取触摸屏上报的滑动输入的滑动时长和触控位置变化信息;并基于滑动时长和触控位置变化信息,得到第一页面的滑动参数
在一种可能的实现方式中,第一应用属于第四应用类型,与第四应用类型对应的操作系统的API为HWUI接口;获取模块73,具体用于通过HWUI接口,得到第一页面中的视图组件的滑动参数;并基于视图组件的滑动参数,得到第一页面的滑动参数。
本申请实施例中的滑动参数的获取装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(Augmented Reality,AR)/虚拟现实(Virtual Reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、上网本或者个人数字助理(Personal Digital Assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(Personal Computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的滑动参数的获取装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请实施例提供的滑动参数的获取装置能够实现上述方法实施例实现的各个过程,为避免重复,这里不再赘述。
可选地,如图13所示,本申请实施例还提供一种电子设备900,包括处理器901和存储器902,存储器902上存储有可在所述处理器901上运行的程序或指令,该程序或指令被处理器901执行时实现上述方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。
图14为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备100包括但不限于:射频单元101、网络模块102、音频输出单元103、输入单元104、传感器105、显示单元106、用户输入单元107、接口单元108、存储器109、以及处理器110等部件。
本领域技术人员可以理解,电子设备100还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器110逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图14中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,处理器110,用于在接收到用户对显示的第一页面的滑动输入的情况下,将滑动输入对应的触摸事件上报;并确定第一页面对应的第一应用的应用类型;以及通过第一应用的应用类型对应的操作系统的API,获取第一页面的滑动参数。
本申请实施例提供一种电子设备,电子设备可以先确定第一页面对应的第一应用的应用类型,然后通过与第一应用的应用类型对应的操作系统的API,获取到第一页面的滑动参数,因此提升了页面的滑动参数的获取方式的灵活性。
本申请的一些实施例中,处理器110,具体用于:
在第一页面的页面名称中携带webView字符后缀的情况下,确定第一应用属于第一应用类型;或者,
在第一页面的页面名称中携带Flutter字符后缀的情况下,确定第一应用属于第二应用类型;或者,
在确定第一应用的应用类型不属于第一应用类型且不属于第二应用类型的情况下,若第一应用调用了操作系统的OverScroller接口,则确定第一应用属于第三应用类型;或者,
在确定第一应用的应用类型不属于第一应用类型且不属于第二应用类型的情况下,若第一应用未调用OverScroller接口,则确定第一应用属于第四应用类型。
本申请的一些实施例中,第一应用属于第一应用类型,与第一应用类型对应的操作系统的API为Skia引擎接口;处理器110,具体用于通过Skia引擎接口,得到第一页面中的视图组件的滑动参数;并基于视图组件的滑动参数,得到第一页面的滑动参数。
本申请的一些实施例中,第一应用属于第二应用类型,与第二应用类型对应的操作系统的API为触控接口;处理器110,具体用于获取预先存储的第一应用对应的滑动拟合曲线,滑动拟合曲线用于表征第一应用中的视图组件的滑动速度和滑动时间的映射关系;并通过触控接口,获取触摸屏上报的滑动输入结束时刻的滑动速度;以及基于滑动速度和滑动拟合曲线,得到第一页面的滑动参数。
本申请的一些实施例中,第一应用属于第二应用类型,与第二应用类型对应的操作系统的API为触控接口;处理器110,具体用于通过触控接口,获取触摸屏上报的滑动输入的滑动时长和触控位置变化信息;并基于滑动时长和触控位置变化信息,得到第一页面的滑动参数。
本申请的一些实施例中,第一应用属于第四应用类型,与第四应用类型对应的操作系统的API为HWUI接口;处理器110,具体用于通过HWUI接口,得到第一页面中的视图组件的滑动参数;并基于视图组件的滑动参数,得到第一页面的滑动参数。
本申请实施例提供的电子设备能够实现上述方法实施例实现的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
本实施例中各种实现方式具有的有益效果具体可以参见上述方法实施例中相应实现方式所具有的有益效果,为避免重复,此处不再赘述。
应理解的是,本申请实施例中,输入单元104可以包括图形处理器(Graphics Processing Unit,GPU)1041和麦克风1042,图形处理器1041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元106可包括显示面板1061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板1061。用户输入单元107包括触控面板1071以及其他输入设备1072中的至少一种。触控面板1071,也称为触摸屏。触控面板1071可包括触摸检测装置和触摸控制器两个部分。其他输入设备1072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。
存储器109可用于存储软件程序以及各种数据。存储器109可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器109可以包括易失性存储器或非易失性存储器,或者,存储器109可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器109包括但不限于这些和任意其它适合类型的存储器。
处理器110可包括一个或多个处理单元;可选的,处理器110集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器110中。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。
本申请实施例提供一种计算机程序/程序产品,所述计算机程序/程序产品被存储在存储介质中,所述程序/程序产品被至少一个处理器执行以实现如上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。
Claims (17)
- 一种滑动参数的获取方法,所述方法包括:在接收到用户对显示的第一页面的滑动输入的情况下,将所述滑动输入对应的触摸事件上报;确定所述第一页面对应的第一应用的应用类型;通过与所述第一应用的应用类型对应的操作系统的应用程序编程接口API,获取所述第一页面的滑动参数。
- 根据权利要求1所述的方法,其中,所述确定所述第一页面对应的第一应用的应用类型,包括:在所述第一页面的页面名称中携带webView字符后缀的情况下,确定所述第一应用属于第一应用类型;或者,在所述第一页面的页面名称中携带Flutter字符后缀的情况下,确定所述第一应用属于第二应用类型;或者,在确定所述第一应用的应用类型不属于所述第一应用类型且不属于所述第二应用类型的情况下,若所述第一应用调用了所述操作系统的OverScroller接口,则确定所述第一应用属于第三应用类型;或者,在确定所述第一应用的应用类型不属于所述第一应用类型且不属于所述第二应用类型的情况下,若所述第一应用未调用所述OverScroller接口,则确定所述第一应用属于第四应用类型。
- 根据权利要求1所述的方法,其中,所述第一应用属于所述第一应用类型,与所述第一应用类型对应的操作系统的API为Skia引擎接口,所述通过与所述第一应用的应用类型对应的操作系统的API,获取所述第一页面的滑动参数,包括:通过所述Skia引擎接口,得到所述第一页面中的视图组件的滑动参数;基于所述视图组件的滑动参数,得到所述第一页面的滑动参数。
- 根据权利要求1所述的方法,其中,所述第一应用属于所述第二应用类型,与所述第二应用类型对应的操作系统的API为触控接口,所述通过与所述第一应用的应用类型对应的操作系统的API,获取所述第一页面的滑动参数,包括:获取预先存储的所述第一应用对应的滑动拟合曲线,所述滑动拟合曲线用于表征所述第一应用中的视图组件的滑动速度和滑动时间的映射关系;通过所述触控接口,获取触摸屏上报的所述滑动输入结束时刻的滑动速度;基于所述滑动速度和所述滑动拟合曲线,得到所述第一页面的所述滑动参数。
- 根据权利要求1所述的方法,其中,所述第一应用属于所述第二应用类型,与所述第二应用类型对应的操作系统的API为触控接口,所述通过与所述第一应用的应用类型对应的操作系统的API,获取所述第一页面的滑动参数,包括:通过所述触控接口,获取触摸屏上报的所述滑动输入的滑动时长和触控位置变化信息;基于所述滑动时长和所述触控位置变化信息,得到所述第一页面的滑动参数。
- 根据权利要求1所述的方法,其中,所述第一应用属于所述第四应用类型,与所述第四应用类型对应的操作系统的API为HWUI接口,所述通过与所述第一应用的应用类型对应的操作系统的API,获取所述第一页面的滑动参数,包括:通过所述HWUI接口,得到所述第一页面中的视图组件的滑动参数;基于所述视图组件的滑动参数,得到所述第一页面的滑动参数。
- 一种滑动参数的获取装置,所述装置包括:上报模块、确定模块和获取模块;所述上报模块,用于在接收到用户对显示的第一页面的滑动输入的情况下,将所述滑动输入对应的触摸事件上报;所述确定模块,用于确定所述第一页面对应的第一应用的应用类型;所述获取模块,用于通过与所述确定模块确定的所述第一应用的应用类型对应的操作系统的API,获取所述第一页面的滑动参数。
- 根据权利要求7所述的装置,其中,所述确定模块,具体用于:在所述第一页面的页面名称中携带webView字符后缀的情况下,确定所述第一应用属于第一应用类型;或者,在所述第一页面的页面名称中携带Flutter字符后缀的情况下,确定所述第一应用属于第二应用类型;或者,在确定所述第一应用的应用类型不属于所述第一应用类型且不属于所述第二应用类型的情况下,若所述第一应用调用了所述操作系统的OverScroller接口,则确定所述第一应用属于第三应用类型;或者,在确定所述第一应用的应用类型不属于所述第一应用类型且不属于所述第二应用类型的情况下,若所述第一应用未调用所述OverScroller接口,则确定所述第一应用属于第四应用类型。
- 根据权利要求7所述的装置,其中,所述第一应用属于所述第一应用类型,与所述第一应用类型对应的操作系统的API为Skia引擎接口,所述获取模块,具体用于通过所述Skia引擎接口,得到所述第一页面中的视图组件的滑动参数;并基于所述视图组件的滑动参数,得到所述第一页面的滑动参数。
- 根据权利要求7所述的装置,其中,所述第一应用属于所述第二应用类型,与所述第二应用类型对应的操作系统的API为触控接口,所述获取模块,具体用于获取预先存储的所述第一应用对应的滑动拟合曲线,所述滑动拟合曲线用于表征所述第一应用中的视图组件的滑动速度和滑动时间的映射关系;并通过所述触控接口,获取触摸屏上报的所述滑动输入结束时刻的滑动速度;以及基于所述滑动速度和所述滑动拟合曲线,得到所述第一页面的所述滑动参数。
- 根据权利要求7所述的装置,其中,所述第一应用属于所述第二应用类型,与所述第二应用类型对应的操作系统的API为触控接口,所述获取模块,具体用于通过所述触控接口,获取触摸屏上报的所述滑动输入的滑动时长和触控位置变化信息;并基于所述滑动时长和所述触控位置变化信息,得到所述第一页面的滑动参数。
- 根据权利要求7所述的装置,其中,所述第一应用属于所述第四应用类型,与所述第四应用类型对应的操作系统的API为HWUI接口,所述获取模块,具体用于通过所述HWUI接口,得到所述第一页面中的视图组件的滑动参数;并基于所述视图组件的滑动参数,得到所述第一页面的滑动参数。
- 一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-6任一项所述的滑动参数的获取方法的步骤。
- 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-6任一项所述的滑动参数的获取方法的步骤。
- 一种计算机程序产品,所述计算机程序产品被存储在存储介质中,所述程序产品被至少一个处理器执行以实现如权利要求1-6任一项所述的滑动参数的获取方法的步骤。
- 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-6任一项所述的滑动参数的获取方法。
- 一种电子设备,包括所述电子设备被配置成用于执行如权利要求1-6任一项所述的滑动参数的获取方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410377308.1 | 2024-03-29 | ||
| CN202410377308.1A CN118244956A (zh) | 2024-03-29 | 2024-03-29 | 滑动参数的获取方法、装置、电子设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025201261A1 true WO2025201261A1 (zh) | 2025-10-02 |
Family
ID=91558056
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2025/084475 Pending WO2025201261A1 (zh) | 2024-03-29 | 2025-03-24 | 滑动参数的获取方法、装置、电子设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN118244956A (zh) |
| WO (1) | WO2025201261A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118244956A (zh) * | 2024-03-29 | 2024-06-25 | 维沃移动通信有限公司 | 滑动参数的获取方法、装置、电子设备及存储介质 |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110727364A (zh) * | 2019-09-24 | 2020-01-24 | 西安万像电子科技有限公司 | 数据处理方法及装置 |
| US20210149534A1 (en) * | 2018-05-21 | 2021-05-20 | Huawei Technologies Co., Ltd. | Display Control Method and Terminal |
| US20220139296A1 (en) * | 2019-07-17 | 2022-05-05 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Image information processing method, electronic device and storage medium |
| CN114764357A (zh) * | 2021-01-13 | 2022-07-19 | 华为技术有限公司 | 界面显示过程中的插帧方法及终端设备 |
| CN115495002A (zh) * | 2021-06-01 | 2022-12-20 | 华为技术有限公司 | 一种控制方法及电子设备 |
| US20230197026A1 (en) * | 2021-12-21 | 2023-06-22 | Beijing Xiaomi Mobile Software Co., Ltd. | Refresh rate adjusting method, electronic device and storage medium |
| CN118244956A (zh) * | 2024-03-29 | 2024-06-25 | 维沃移动通信有限公司 | 滑动参数的获取方法、装置、电子设备及存储介质 |
-
2024
- 2024-03-29 CN CN202410377308.1A patent/CN118244956A/zh active Pending
-
2025
- 2025-03-24 WO PCT/CN2025/084475 patent/WO2025201261A1/zh active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210149534A1 (en) * | 2018-05-21 | 2021-05-20 | Huawei Technologies Co., Ltd. | Display Control Method and Terminal |
| US20220139296A1 (en) * | 2019-07-17 | 2022-05-05 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Image information processing method, electronic device and storage medium |
| CN110727364A (zh) * | 2019-09-24 | 2020-01-24 | 西安万像电子科技有限公司 | 数据处理方法及装置 |
| CN114764357A (zh) * | 2021-01-13 | 2022-07-19 | 华为技术有限公司 | 界面显示过程中的插帧方法及终端设备 |
| CN115495002A (zh) * | 2021-06-01 | 2022-12-20 | 华为技术有限公司 | 一种控制方法及电子设备 |
| US20230197026A1 (en) * | 2021-12-21 | 2023-06-22 | Beijing Xiaomi Mobile Software Co., Ltd. | Refresh rate adjusting method, electronic device and storage medium |
| CN118244956A (zh) * | 2024-03-29 | 2024-06-25 | 维沃移动通信有限公司 | 滑动参数的获取方法、装置、电子设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118244956A (zh) | 2024-06-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109388317B (zh) | 一种图片加载方法、终端设备及存储介质 | |
| CN104978267B (zh) | 网页测试方法、终端及服务器 | |
| KR20140091555A (ko) | 웹 페이지 렌더링 시간 측정 기법 | |
| WO2022121790A1 (zh) | 分屏显示方法、装置、电子设备和可读存储介质 | |
| US11663022B2 (en) | Method and apparatus for displaying widget | |
| CN114779977A (zh) | 界面显示方法、装置、电子设备及存储介质 | |
| WO2025201261A1 (zh) | 滑动参数的获取方法、装置、电子设备及存储介质 | |
| CN110944236A (zh) | 一种群组创建方法及电子设备 | |
| KR20220154825A (ko) | 노트 생성 방법 및 전자기기 | |
| CN109358927B (zh) | 应用程序显示的方法、装置及终端设备 | |
| WO2024245117A1 (zh) | 线程调度方法、装置、电子设备及介质 | |
| CN118172229A (zh) | 图像渲染方法、装置、电子设备和可读存储介质 | |
| CN114416269A (zh) | 界面显示方法和显示设备 | |
| CN108804151B (zh) | 一种重启应用程序的方法及终端 | |
| CN111770374B (zh) | 视频播放方法及装置 | |
| CN114827737B (zh) | 图像生成方法、装置和电子设备 | |
| CN115514860B (zh) | 动态帧率补偿方法、图像处理电路和电子设备 | |
| CN112817555A (zh) | 音量控制方法及音量控制装置 | |
| CN116893792A (zh) | 投屏控制方法、装置及电子设备 | |
| CN112685269A (zh) | 数据的获取方法、装置、电子设备及存储介质 | |
| CN114339410B (zh) | 插帧方法、装置及电子设备 | |
| CN108984677B (zh) | 一种图像拼合方法及终端 | |
| CN115202524B (zh) | 显示方法和装置 | |
| WO2024153027A1 (zh) | 应用显示方法和应用显示装置 | |
| CN116756099A (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: 25775786 Country of ref document: EP Kind code of ref document: A1 |