Scroll parameter acquisition method and apparatus, electronic device and storage medium

By determining the type of page application and using the corresponding operating system API to obtain sliding parameters, the problem of a single sliding parameter acquisition method in the prior art is solved, and more flexible sliding parameter acquisition is achieved.

WO2025201261A1PCT designated stage Publication Date: 2025-10-02VIVO MOBILE COMM CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/084475
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-29
Filing Date
2025-03-24
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

In the prior art, the electronic device obtains the sliding speed through the OverScroller sliding engine in a single way, and the way of obtaining the sliding parameters of the page is single, which cannot adapt to the needs of various application scenarios, resulting in the method of obtaining the sliding speed of the page being too single and unable to adapt to more monitoring scenarios.

Method used

By determining the application type of the electronic device, the flexibility of the sliding parameters of the first page is obtained.

Benefits of technology

Improved the flexibility of the page's sliding parameter acquisition method to adapt to more monitoring scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025084475_02102025_PF_FP_ABST
    Figure CN2025084475_02102025_PF_FP_ABST
Patent Text Reader

Abstract

A scroll parameter acquisition method and apparatus, an electronic device and a storage medium, relating to the field of communications. The method comprises: upon receiving a scroll input of a user for a displayed first page, reporting a touch event corresponding to the scroll input; determining an application type of a first application corresponding to the first page; and acquiring a scroll parameter of the first page by means of an API of an operating system corresponding to the application type of the first application.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device and storage medium for obtaining sliding parameters

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application number 202410377308.1 filed in China on March 29, 2024, the entire contents of which are incorporated herein by reference. Technical Field

[0003] 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. Background Art

[0004] With the continuous updating and development of electronic devices, the functions and special effects used in electronic devices are becoming more and more abundant.

[0005] In the related art, 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.

[0006] It can be seen that the method of obtaining the sliding speed of the page is too simple. Summary of the Invention

[0007] 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.

[0008] In a first aspect, an embodiment of the present application provides a method for obtaining sliding parameters, the method comprising: upon receiving a sliding input from a user on a displayed first page, reporting a touch event corresponding to the sliding input; determining an application type of a first application corresponding to the first page; and obtaining the sliding parameters of the first page through an application programming interface (API) of an operating system corresponding to the application type of the first application.

[0009] In a second aspect, embodiments of the present application provide a device for obtaining sliding parameters, comprising: a reporting module, a determination module, and an acquisition module. The reporting module is configured to, upon receiving a user sliding input on a displayed first page, report a touch event corresponding to the sliding input; the determination module is configured to determine the application type of a first application corresponding to the first page; and the acquisition module is configured to obtain the sliding parameters of the first page via an operating system API corresponding to the application type of the first application determined by the determination module.

[0010] In a third aspect, 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.

[0011] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0012] In a fifth aspect, 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.

[0013] In a sixth 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.

[0014] In an embodiment of the present application, upon receiving a user sliding input on a displayed first page, 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. In this solution, 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. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] FIG1 is a schematic diagram of an operating system architecture according to an embodiment of the present application;

[0016] FIG2 is a flow chart of a method for obtaining sliding parameters according to an embodiment of the present application;

[0017] FIG3 is a second schematic diagram of the architecture of an operating system provided in an embodiment of the present application;

[0018] FIG4 is a second flow chart of a method for obtaining sliding parameters provided in an embodiment of the present application;

[0019] FIG5 is a schematic diagram of an example of a page including a View component provided in an embodiment of the present application;

[0020] FIG6 is a third flow chart of a method for obtaining sliding parameters provided in an embodiment of the present application;

[0021] FIG7 is a fourth flow chart of a method for obtaining sliding parameters provided in an embodiment of the present application;

[0022] FIG8 is a fifth flow chart of a method for obtaining sliding parameters provided in an embodiment of the present application;

[0023] FIG9 is a schematic diagram of an example of a sliding curve corresponding to a sliding input provided in an embodiment of the present application;

[0024] FIG10 is a schematic diagram of an example of a sliding fitting curve diagram provided in an embodiment of the present application;

[0025] FIG11 is a sixth flow chart of a method for obtaining sliding parameters provided in an embodiment of the present application;

[0026] FIG12 is a schematic structural diagram of a sliding parameter acquisition device provided in an embodiment of the present application;

[0027] FIG13 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application;

[0028] FIG14 is a second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The following will be combined with the accompanying drawings in the embodiments of this application to clearly describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0030] The terms "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. In addition, 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.

[0031] The terms "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. For example, 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. Similarly, "at least two" means two or more, and its meaning is similar to "at least one".

[0032] 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.

[0033] The following will introduce the software environment in which the technical solutions provided in the embodiments of this application are applied.

[0034] Figure 1 is a schematic diagram of the architecture of a possible operating system provided by an embodiment of the present application. As shown in Figure 1, the architecture of the operating system includes five layers: View layer, HWUI layer, Skia layer, target layer, and Graphics Processing Unit (GPU) hardware, where:

[0035] The View layer is responsible for displaying the foreground page. The corresponding interface of the View layer is the OverScroller interface.

[0036] The HWUI layer, located below the View layer, is used to process the rendering operation of the user interface (UI). The interface corresponding to the HWUI layer is called the HWUI interface.

[0037] 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.

[0038] 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.

[0039] Among them, the OpenGL ES interface can be used for processing and rendering two-dimensional or three-dimensional images. The Vulkan interface can significantly reduce the overhead of drawing commands, improve multi-threading performance, and achieve faster rendering performance.

[0040] When an application calls a third-party integrated rendering library, the third-party integrated rendering library may call an OpenGL ES interface and a Vulkan interface. The OpenGL ES interface and the Vulkan interface may also be two drawing libraries.

[0041] 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.

[0042] 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.

[0043] 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.

[0044] The following describes in detail the method for obtaining sliding parameters provided in the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0045] The method for obtaining sliding parameters in the embodiment of the present application can be applied to the scenario of sliding pages.

[0046] As customized systems further enhance native operating systems, many customization requirements require precise understanding of user scenarios, enabling in-depth optimization and customization for specific scenarios. For example, by identifying the speed of user interface slides, other customized operations, such as sliding frame rates, can be performed to dynamically adjust the system frame rate and screen refresh rate to achieve the optimal balance between power consumption and performance.

[0047] Taking the Android system as an example, to meet the needs of page sliding, 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.

[0048] Common sliding components such as ListView, RecyclerView, and ScrollView are all designed based on the OverScroller sliding engine. However, due to the relative openness of the Android system, some applications can customize their own sliding engines, even bypassing the Android system's sliding components and instead using cross-platform view components to implement their own sliding effects. For example, the webview component is used to display browser-like content, while the fluttel component is used to display non-Android system controls across platforms. Due to the complexity of the Android ecosystem and the diversity of applications, there is currently no universal method for identifying sliding speed in all scenarios.

[0049] In related technologies, electronic devices primarily rely on plugging into the Android system's OverScroller sliding engine to listen to callback functions related to the OverScroller sliding engine to obtain the scrolling speed of the page displayed on the foreground, such as getCurrentVelocity() or computeScrollOffset(). This allows them to perform other customized operations based on the scrolling speed after obtaining the scrolling speed through certain calculations.

[0050] However, because the aforementioned instrumentation method for the Android system's OverScroller sliding engine is limited to applications that integrate with the Android system's OverScroller sliding engine, the method for monitoring the sliding speed of UI components is too limited and inapplicable to a wider range of monitoring scenarios. For example, to achieve richer sliding effects, some applications do not integrate with the operating system's OverScroller sliding engine. Instead, they customize their own sliding engines and use them to monitor the sliding speed of UI components. Other applications, to achieve cross-platform features, such as those that can run on both Android and iOS, often use cross-platform UI components. However, the Android operating system cannot monitor the sliding speed of cross-platform UI components. For example, 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.

[0051] In summary, due to the diversity of applications and UI implementations, 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. As a result, the method for obtaining the page's sliding speed is too simple.

[0052] In the method, device, electronic device and storage medium for obtaining sliding parameters provided in the embodiments of the present 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 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.

[0053] 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. The technical solution provided in the embodiments of the present application will be described below using an electronic device as an example.

[0054] 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.

[0055] 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.

[0056] In some embodiments of the present application, 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.

[0057] In some embodiments of the present application, 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.

[0058] In some embodiments of the present application, the electronic device can detect the user's sliding input on the first page through the touch screen.

[0059] In some embodiments of the present application, after detecting a user's sliding input to a first page, the electronic device 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.

[0060] Step 202: The electronic device determines the application type of the first application corresponding to the first page.

[0061] In some embodiments of the present application, different application types call different operating system APIs.

[0062] In some embodiments of the present application, the above step 202 can be specifically implemented through the following step 202a or step 202b or step 202c or step 202d.

[0063] 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.

[0064] It is understandable that 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.

[0065] In some embodiments of the present application, the page name of the first page can be understood as the name of the foreground activity of the application.

[0066] It can be understood that the activity name of a Webview type page will automatically have a webview character suffix, so the application type of the first application can be determined by identifying whether the page name of the first page carries the webView character suffix.

[0067] In some embodiments of the present application, the first application type may be a WebView type.

[0068] In some embodiments of the present application, 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.

[0069] Exemplarily, the WebView component is used to display browser-like content.

[0070] In some embodiments of the present application, the application corresponding to the above-mentioned first application type calls the Skia engine interface of the operating system; it can be understood that since the WebView component will call the Skia rendering library of the operating system, the application corresponding to the first application type calls the Skia engine interface of the operating system.

[0071] 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.

[0072] It can be understood that 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.

[0073] Specifically, the activity name of a Flutter-type page automatically has a Flutter character suffix, so the application type of the first application can be determined by identifying whether the page name of the first page carries the Flutter character suffix.

[0074] In some embodiments of the present application, the second application type may be a Flutter type.

[0075] In some embodiments of the present application, the application corresponding to the above-mentioned second application type does not use the standard View component of the operating system, nor does it call the Skia rendering library of the operating system. Instead, it uses the cross-platform third-party rendering library Flutter (Skia or Impeller), and the third-party rendering library Flutter calls the Vulkan interface and OpenGL ES interface of the operating system.

[0076] In some embodiments of the present application, the application corresponding to the second application type calls the touch interface of the operating system. It is understood that since the next level below the layer corresponding to the Vulkan interface and the OpenGL ES interface is the GPU, and the touch screen included in the GPU corresponds to the touch interface, the application corresponding to the second application type calls the touch interface of the operating system.

[0077] In this way, since the application type of the first application can be determined by identifying whether the page name of the first page carries the webView or Flutter character suffix, the application type of the first application can be quickly determined.

[0078] Step 202c: When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if the first application calls the OverScroller interface of the operating system, the electronic device determines that the first application belongs to the third application type.

[0079] It can be understood that the electronic device can first determine whether the application type of the first application belongs to the first application type or the second application type based on the page name of the first page, and then when it is determined that the application type of the first application does not belong to the first application type or the second application type, it can determine whether the application type of the first application belongs to the third application type or the fourth application type based on whether the first application calls OverScroller.

[0080] In some embodiments of the present application, the application corresponding to the third application type calls the OverScroller interface.

[0081] In some embodiments of the present application, the above-mentioned OverScroller interface is an interface corresponding to the OverScroller sliding engine of the operating system.

[0082] In some embodiments of the present application, the application corresponding to the third application type adopts the standard View component of the operating system.

[0083] In some embodiments of the present application, when the first application calls the OverScroller sliding engine of the operating system, the first application needs to call the OverScroller interface of the operating system. Therefore, when determining that the first application has called the OverScroller interface of the operating system, the electronic device can determine that the application type of the first application belongs to the third application type.

[0084] Step 202d: When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if the first application does not call the OverScroller interface, the electronic device determines that the first application belongs to the fourth application type.

[0085] In some embodiments of the present application, the application corresponding to the fourth application type calls the HWUI interface of the operating system.

[0086] In some embodiments of the present application, the application corresponding to the fourth application type adopts the standard View component of the operating system, but customizes the sliding engine.

[0087] In some embodiments of the present application, when the first application customizes the sliding engine and does not call the OverScroller sliding engine of the operating system, the first application will not call the OverScroller interface of the operating system and needs to call the HWUI interface of the operating system. Therefore, when it is determined that the first application does not call the OverScroller interface of the operating system, the electronic device can determine that the application type of the first application belongs to the fourth application type.

[0088] For example, as shown in Figure 3, which is a schematic diagram of the operating system architecture, the application corresponding to the third application type uses the standard View component of the operating system and calls the OverScroller sliding engine of the operating system. The application corresponding to the fourth application type uses the standard View component of the operating system, but customizes the sliding engine. 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 application corresponding to the second application type does not use the standard View component of the operating system, nor does it call the Skia rendering library of the operating system. Instead, it uses a cross-platform third-party rendering library, which calls the Vulkan interface and OpenGL ES interface of the operating system.

[0089] In this way, since the electronic device can first determine whether the application type of the first application belongs to the first application type or the second application type, and then when it is determined that the application type of the first application does not belong to the first application type or the second application type, it can determine whether the application type of the first application belongs to the third application type or the fourth application type based on whether the first application calls the OverScroller interface of the operating system, thereby improving the flexibility of the electronic device in determining the application type to which the first application belongs.

[0090] Step 203: The electronic device obtains the sliding parameters of the first page through an API of the operating system corresponding to the application type of the first application.

[0091] In some embodiments of the present application, the above sliding parameters may include at least one of the following: sliding speed, sliding distance, and sliding direction.

[0092] In some embodiments of the present application, since the application corresponding to the above-mentioned first application type calls the Skia engine interface of the operating system, the API of the operating system corresponding to the first application type can be understood as the Skia engine interface; the application corresponding to the second application type calls the touch interface of the operating system, so the API of the operating system corresponding to the second application type can be understood as the touch interface; the application corresponding to the third application type calls the OverScroller interface, so the API of the operating system corresponding to the third application type can be understood as the OverScroller interface; the application corresponding to the fourth application type calls the HWUI interface, so the API of the operating system corresponding to the fourth application type can be understood as the HWUI interface.

[0093] In some embodiments of the present application, when the first application belongs to the third application type, since the application corresponding to the third application type uses the standard View component of the operating system and calls the OverScroller sliding engine of the operating system, the third application type is most dependent on the operating system, and the electronic device is more likely to obtain the sliding parameters of the application page.

[0094] In some embodiments of the present application, the electronic device may monitor the OverScroller sliding engine-related callback function getCurrentVelocity() or computeScrollOffet() through the OverScroller interface of the operating system to obtain the sliding parameters of the first page.

[0095] It is understandable that the electronic device can obtain the sliding parameters of the first page through the OverScroller interface.

[0096] In some embodiments of the present application, in combination with Figure 1, as shown in Figure 4, the above-mentioned first application belongs to the fourth application type, and the API of the operating system corresponding to the fourth application type is the HWUI interface; the above-mentioned step 203 can be specifically implemented through the following steps 301 and 302.

[0097] Step 301: The electronic device obtains the sliding parameters of the view component in the first page through the HWUI interface.

[0098] It is understandable that although the applications corresponding to the fourth application type also use the standard View component of the operating system, the sliding engine called is a custom sliding engine. Therefore, the dependence of the fourth application type on the operating system is reduced compared to the third application type. Therefore, the electronic device can obtain the sliding parameters of the view component in the HWUI layer corresponding to the HWUI interface through the HWUI interface, thereby obtaining the sliding parameters of the view component in the first page, and thus obtaining the sliding parameters of the first page.

[0099] It can be understood that the electronic device can obtain the sliding parameters of the view component in the first page through the HWUI interface.

[0100] In some embodiments of the present application, the above-mentioned view component can be understood as a View component.

[0101] In some embodiments of the present application, the electronic device may obtain the sliding direction and sliding distance of the View component in each frame through the HWUI interface to calculate the sliding speed of the View component.

[0102] In some embodiments of the present application, the electronic device can calculate the sliding speed of the View component by monitoring the translation matrix of all sub-view components of the HWUI layer.

[0103] Exemplarily, all sub-view components of the HWUI layer correspond to the rendering node RenderNode of the HWUI layer.

[0104] In some embodiments of the present application, the electronic device may obtain a translation matrix of the View component based on the sliding direction and sliding distance of the View component in each frame.

[0105] For example, the electronic device may obtain the sliding direction and sliding distance of the View component through the position information of the View component in each frame.

[0106] In some embodiments of the present application, the electronic device may determine whether the user input is a sliding input based on the sliding distance and sliding direction of multiple View components included in the first page.

[0107] Specifically, when the first page includes a list and the list includes multiple View components, if the sliding distances and sliding directions of the multiple View components are the same, that is, the multiple View components have the same displacement, it means that the list is sliding, that is, the user's input is a sliding input.

[0108] In some embodiments of the present application, the multiple View components included in the list of the first page can be understood as multiple components included in a ViewGroup.

[0109] For example, as shown in Figure 5, 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.

[0110] Step 302: The electronic device obtains the sliding parameters of the first page based on the sliding parameters of the view component.

[0111] It can be understood that when the view component in the first page slides, the first page also slides at the same time, so the sliding parameters of the view component can be used as the sliding parameters of the first page.

[0112] In some embodiments of the present application, when a list on the first page includes multiple View components, 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.

[0113] In this way, when it is determined that the first application belongs to the fourth application type, 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.

[0114] In some embodiments of the present application, in combination with Figure 1, as shown in Figure 6, 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.

[0115] Step 401: The electronic device obtains the sliding parameters of the view component in the first page through the Skia engine interface.

[0116] It is understandable that since 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. However, since 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.

[0117] It can be understood that the electronic device can obtain the sliding parameters of the view component in the first page through the Skia engine interface.

[0118] In some embodiments of the present application, the electronic device may obtain the sliding direction and sliding distance of the View component in each frame through the Skia engine interface to calculate the sliding speed of the View component.

[0119] In some embodiments of the present application, the electronic device can calculate the sliding speed of the View component by monitoring the translation matrix of all sub-view components of the Skia layer.

[0120] In some embodiments of the present application, the electronic device may obtain a translation matrix of the View component based on the sliding direction and sliding distance of the View component in each frame.

[0121] Step 402: The electronic device obtains the sliding parameters of the first page based on the sliding parameters of the view component.

[0122] In this way, when it is determined that the first application belongs to the first application type, the electronic device can obtain the sliding parameters of the view component in the first page through the Skia engine interface corresponding to the first 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.

[0123] In some embodiments of the present application, in combination with Figure 1, as shown in Figure 7, the above-mentioned 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 above-mentioned step 203 can be specifically implemented through the following steps 501 and 502.

[0124] Step 501: 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.

[0125] It can be understood that since the application corresponding to the second application type does not use the standard View component of the operating system, nor does it call the Skia rendering library of the operating system, it uses a cross-platform third-party integrated rendering library. Therefore, compared with the application of the first application type, the degree of dependence on the operating system is further reduced.

[0126] It is understandable that the electronic device can obtain the sliding parameters of the view component in the first page through a touch interface.

[0127] It can be understood that since the user performs sliding input on the touch screen of the electronic device, the electronic device can obtain the sliding duration and touch position change information of the sliding input through the touch interface corresponding to the touch screen.

[0128] In some embodiments of the present application, 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.

[0129] Step 502: The electronic device obtains sliding parameters of the first page based on the sliding duration and the touch position change information.

[0130] In some embodiments of the present application, during the user's sliding input process, the electronic device can calculate the sliding speed corresponding to the sliding input through the sliding duration and touch position information of the sliding input reported by the touch screen.

[0131] Specifically, 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.

[0132] In this way, since the user performs a sliding input on the touch screen of the electronic device, the electronic device can obtain the sliding duration and touch position change information of the sliding input through the touch interface corresponding to the touch screen, and then obtain the sliding parameters of the first page based on the sliding duration and touch position change information of the sliding input, thereby improving the flexibility of the electronic device in obtaining the sliding parameters of the first page.

[0133] In some embodiments of the present application, in combination with Figure 1, as shown in Figure 8, the above-mentioned 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 above-mentioned step 203 can be specifically implemented through the following steps 601 to 603.

[0134] Step 601: The electronic device obtains a pre-stored sliding fitting curve corresponding to a first application.

[0135] In an embodiment of the present application, 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.

[0136] In some embodiments of the present application, when the user stops the sliding input, the electronic device can obtain the sliding fitting curve.

[0137] In some embodiments of the present application, each application corresponds to a sliding fitting curve.

[0138] In some embodiments of the present application, for 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.

[0139] For example, as shown in Figure 9, the curve in the figure represents a set of data measured for the first application. It can be seen from the figure that the user stops sliding the view component in the first application 3 seconds after the sliding input, and then the view component stops sliding at 7 seconds, and the sliding speed of the free sliding of the view component in the first application changes with time between the 3rd second and the 7th second.

[0140] In some embodiments of the present application, the electronic device may save the sliding fitting curve obtained by fitting into a database.

[0141] 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.

[0142] It is understandable that 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.

[0143] In some embodiments of the present application, since during the user's sliding input process, 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.

[0144] In some embodiments of the present application, the above-mentioned sliding input end time can be understood as the time when the user's finger leaves the touch screen.

[0145] Step 603: The electronic device obtains sliding parameters of the first page based on the sliding speed and the sliding fitting curve.

[0146] In some embodiments of the present application, after the sliding input is stopped, the electronic device can obtain the sliding speed at the moment the sliding input ends, and based on the sliding speed and the sliding fitting curve, obtain the sliding speed of the first page at each time point in the first time period.

[0147] In some embodiments of the present application, 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.

[0148] In some embodiments of the present application, the start time of the above-mentioned first time period is the time when the user stops sliding input, and the end time of the first time period is the time when the first page stops sliding.

[0149] In some embodiments of the present application, when the user stops sliding input, the electronic device 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.

[0150] For example, as shown in Figure 10, the curve in Figure 10 is the sliding fitting curve corresponding to the first application. Assuming that at the end moment of the sliding input, the sliding speed of the sliding input obtained is S, then S can be corresponded to Figure 10. When the sliding time corresponding to the sliding speed S is T1, it can be known that after the sliding input is stopped, the sliding time of the first page due to inertial sliding is the time length between T1 and T2, and after the user stops the sliding input, the sliding speed of the first page at each moment within the time length from T1 to T2.

[0151] It can be understood that when the user stops sliding input, that is, after the user lets go, the first page will have a free sliding process until the sliding is finally stopped.

[0152] It can be understood that the higher the sliding speed of the first page is at the moment the user releases the hand, the longer the first page slides after the hand is released.

[0153] In this way, since each application corresponds to a sliding fitting curve, the electronic device can predict the sliding speed of the first page after the sliding input is stopped through the sliding speed at the end of the sliding input and the sliding fitting curve, thereby improving the flexibility of obtaining the sliding speed of the first page.

[0154] In some embodiments of the present application, the electronic device may determine the application type of the first application only once when entering the first page. In this way, no large delay overhead is generated and the entire sliding process is not affected.

[0155] In some embodiments of the present application, when the acquired sliding speed of the first page is 0, monitoring of the sliding speed of the first page is stopped.

[0156] In the method for obtaining sliding parameters provided in an embodiment of the present 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 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.

[0157] In some embodiments of the present application, as shown in FIG11 , the method for obtaining sliding parameters provided in the embodiment of the present application may include the following steps S1 to S11 .

[0158] S1. The electronic device receives a sliding input from a user on a displayed first page.

[0159] S2. The electronic device reports a touch event corresponding to the sliding input.

[0160] S3. The electronic device determines the application type of the first application corresponding to the first page.

[0161] S4. The electronic device determines that the first application is of the WebView type.

[0162] S5. The electronic device determines that the first application belongs to the Flutter type.

[0163] S6. The electronic device determines that the first application belongs to the third application type.

[0164] S7. The electronic device determines that the first application belongs to the fourth application type.

[0165] If 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;

[0166] S8. The electronic device obtains the sliding parameters of the View component in the first page through the Skia engine interface to obtain the sliding parameters of the first page.

[0167] S9. 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.

[0168] S10. The electronic device obtains sliding parameters of the first page through a callback function related to the OverScroller sliding engine.

[0169] S11. 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.

[0170] In some embodiments of the present application, 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.

[0171] It should be noted that, for the relevant description of steps S1 to S11, reference can be made to the contents of the above embodiment, which will not be repeated here.

[0172] It should be noted that the sliding parameter acquisition method provided in the embodiment of the present application can be executed by a sliding parameter acquisition device. In the embodiment of the present application, 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.

[0173] FIG12 shows a possible structural diagram of a sliding parameter acquisition device 70 involved in an embodiment of the present application. As shown in FIG12 , the sliding parameter acquisition device 70 may include: a reporting module 71 , a determination module 72 , and an acquisition module 73 .

[0174] The reporting module 71 is configured to report a touch event corresponding to a sliding input when receiving a sliding input from a user on the displayed first page.

[0175] The determination module 72 is configured to determine the application type of the first application corresponding to the first page.

[0176] 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 .

[0177] 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.

[0178] In a possible implementation, the determination module 72 is specifically configured to:

[0179] In the case where 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,

[0180] When the page name of the first page carries the Flutter character suffix, it is determined that the first application belongs to the second application type; or,

[0181] When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if 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; or

[0182] When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if the first application does not call the OverScroller interface, it is determined that the first application belongs to the fourth application type.

[0183] In one possible implementation, 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.

[0184] In one possible implementation, 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.

[0185] In one possible implementation, 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.

[0186] In one possible implementation, 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.

[0187] The device for obtaining the sliding parameter 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. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle 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), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.

[0188] 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.

[0189] 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.

[0190] Optionally, as shown in Figure 13, an embodiment of the present application also provides an electronic device 900, including a processor 901 and a memory 902, and the memory 902 stores a program or instruction that can be run on the processor 901. When the program or instruction is executed by the processor 901, the various steps 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.

[0191] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0192] FIG14 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

[0193] 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 .

[0194] Those skilled in the art will appreciate that 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.

[0195] Among them, 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.

[0196] An embodiment of the present application provides an electronic device that 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 of obtaining the sliding parameters of the page.

[0197] In some embodiments of the present application, the processor 110 is specifically configured to:

[0198] In the case where 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,

[0199] When the page name of the first page carries the Flutter character suffix, it is determined that the first application belongs to the second application type; or,

[0200] When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if 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; or

[0201] When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if the first application does not call the OverScroller interface, it is determined that the first application belongs to the fourth application type.

[0202] In some embodiments of the present application, 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.

[0203] In some embodiments of the present application, 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.

[0204] In some embodiments of the present application, 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.

[0205] In some embodiments of the present application, 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.

[0206] 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.

[0207] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described here.

[0208] It should be understood that in an embodiment of the present application, 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 a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an 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 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.

[0209] 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.). In addition, 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. Among them, 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 memory 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.

[0210] Processor 110 may include one or more processing units. Optionally, 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.

[0211] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, 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.

[0212] 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.

[0213] 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.

[0214] It should be understood that 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.

[0215] 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.

[0216] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0217] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, 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.

[0218] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A method for obtaining a sliding parameter, the method comprising: When receiving a sliding input from the user on the displayed first page, reporting a touch event corresponding to the sliding input; Determining an application type of a first application corresponding to the first page; The sliding parameters of the first page are obtained through an application programming interface (API) of an operating system corresponding to an application type of the first application.

2. The method according to claim 1, wherein The determining the application type of the first application corresponding to the first page includes: In a case where the page name of the first page carries the character suffix webView, determining that the first application belongs to the first application type; or, When the page name of the first page carries the Flutter character suffix, determining that the first application belongs to the second application type; or, When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if 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; or When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if the first application does not call the OverScroller interface, it is determined that the first application belongs to a fourth application type.

3. The method according to claim 1, wherein The first application belongs to the first application type, and the operating system API corresponding to the first application type is a Skia engine interface. The acquiring the sliding parameter of the first page through the operating system API corresponding to the application type of the first application includes: Obtaining sliding parameters of the view component in the first page through the Skia engine interface; Based on the sliding parameters of the view component, the sliding parameters of the first page are obtained.

4. The method according to claim 1, wherein The first application belongs to the second application type, an operating system API corresponding to the second application type is a touch interface, and obtaining the sliding parameter of the first page through the operating system API corresponding to the application type of the first application includes: Obtaining a pre-stored sliding fitting curve corresponding to the first application, where the sliding fitting curve is used to represent a mapping relationship between a sliding speed and a sliding time of a view component in the first application; Obtaining, through the touch interface, a sliding speed at the end moment of the sliding input reported by the touch screen; The sliding parameter of the first page is obtained based on the sliding speed and the sliding fitting curve.

5. The method according to claim 1, wherein The first application belongs to the second application type, an operating system API corresponding to the second application type is a touch interface, and obtaining the sliding parameter of the first page through the operating system API corresponding to the application type of the first application includes: Obtaining, through the touch interface, the sliding duration and touch position change information of the sliding input reported by the touch screen; A sliding parameter of the first page is obtained based on the sliding duration and the touch position change information.

6. The method according to claim 1, wherein The first application belongs to the fourth application type, the operating system API corresponding to the fourth application type is a HWUI interface, and obtaining the sliding parameter of the first page through the operating system API corresponding to the application type of the first application includes: Obtaining, through the HWUI interface, sliding parameters of the view component in the first page; Based on the sliding parameters of the view component, the sliding parameters of the first page are obtained.

7. A device for obtaining a sliding parameter, the device comprising: Reporting module, confirmation module and acquisition module; The reporting module is configured to report a touch event corresponding to a sliding input performed by the user on the displayed first page when the sliding input is received; The determining module is configured to determine an application type of a first application corresponding to the first page; The acquisition module is configured to acquire the sliding parameters of the first page through an operating system API corresponding to the application type of the first application determined by the determination module.

8. The device according to claim 7, wherein The determining module is specifically configured to: In a case where the page name of the first page carries the character suffix webView, determining that the first application belongs to the first application type; or, When the page name of the first page carries the Flutter character suffix, determining that the first application belongs to the second application type; or, When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if 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; or When it is determined that the application type of the first application does not belong to the first application type and does not belong to the second application type, if the first application does not call the OverScroller interface, it is determined that the first application belongs to a fourth application type.

9. The device according to claim 7, wherein The first application belongs to the first application type, and the operating system API corresponding to the first application type is the Skia engine interface. The acquisition module 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.

10. The device according to claim 7, wherein 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 is specifically used to obtain a pre-stored sliding fitting curve corresponding to the first application, where the sliding fitting curve is used to represent a mapping relationship between a sliding speed and a sliding time of a view component in the first application. The touch interface is used to obtain a sliding speed at the end of the sliding input reported by the touch screen; and the sliding parameter of the first page is obtained based on the sliding speed and the sliding fitting curve.

11. The device according to claim 7, wherein 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 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 the touch position change information.

12. The device according to claim 7, wherein 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 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.

13. An electronic device comprising a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for obtaining sliding parameters according to any one of claims 1 to 6 are implemented.

14. A readable storage medium storing a program or instruction, wherein the program or instruction, when executed by a processor, implements the steps of the method for obtaining sliding parameters according to any one of claims 1 to 6.

15. A computer program product, wherein the computer program product is stored in a storage medium and is executed by at least one processor to implement the steps of the method for obtaining sliding parameters according to any one of claims 1 to 6.

16. A chip comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is configured to execute a program or instruction to implement the method for obtaining sliding parameters according to any one of claims 1 to 6.

17. An electronic device, comprising: the electronic device being configured to execute the method for obtaining sliding parameters according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data processing method and device

    CN110727364A

  • Frame insertion method in interface display process and terminal equipment

    CN114764357A

  • Control method and electronic equipment

    CN115495002A

  • Sliding parameter acquisition method and device, electronic equipment and storage medium

    CN118244956A

  • Display Control Method and Terminal

    US20210149534A1