Display method and electronic device
By executing window animation and in-app animation in electronic devices in parallel, and passing configuration data using buffer queues, conflict problems caused by serial execution of animation effects in the prior art are solved, and display efficiency and effect are improved.
Patent Information
- Application Number
- PCT/CN2024/097096
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-30
- Filing Date
- 2024-06-03
- Publication Date
- 2025-01-02
AI Technical Summary
In existing electronic devices, window-related animation effects are usually executed serially, causing the window animation effects of system service control to conflict with the animation effects of application control, resulting in low display efficiency and poor effect.
By implementing parallel execution of window motion and in-app motion in electronic devices, using buffer queues as shared memory, transmitting motion efficiency configuration data to improve data transmission speed and processing efficiency, ensuring that system-level and application-level motion efficiency are applied to simultaneously The same layer enables parallel display of animation effects.
It improves the display efficiency and effect of dynamic efficiency, reduces the time-consuming communication between processes, reduces the performance overhead on the application side, and improves the chirality of manual efficiency.
Smart Images

Figure CN2024097096_02012025_PF_FP_ABST
Abstract
Description
Display method and electronic device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on June 30, 2023, with application number 202310802970.2 and application name "A Display Method and Electronic Device", the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the technical field of electronic devices, and in particular to a display method and electronic device. Background Art
[0004] Currently, window animations displayed on electronic devices are typically implemented through system services or application controls. Because system services and application controls implement animations independently, conflicts may arise between window animations controlled by system services and animations controlled by applications (which are in-app view animations), resulting in lower animation display efficiency and poor display quality.
[0005] Summary of the Invention
[0006] The present application provides a display method and electronic device for realizing the parallel execution of window animation and in-application animation, thereby improving the display efficiency and display effect of the animation.
[0007] In a first aspect, the present application provides a display method, applied to an electronic device, the method comprising: receiving a first operation when displaying a first animation effect, the first operation being used to instruct the display of a second animation effect; wherein the first animation effect is a window animation of a first window, and the second animation effect is a view animation within a first application; in response to the first operation, sending configuration data of the first animation effect to a second service via a first service, and determining configuration data of the second animation effect according to the first operation via the first application, and transmitting the configuration data of the second animation effect to the second service via the first application; applying the configuration data of the first animation effect and the configuration data of the second animation effect to the first window via the second service. The electronic device includes the first service, the first application, and the second service.
[0008] In this method, the first animation is a window animation, and the second animation is an in-application animation. When the electronic device receives an instruction to execute the second animation while executing and displaying the first animation, the electronic device can pass the configuration data of the first animation to the second service through the first service, and pass the configuration data of the second animation to the second service through the first application. This enables the second service to simultaneously obtain the configuration data of the first animation and the configuration data of the second animation, and simultaneously apply the configuration data of the first animation and the configuration data of the second animation to the first window, thereby achieving parallel execution of the first and second animations, which can improve the display efficiency and display effect of the animation.
[0009] In one possible design, applying the configuration data of the first motion effect and the configuration data of the second motion effect to the first window through the second service includes: applying the configuration data of the first motion effect and the configuration data of the second motion effect to the layer corresponding to the first window through the second service, and synthesizing and displaying the motion effect interface based on the obtained layer.
[0010] In this method, by applying the configuration data of the first animation effect and the configuration data of the second animation effect to the same layer, and then synthesizing and displaying the animation effect interface based on the layer, the first animation effect and the second animation effect can be displayed in parallel when displaying the animation effect, thereby completing the parallel execution of the animation effect.
[0011] In one possible design, passing the configuration data of the second animation effect to the second service through the first application includes: sending the configuration data of the second animation effect to a buffer queue through the first application; and obtaining the configuration data of the second animation effect from the buffer queue through the second service.
[0012] In this method, the buffer queue acts as a shared memory, offering efficient access and enabling fast and accurate data processing (e.g., data transfer). Therefore, the buffer queue allows for faster data transfer when transferring the animation configuration data from the first application to the second service, helping to improve the efficiency of the animation execution process.
[0013] In a possible design, the first service is a window management service WMS, and the second service is a graphics framework service SF.
[0014] In a possible design, the configuration data of the first motion effect and the configuration data of the second motion effect are both identified as configuration data corresponding to the first window.
[0015] In this method, the configuration data of the first animation effect and the configuration data of the second animation effect are both identified as configuration data corresponding to the first window, which helps applications and services in the electronic device to identify the application objects of the configuration data, thereby improving processing efficiency.
[0016] In one possible design, the configuration data of any animation effect is used to indicate the attribute characteristics of the layer or window carrying the animation effect, and the attribute characteristics include at least one of the following: position, size, rotation angle, rounded corners, and transparency.
[0017] In one possible design, the method further includes: in response to a received second operation, controlling the display of a second window through a second application; wherein the second operation is used to indicate the display of the second window; in response to a received third operation, determining, through the second application, configuration data for a tracking effect based on the third operation; wherein the third operation is used to indicate the execution of the tracking effect on the second window; sending the configuration data for the tracking effect to a shared memory through the second application; obtaining the configuration data for the tracking effect from the shared memory through the second service; and applying the configuration data for the tracking effect to the second window through the second service. The electronic device further includes the second application and the shared memory.
[0018] In this method, the first application can write the animation configuration data directly into shared memory, and the second service can obtain the animation configuration data from the shared memory and synthesize and display the animation interface based on the configuration data. The configuration data transmission process can reduce the time consumed by inter-process communication, thereby reducing lag and improving the tracking of the animation. At the same time, this method can avoid performing operations such as applying configuration data in the application-side thread, thereby reducing performance overhead on the application side and reducing application lag.
[0019] In a possible design, the shared memory is a buffer queue.
[0020] In this method, the buffer queue is used as a shared memory, which can fully utilize the efficient access characteristics of the buffer queue to achieve fast and accurate data processing (such as data transmission, etc.), thereby improving the efficiency of the manual execution process.
[0021] In a second aspect, the present application provides a display method, applied to an electronic device, the method comprising: in response to a received first operation, controlling the display of a first window through a first application; wherein the first operation is used to indicate the display of the first window; in response to a received second operation, determining the configuration data of a tracking effect according to the second operation through the first application; wherein the second operation is used to indicate the execution of the tracking effect on the first window; sending the configuration data of the tracking effect to a shared memory through the first application; obtaining the configuration data of the tracking effect from the shared memory through a first service; and applying the configuration data of the tracking effect to the first window through the first service.
[0022] In a possible design, the shared memory is a buffer queue.
[0023] In one possible design, the first service is a graphics framework service SF.
[0024] In a third aspect, an embodiment of the present application provides an electronic device, comprising a display screen, a memory, and one or more processors; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the one or more processors, the electronic device executes the method described in the first aspect or any possible design of the first aspect.
[0025] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on an electronic device, the electronic device executes the method described in the first aspect or any possible design of the first aspect.
[0026] In a fifth aspect, the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on an electronic device, the electronic device executes the method described in the first aspect or any possible design of the first aspect.
[0027] In a sixth aspect, the present application provides a chip system comprising a processor and a memory, wherein the memory stores instructions; when the instructions are executed by the processor, the method described in the first aspect or any possible design of the first aspect is implemented. The chip system may be composed of a chip alone, or may include a chip and other discrete components.
[0028] For the beneficial effects of the second to sixth aspects mentioned above, please refer to the description of the beneficial effects of the relevant content of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] FIG1 is a flow chart of a method for executing window animation effects;
[0030] FIG2 is a schematic diagram of a window dynamic effect interface;
[0031] FIG3 is a schematic diagram of a window dynamic effect interface;
[0032] FIG4 is a schematic diagram of a window dynamic effect interface;
[0033] FIG5 is a flow chart of a method for executing a hand-following effect;
[0034] FIG6 is a schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application;
[0035] FIG7 is a schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0036] FIG8 is a schematic diagram of the architecture of a control system provided in an embodiment of the present application;
[0037] FIG9a is a schematic diagram of a display method provided in an embodiment of the present application;
[0038] FIG9 b is a schematic diagram of a method for executing a motion effect provided in an embodiment of the present application;
[0039] FIG10 is a schematic diagram of a dynamic effect interface provided in an embodiment of the present application;
[0040] FIG11 is a schematic diagram of a display method provided in an embodiment of the present application;
[0041] FIG12 is a schematic diagram of a dynamic effect interface provided in an embodiment of the present application;
[0042] FIG13 is a schematic diagram of a display method provided in an embodiment of the present application;
[0043] FIG14 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0045] In the description of the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, features specified as "first" or "second" may explicitly or implicitly include one or more of the features.
[0046] To facilitate understanding, exemplary descriptions of concepts related to this application are provided for reference.
[0047] The electronic device may be a device that supports virtual audio devices and has communication functions. In some embodiments of the present application, the electronic device may be a portable device, such as a mobile phone, a tablet computer, a wearable device with wireless communication functions (such as a watch, a bracelet, etc.), an in-vehicle terminal device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart home device (such as a smart TV, a smart speaker, etc.), an intelligent robot, a workshop device, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, an aircraft device (such as an intelligent robot, a drone, an airplane), etc.
[0048] A virtual audio device is a logical device created by virtualizing at least one independent electronic device using virtualization technology, which can be used by applications, services, or processes within the electronic device. A wearable device is a portable device that a user can wear directly on the body or integrate into the user's clothing or accessories.
[0049] In some embodiments of the present application, the electronic device may also be a portable terminal device that also includes other functions such as a personal digital assistant and / or a music player. Or a portable terminal device with other operating systems. The portable terminal device may also be other portable terminal devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present application, the electronic device may not be a portable terminal device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0050] It should be understood that in the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.
[0051] Currently, some window-related animations in electronic devices are executed serially, that is, one animation is executed after the other is completed. Therefore, when an electronic device is executing one animation (i.e., the current animation) and receives an instruction to execute another animation (i.e., a new animation), the electronic device can only execute one of the two animations and cannot execute both in parallel. In other words, the electronic device can only continue to execute the current animation without executing the new animation, or the electronic device can only interrupt the current animation and execute the new animation.
[0052] The reason for this problem is that window animations displayed on electronic devices are typically controlled by the window manager service (WMS) or the application. The WMS and application animation control processes are independent of each other, and the animations hosted by the WMS and the application are unaware of each other. Therefore, when a conflict arises between the window animations controlled by the WMS and the application (i.e., they need to be displayed simultaneously), the electronic device can only choose one to execute.
[0053] The above problem is explained in detail below with reference to specific examples.
[0054] For example, when a user swipes up to exit an application window (or application interface) on an electronic device, the animation effect of exiting the application window is a window animation controlled by the window management service of the electronic device. When a user slides the desktop to turn the desktop page displayed on the electronic device, the animation effect of turning the desktop page is a animation controlled by an application in the electronic device, such as a desktop launcher. Exiting an application window means closing the application window.
[0055] For ease of explanation, in the embodiments of the present application, the window animation implemented by the window management service control of the electronic device can be referred to as system-level animation, and the animation implemented by the application control in the electronic device (which can also be called view animation or view animation, etc., which belongs to in-application animation) can be referred to as application-level animation. Among them, in the embodiments of the present application, it can be considered that the system-level animation does not distinguish between applications, that is, for different applications, the animation display method of the system-level animation is the same. For example, the animation of exiting the window of different applications can be the following animation: the application window gradually becomes smaller and disappears, and the desktop gradually appears in the process. It can be considered that the application-level animation distinguishes between applications, that is, for different applications, the display method of the application-level animation may be different. For example, the way of window jumping within different applications can be different. In the embodiments of the present application, it can also be considered that the system-level animation (i.e., window animation) is the animation implemented by operating the window, and it can also be considered that the application-level animation (i.e., in-application animation) is the animation implemented by operating the layer or view.
[0056] For example, after an electronic device displays an application window for an application, if a user swipes up, the electronic device can respond to this action by displaying an animation for exiting the application window under the control of the window management service. If the user swipes the desktop while the electronic device is displaying the animation for exiting the application window, the animation for exiting the application window will conflict with the animation for turning the desktop page. The animation for exiting the application window will be interrupted or canceled, and the animation for turning the desktop page will be displayed first. Application-level animations have a higher priority than system-level animations.
[0057] 1 , the process corresponding to the above process may include:
[0058] S101: The electronic device displays an application window of a certain application on a display screen.
[0059] S102: The electronic device receives a swipe-up operation performed by the user on the display screen; wherein the swipe-up operation is used to indicate exiting the application window.
[0060] S103: The electronic device executes an animation of exiting the application window in response to the upward swipe operation.
[0061] Among them, this process can be completed by the window management service, desktop launcher, view framework (view system) and graphics (SurfaceFlinger, SF) service in the electronic device. After the electronic device receives the upward swipe operation, the window management service in the electronic device can create a layer for carrying the dynamic effect and pass the layer to the desktop launcher. The desktop launcher can determine the configuration data of the dynamic effect of exiting the application window based on the upward swipe operation, and pass the layer and configuration data to SF through the view framework. There is time-consuming inter-process (binder) communication in this transmission process. SF can apply the configuration data to the layer, thereby realizing the synthesis and display of the dynamic effect window.
[0062] In the embodiment of the present application, SurfaceFlinger may also be referred to as a graphics framework, graphics rendering, etc., and there is no restriction on its name in the embodiment of the present application.
[0063] Example 1: Taking the application window displayed by the electronic device in step S101 as the setting window as an example, the dynamic effect of exiting the application window can be: the setting window gradually becomes smaller until it disappears, and in this process, the desktop containing the setting icon gradually appears on the display screen. Exemplarily, when the dynamic effect of exiting the application window is started, the interface displayed by the electronic device can be the interface shown in the schematic diagram (a) in Figure 2. At this time, the setting window is the setting window 201 shown in the schematic diagram (a) in Figure 2. The dynamic effect of exiting the application window in this scenario is the dynamic effect of exiting the setting window 201. After the dynamic effect of exiting the application window is started, the size of the setting window (i.e., the setting window 201 shown in the schematic diagram (a) in Figure 2) will gradually become smaller, for example, it can become the setting window 202 shown in the schematic diagram (b) in Figure 2, wherein the setting window 202 is the window obtained after the setting window 201 is reduced to a certain extent. During the process of continuing to execute the dynamic effect of exiting the application window, the settings window (this is the settings window 202 shown in the schematic diagram (b) in Figure 2) continues to shrink, for example, it can become the settings window 203 shown in the schematic diagram (c) in Figure 2, wherein the settings window 203 is the window obtained after the settings window 202 is shrunk and the window content is adjusted. During the process of continuing to execute the dynamic effect of exiting the application window, the settings window (this is the settings window 203 shown in the schematic diagram (c) in Figure 2) continues to shrink, and can disappear when it is reduced to a certain size (which can also be understood as a dimension), for example, it can disappear when it is reduced to the same size as the settings icon. After the settings window disappears, the interface displayed by the electronic device becomes the interface shown in the schematic diagram (d) in Figure 2, which does not include the settings window but includes the settings icon 204. At this point, the execution of the dynamic effect of exiting the application window ends. The process of the settings window 201 shown in the schematic diagram (a) in Figure 2 gradually disappearing and the settings icon 204 shown in the schematic diagram (d) in Figure 2 gradually appearing as described above is the display process of the dynamic effect of exiting the application window. As the settings window gradually disappears, the content within the window may or may not change. For example, as the settings window 201 shown in FIG. 2 (a) changes to the window 202 shown in FIG. 2 (b) , the content within the window does not change. As the settings window 202 shown in FIG. 2 (b) changes to the window 203 shown in FIG. 2 (c) , the content within the window changes to the settings icon.
[0064] S104: The electronic device receives a horizontal sliding operation performed by the user on the display screen during the process of executing the animation effect of exiting the application window; wherein the horizontal sliding operation is used to instruct to turn the desktop page.
[0065] S105: The electronic device starts executing the desktop page turning animation in response to the horizontal sliding operation.
[0066] Among them, the desktop page turning animation belongs to the view animation, and the application can realize the desktop page turning animation by changing the properties of each frame view in the view animation. The process of the electronic device executing the desktop page turning animation can be completed by the desktop launcher, view framework and SF in the electronic device. Specifically, the desktop launcher can be used to create and manage the layer that carries the view animation, and update the view property (i.e., the layer property) data such as layout data according to the horizontal sliding operation, and trigger the view framework to refresh the view property to obtain the configuration information of the desktop page turning animation. After the view framework refreshes the view properties, the layer content and configuration information can be passed to SF respectively. SF can synthesize and display the interface of the desktop page turning animation according to the layer content and configuration information. Among them, the layer content can be passed through the buffer queue (BufferQueue, BQ), and the configuration information can be passed through inter-process communication.
[0067] Example 2: The dynamic effect of desktop page turning can be: the window where the current desktop is located gradually disappears in a panning manner, and the window where the next desktop is located gradually appears on the display screen in a panning manner. Among them, the current desktop is the interface displayed before the desktop page turning, and the next desktop is the interface displayed after the desktop page turning. Exemplarily, when the dynamic effect of desktop page turning begins, the interface displayed by the electronic device can be the interface shown in the schematic diagram (a) in Figure 3. At this time, the desktop window (i.e., the window where the desktop is located) is the window 301 shown in the schematic diagram (a) in Figure 3. At this time, the content in window 301 is the original desktop content. After the dynamic effect of desktop page turning begins, the content in the desktop window (i.e., window 301 shown in the schematic diagram (a) in Figure 3) can be panned to the left, where the content that moves out of window 301 disappears, and at the same time, part of the content in another window (i.e., window 302 shown in the schematic diagram (d) in Figure 3) moves panned to the left into window 301. Among them, the interface in window 301 can be called the original desktop, and the interface in window 302 can be called the target desktop. The process may be, for example, a gradual change from the window 301 shown in the schematic diagram (a) in FIG3 to the window 301 shown in the schematic diagram (b) in FIG3. During this process, the content in window 301 changes. Specifically, the content in window 301 changes from the original desktop content shown in the schematic diagram (a) in FIG3 to part of the original desktop content and part of the target desktop content shown in the schematic diagram (b) in FIG3. While continuing to execute the desktop page turning effect, the content in the desktop window (this is the window 301 shown in the schematic diagram (b) in FIG3) continues to shift to the left, and the content in window 302 continues to move into window 301. The process may be, for example, a gradual change from the window 301 shown in the schematic diagram (b) in FIG3 to the window 301 shown in the schematic diagram (c) in FIG3. While continuing to execute the desktop page turning effect, the content in the desktop window (this is the window 301 shown in the schematic diagram (c) in FIG3) continues to shift to the left, and the content in window 302 continues to move into window 301. When the original desktop content in window 301 is completely replaced by the target desktop content, the desktop page turning animation is completed. After the desktop page turning animation is completed, the interface displayed by the electronic device may be the interface shown in the schematic diagram (d) in Figure 3. At this time, the desktop window is window 302. The process of gradually changing from window 301 (i.e., the current desktop) shown in the schematic diagram (a) in Figure 3 to window 302 (i.e., the next desktop) shown in the schematic diagram (d) in Figure 3 as described above is the display process of the desktop page turning animation.
[0068] S106: When the electronic device determines that the animation of exiting the application window conflicts with the animation of turning the desktop page, the electronic device determines whether to interrupt the execution of the animation of exiting the application window; if so, execute step S107, otherwise, execute step S108.
[0069] Since the electronic device receives a sliding operation and starts to execute the desktop page turning animation during the process of executing the animation of exiting the application window, the desktop page turning animation conflicts with the animation of exiting the application window. When the priority of the desktop page turning animation is higher than the priority of the animation of exiting the application window, the electronic device can stop executing the animation of exiting the application window and execute the desktop page turning animation. When the priority of the animation of exiting the application window is higher than the priority of the desktop page turning animation, the electronic device can continue to execute the animation of exiting the application window and not execute the desktop page turning animation. The priorities of different animations can be pre-set.
[0070] S107: The electronic device stops executing the animation of exiting the application window and only executes the animation of turning the desktop page.
[0071] Example 3. Based on the above example 1, in the process of an electronic device executing the dynamic effect of exiting an application window, when the electronic device receives an instruction to execute the dynamic effect of turning the desktop page when displaying the interface shown in the schematic diagram (b) in FIG2, and the priority of the application-level dynamic effect is higher than the priority of the system-level dynamic effect, the electronic device will stop executing the dynamic effect of exiting the application window and start executing the dynamic effect of turning the desktop page. Specifically, when the electronic device receives an instruction to execute the dynamic effect of turning the desktop page when displaying the interface shown in the schematic diagram (a) in FIG4 (i.e., the interface shown in the schematic diagram (b) in FIG2), and the priority of the application-level dynamic effect is higher than the priority of the system-level dynamic effect, the electronic device first stops executing the dynamic effect of exiting the application window, i.e., switches from the interface shown in the schematic diagram (a) in FIG4 to the interface shown in the schematic diagram (b) in FIG4. In this process, the window 401 originally in the schematic diagram (a) in FIG4 (i.e., the setting window 202 shown in the schematic diagram (b) in FIG2) disappears directly; the desktop window, i.e., window 402 originally in the schematic diagram (a) in FIG4 is fully displayed and presented as the window 402 shown in the schematic diagram (b) in FIG4. At this time, the electronic device can start to execute the desktop page turning effect. During the electronic device's execution of the page turning effect, the window displayed by the electronic device gradually changes from the window 402 shown in the schematic diagram (b) in Figure 4 (equivalent to the window 301 shown in the schematic diagram (a) in Figure 3) to the window 402 shown in the schematic diagram (c) in Figure 4 (equivalent to the window 301 shown in the schematic diagram (b) in Figure 3), and then gradually changes to the window 402 shown in the schematic diagram (d) in Figure 4 (equivalent to the window 301 shown in the schematic diagram (c) in Figure 3), and then gradually changes to the window 403 shown in the schematic diagram (e) in Figure 4 (equivalent to the window 302 shown in the schematic diagram (d) in Figure 3). This process can refer to the change process of the desktop page turning effect described in the aforementioned Example 2, and will not be described in detail here.
[0072] S108: The electronic device continues to execute the animation of exiting the application window, and does not execute the animation of turning the desktop page.
[0073] In the existing scheme described in the above example, the animation effect of exiting the application window belongs to the system-level animation effect, and the animation effect of turning the desktop page belongs to the application-level animation effect. During the display of the system-level animation effect, the configuration data of the window animation effect is passed to SF by the window management service through inter-process communication. During the display of the application-level animation effect, the configuration data of the window animation effect is passed to SF by the application through inter-process communication. And the configuration data from the window management service and the configuration data from the application act on different layers (wherein, the configuration data from the window management service needs to act on the window created by the window management service, and the configuration data from the application needs to act on the window created by the application). Therefore, at the same time, the SF side can only synthesize and display the corresponding animation interface according to the configuration data from the window management service and the application. Therefore, the execution process of the animation effect of exiting the application window and the animation effect of turning the desktop page are independent and unaware of each other. This leads to the conflict in the execution process when the two animation effects need to be executed at the same time, and the conflict can only be dealt with by serial execution or selective execution.
[0074] In addition, the effect that the window and / or content displayed on the display screen of the electronic device moves or changes as the user performs a sliding operation on the display screen can be called a hand-following effect. For example, during the execution of the above-mentioned desktop page turning effect, during the time period when the user performs a horizontal sliding operation, the process in which the application window (i.e., the desktop) moves following the user's horizontal sliding operation, or the process in which the content displayed on the display screen changes with the user's horizontal sliding operation, is a hand-following effect. In the hand-following stage, when the hand-following effect is implemented by the application control in the electronic device, the application first needs to obtain the position information of the touch input (i.e., information indicating the position of the point of action of the user's sliding operation on the display screen), and then update the content displayed on the display screen (such as the position of the application interface, page layout, etc.) according to the position information to achieve the hand-following effect. Referring to Figure 5, the implementation process of the hand-following effect may include the following steps:
[0075] S501: An application in the electronic device displays an application window on a display screen.
[0076] S502: The user performs a hand-following operation on the display screen of the electronic device.
[0077] For example, in a multi-tasking hand-following scenario, the hand-following operation may be a horizontal sliding operation on the multi-tasking window interface.
[0078] S503: The application in the electronic device obtains operation information of the hand-following operation; wherein the operation information is used to indicate the hand-following operation.
[0079] Optionally, an input service in an electronic device may be used to receive or detect a user's input operation and pass the operation information of the input operation to other services for subsequent processing. Therefore, an application may obtain the operation information of a sliding operation performed by the user from the input service.
[0080] S504: The application updates the position and page layout of the layer corresponding to the application window according to the operation information.
[0081] The user interface (UI) thread of the application may update the position of the layer corresponding to the application window displayed on the display screen according to the position information, and update the page layout of the layer according to the change in the layer position.
[0082] S505: The application determines the attribute information of the layer corresponding to the updated application window according to the operation information, and transmits the attribute information to the view system.
[0083] S506: The view system transparently transmits the attribute information to SF.
[0084] Among them, the process in which the application transmits attribute information to the view system, and the view system transmits the attribute information to SF is time-consuming in inter-process communication.
[0085] S507: SF synthesizes and displays the layer corresponding to the updated application window according to the attribute information.
[0086] Among them, SF can act on the configuration data on the layer corresponding to the current application window to obtain the layer corresponding to the updated application window. After sending the layer to the display, the position of the application window can be refreshed, that is, the manual effect can be achieved.
[0087] In the above-mentioned method for achieving the hand-following effect, when the user performs a sliding operation, the change in the point of action of the sliding operation on the display screen will trigger the application in the electronic device to update the position of the layer corresponding to the application window and the page layout, and then drive the refresh of the application window through the update of the layer, so as to achieve the effect of the application window following the sliding operation to refresh. Among them, there is time-consuming inter-process communication in the process of the application transmitting the attribute information of the layer to the SF, which will affect the speed of the window refresh and may even cause freezes. Therefore, the hand-following performance of this solution is low. At the same time, in the process of achieving the hand-following effect, the refresh of the layer position and the page layout must be executed in the UI thread of the application, which will also cause performance freezes and low hand-following performance problems.
[0088] Based on the above problems, in order to improve the display efficiency and display effect of window animation, an embodiment of the present application provides a display method and an electronic device. This solution can improve the display efficiency and display effect of window animation by executing window animation in parallel and reducing the performance overhead and time consumption of the window animation display process.
[0089] 6 , the structure of an electronic device to which the method provided in an embodiment of the present application is applicable is introduced.
[0090] As shown in Figure 6, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a SIM card interface 195, etc.
[0091] The sensor module 180 may include a gyroscope sensor, an acceleration sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, an ambient light sensor, an air pressure sensor, a bone conduction sensor, and the like.
[0092] It is understood that the electronic device 100 shown in FIG6 is merely an example and does not limit the electronic device, and the electronic device may have more or fewer components than shown in the figure, may combine two or more components, or may have a different component configuration. The various components shown in FIG5 may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.
[0093] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate an operation control signal based on the instruction opcode and the timing signal to complete the control of instruction fetching and execution.
[0094] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0095] The execution of the display method provided in the embodiment of the present application can be controlled by the processor 110 or completed by calling other components, such as calling the processing program of the embodiment of the present application stored in the internal memory 121, or calling the processing program of the embodiment of the present application stored in a third-party device through the external memory interface 120, to control the wireless communication module 160 to communicate data with other devices, thereby improving the intelligence and convenience of the electronic device 100 and enhancing the user experience. The processor 110 can include different devices. For example, when a CPU and a GPU are integrated, the CPU and the GPU can cooperate to execute the display method provided in the embodiment of the present application. For example, part of the algorithm in the display method is executed by the CPU, and another part of the algorithm is executed by the GPU to obtain faster processing efficiency.
[0096] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1. The display screen 194 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces (GUIs). For example, the display screen 194 can display photos, videos, web pages, or files. For another example, the display screen 194 can display the user control interface described in the embodiments of the present application (e.g., a sound projection mode selection interface, a sound projection device selection interface, etc.).
[0097] In the embodiment of the present application, the display screen 194 can be an integrated flexible display screen, or a spliced display screen consisting of two rigid screens and a flexible screen located between the two rigid screens.
[0098] Camera 193 (either a front-facing camera or a rear-facing camera, or one camera serving as both) is used to capture still images or videos. Typically, camera 193 includes a photosensitive element, such as a lens assembly and an image sensor. The lens assembly includes multiple lenses (convex or concave) that capture light signals reflected from the object to be photographed and transmit the captured light signals to the image sensor. The image sensor generates an original image of the object to be photographed based on the light signals.
[0099] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store the code of the operating system, application program (such as the function corresponding to the solution of the present application, etc.). The data storage area can store data created during the use of the electronic device 100, etc.
[0100] The internal memory 121 may also store one or more computer programs corresponding to the algorithms of the present application. The one or more computer programs are stored in the internal memory 121 and configured to be executed by the one or more processors 110. The one or more computer programs include instructions that can be used to perform the various steps in the following embodiments.
[0101] In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0102] Of course, the code of the algorithm of the embodiment of the present application can also be stored in an external memory. In this case, the processor 110 can run the code of the algorithm of the embodiment of the present application stored in the external memory through the external memory interface 120.
[0103] The sensor module 180 may include a gyro sensor, an acceleration sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, and the like.
[0104] A touch sensor, also known as a "touch panel," can be provided on the display screen 194. The touch sensor and the display screen 194 form a touch display screen, also known as a "touch screen." The touch sensor is used to detect touch operations applied to or near the touch sensor. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor can also be provided on the surface of the electronic device 100, at a location different from that of the display screen 194.
[0105] For example, the display screen 194 of the electronic device 100 displays a main interface, which includes icons of multiple applications (such as a camera application). For example, a user can click the icon of the camera application in the main interface through the touch sensor to trigger the processor 110 to start the camera application and turn on the camera 193. The display screen 194 displays the interface of the camera application, such as the viewfinder interface.
[0106] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0107] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0108] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110. In an embodiment of the present application, the mobile communication module 150 can also be used to exchange information with other devices.
[0109] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0110] The wireless communication module 160 can provide wireless communication solutions applied to the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. In the embodiment of the present application, the wireless communication module 160 is used to establish a connection with other electronic devices and exchange data. Alternatively, the wireless communication module 160 can be used to access an access point device, send control instructions to other electronic devices, or receive data sent from other electronic devices.
[0111] In addition, the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor. For example, music playback, recording, etc. The electronic device 100 can receive input from the key 190 and generate key signal input related to the user settings and function control of the electronic device 100. The electronic device 100 can use the motor 191 to generate a vibration prompt (such as an incoming call vibration prompt). The indicator 192 in the electronic device 100 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 in the electronic device 100 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
[0112] It should be understood that in actual applications, the electronic device 100 may include more or fewer components than those shown in FIG6 , and the embodiments of the present application are not limited thereto. The illustrated electronic device 100 is merely an example, and the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0113] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. For example, as shown in Figure 7, the software architecture can be divided into four layers, from top to bottom, namely the application layer, the application framework layer (framework, FWK), the runtime and system library, and the (Linux) kernel layer.
[0114] The application layer is the top layer of the operating system, including native applications of the operating system, such as camera, gallery, calendar, Bluetooth, music, video, information, etc., and may also include third-party applications. The application involved in the embodiment of the present application is referred to as application (APP), which is a software program that can realize one or more specific functions. Typically, multiple applications can be installed in an electronic device, such as a camera application, a mailbox application, etc. The applications mentioned below can be system applications that are installed on the electronic device when it leaves the factory, or they can be third-party applications that the user downloads from the Internet or obtains from other electronic devices while using the electronic device.
[0115] Of course, developers can write applications and install them into this layer. In one possible implementation, applications can be developed using the Java language by calling the application programming interface (API) provided by the application framework layer. Developers can use the application framework to interact with the underlying layer of the operating system (such as the kernel layer) and develop their own applications.
[0116] The application framework layer provides the application API and programming framework. It includes predefined functions and can include a window manager, content provider, view system, telephony manager, resource manager, and notification manager.
[0117] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the display (or screen), capture the display, etc.
[0118] Content providers are used to store and retrieve data and make it accessible to applications. The data may include files (such as documents, videos, images, audio), text, and other information.
[0119] The view system includes visual controls, such as those that display text, images, and documents. The view system is used to build applications. The interface within a display window can be composed of one or more views. For example, the interface for a text notification icon might include a view that displays text and a view that displays an image.
[0120] The phone manager provides communication functionality for electronic devices. The notification manager enables applications to display notifications in the status bar, which can be used to convey informational messages and automatically disappear after a short period of time without user interaction.
[0121] The runtime includes the core library and the virtual machine. The runtime is responsible for the scheduling and management of the system.
[0122] The system's core library consists of two parts: one containing the Java language's callable functions and the other the system's core library. The application layer and application framework layer run within a virtual machine. For example, in Java, the virtual machine executes Java files from the application and framework layers as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0123] The system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), image processing library, etc. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.564, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.
[0124] The kernel layer provides the operating system's core system services, such as security, memory management, process management, the network protocol stack, and the driver model. These services are all implemented at the kernel layer. The kernel layer also serves as an abstraction layer between the hardware and software stacks. This layer contains many drivers related to electronic devices, including the display driver, the keyboard driver for input devices, the Flash driver for memory-based devices, the camera driver, the audio driver, the Bluetooth driver, and the Wi-Fi driver.
[0125] It should be understood that the functional services described above are only examples. In actual applications, electronic devices can also be divided into more or fewer functional services according to other factors, or the functions of each service can be divided in other ways, or the functional services can be not divided but work as a whole.
[0126] The solution provided in the embodiments of the present application is described in detail below.
[0127] FIG8 is a schematic diagram of the architecture of a control system provided in an embodiment of the present application. The control system can be deployed in an electronic device. As shown in FIG8 , the control system can include an image producer, an image buffer, and an image consumer.
[0128] The image producer is used to generate the layer content (or layer data) required for the composite image, i.e., the rendering object (surface) data. Surface can also be referred to as a rendering surface, etc., and its name is not limited in the embodiments of the present application. The image producer can be a system service, process, or application in an electronic device, for example, the image producer can be an Open Graphics Library for Embedded Systems (openGL ES), a two-dimensional vector graphics processing function library (such as Skia), a drawing application program interface (such as Vulkan), a decoder, etc.
[0129] In some embodiments of the present application, the image buffer may include a surface service, a buffer queue, and a blast BufferQueue (BBQ) service. Among them, the layer service is used to connect the image producer and the buffer queue, and specifically can be used to pass the buffer containing the layer content generated by the image producer to the buffer queue or pass the blank buffer in the buffer queue to the image producer, etc. The buffer queue can be used to connect the image producer and the image consumer, and specifically can be used to pass the buffer from the image producer to the image consumer, so that the image consumer synthesizes and displays the interface according to the data in the buffer. The BBQ service is used to connect the buffer queue and the image consumer, and specifically can be used to pass the buffer from the image producer in the buffer queue to the image consumer or pass the blank buffer processed by the image consumer back to the buffer queue.
[0130] In some embodiments of the present application, the surface service may include a buffer queue producer (BufferQueueProducer). The buffer queue producer can be used to provide a basic interface for operating buffer queues. The buffer queue producer can include buffer slots. A buffer slot is a collection of buffers and is the core unit for the image producer to operate on buffer data. A buffer slot can include at least one buffer (buffer / GraphicBuffer).
[0131] In some embodiments of the present application, a buffer queue may include a buffer queue core (BufferQueueCore), a buffer queue producer (BufferQueueProducer), and a buffer queue consumer (BufferQueueConsumer). The buffer queue core can be used to maintain the basic data structure of the buffer queue. The buffer queue producer and buffer queue consumer can be used to provide a basic interface for operating the buffer queue.
[0132] In some embodiments of the present application, a BBQ service may include a buffer queue consumer. The buffer queue consumer may provide a basic interface for operating a buffer queue. The buffer queue consumer may include a buffer slot. A buffer slot is a collection of buffers and serves as the core unit for image consumers to operate on buffer data. A buffer slot may include at least one buffer.
[0133] The image consumer is used to consume the buffers in the buffer queue that contain layer data, specifically to synthesize the layer data in the buffers and send it to the display screen. In some embodiments of the present application, the image consumer may include a SF, a hardware composer, and a graphics service (e.g., the Open Graphics Library for Embedded Systems shown in FIG7 ). The SF can receive buffers from the buffer queue and use the hardware composer and graphics service to synthesize the data in the buffers into the interface to be displayed and send it to the display screen.
[0134] In the control system shown in FIG8 , the arrows may represent the flow direction of the buffer zone.
[0135] In some embodiments of the present application, the control system described in Figure 8 above can be deployed in the system architecture shown in Figure 7, for example, it can be deployed in the application framework layer or system library and other structural layers in the system architecture shown in Figure 7.
[0136] In the embodiment of the present application, the display of the content in the window on the display screen of the electronic device can be achieved by the above method.
[0137] It should be understood that the system architecture of the control system described above is only an example. In actual applications, the control system may also include more or fewer functional modules (or services), or the functions of each module may be divided in other ways, or the functional modules may not be divided, but the system may work as a whole.
[0138] The solution provided in this application is described below with reference to specific embodiments.
[0139] Example 1
[0140] In the solution provided by this embodiment, on the one hand, for system-level animation, the system service in the electronic device can directly send the configuration data (or configuration parameters) of the window animation to SF. On the other hand, for application-level animation, the application in the electronic device can define a field for recording the configuration data of the window animation in the buffer applied for by the buffer dequeue method, and write the configuration data of the window animation directly into the field. The buffer in which the configuration data is written is then passed to the buffer queue by means of buffer enqueue (queueBuffer / queue). The buffer queue can pass the buffer in which the configuration data is written to SF, so that SF obtains the configuration data of the window animation in the buffer. Based on the above method, SF can obtain the configuration data of the system-level animation as well as the configuration data of the application-level animation. When system-level animation and application-level animation are triggered at the same time, SF can obtain the configuration data of the system-level animation and the configuration data of the application-level animation at the same time, and when applying the configuration data of the system-level animation to the layer created by the window management service, it can also apply the configuration data of the application-level animation to the layer at the same time, and then further synthesize and display the animation interface, thereby achieving the effect of parallel execution of system-level animation and application-level animation.
[0141] The following takes the scenario of executing the animation effect of exiting the application window and the animation effect of turning the desktop page in parallel as an example to illustrate the above method in combination with the specific process.
[0142] 9a , a display method provided by an embodiment of the present application may include:
[0143] S901: The electronic device displays an application window of a first application on a display screen.
[0144] Exemplarily, the first application may be a setting, and the application window of the first application may be the window where the interface shown in the schematic diagram (a) in FIG. 2 is located.
[0145] S902: The electronic device executes an exit application window animation in response to the received first operation; wherein the first operation is used to instruct exiting the application window of the first application.
[0146] Among them, the exit application window animation is the animation of exiting the application window.
[0147] In some embodiments of the present application, the process of executing the exit application window animation may include the following steps A1 to A3:
[0148] A1: The window management service in the electronic device determines configuration data of the exit application window animation according to the first operation.
[0149] In some embodiments of the present application, the configuration data of the animation may include attribute information of the interface, view, or layer corresponding to the animation. For example, the attribute information may include position, size (or dimensions), rotation angle, scale, rounded corners, transparency, and other information.
[0150] A2: The window management service transmits the configuration data of the exit application window animation to the SF in the electronic device.
[0151] As an optional implementation, the window management service can pass the configuration data of the application window exit animation effect to the SF through inter-process communication. As another optional implementation, the window management service can pass the configuration data of the application window exit animation effect to shared memory, and the SF can obtain the configuration data from the shared memory. Exemplarily, the shared memory can be a buffer queue.
[0152] A3: SF synthesizes and displays the dynamic interface of the exit application window based on the configuration data of the dynamic effect of the exit application window.
[0153] The specific implementation of the above steps A1 to A3 can refer to the method described in step 103 in the above embodiment, and will not be repeated here.
[0154] Exemplarily, the first operation may be an operation of the user swiping upwards from the bottom of the display screen.
[0155] Illustratively, the complete animation of exiting the application window may be the animation introduced in Example 1 of the above embodiment.
[0156] S903: During the process of executing the animation effect of exiting the application window, the electronic device receives a second operation; wherein the second operation is used to instruct to turn the desktop page.
[0157] Exemplarily, the second operation may be a horizontal sliding operation performed by the user on the display screen, for example, an operation of sliding from left to right, or an operation of sliding from right to left.
[0158] S904: The electronic device executes a target animation in response to the received second operation; wherein the target animation includes an application window exit animation and a desktop page turning animation.
[0159] Among them, the desktop page turning effect is the desktop page turning effect.
[0160] In some embodiments of the present application, as shown in FIG9b , the process of executing the target animation may include the following steps B1 to B4:
[0161] B1: The first application in the electronic device determines configuration data of the desktop page turning animation according to the second operation.
[0162] B2: The first application passes the configuration data of the desktop page turning animation to the buffer queue.
[0163] In some embodiments of the present application, after determining the configuration data of the desktop page turning animation, the first application does not need to update and transfer the configuration data through the view framework, but can directly transfer the configuration data to the buffer queue, and then the buffer queue transfers the configuration data to SF, and then SF synthesizes and displays the animation interface according to the configuration data. Among them, the first application can obtain a blank buffer in the buffer queue by means of buffer dequeue (dequeueBuffer / dequeue). After obtaining the buffer, the first application can set a setting field in the buffer for recording the configuration data of the desktop page turning animation, and write the configuration data of the desktop page turning animation into the setting field of the buffer. After writing the configuration data, the first application can transfer the buffer to the buffer queue by means of buffer enqueue, thereby achieving the effect of transferring the configuration data of the desktop page turning animation to the buffer queue. Based on the above method, the configuration data of the desktop page turning animation can be transferred to SF in a similar manner to the layer content of the corresponding layer of the desktop, that is, it is transferred to SF through the buffer queue.
[0164] B3: SF obtains the configuration data of the desktop page turning animation from the buffer queue.
[0165] B4: SF continues to receive configuration data of the exit application window animation from the window management service.
[0166] Optionally, the execution order of the above steps B3 and B4 can be arbitrary.
[0167] In some embodiments of the present application, the above steps B3 and B4 can be executed synchronously. On the one hand, in the above step B3, SF can obtain the buffer in the buffer queue where the configuration data has been written by acquiring the buffer (acquirebuffer / acquire) (or buffer access, etc.). After acquiring the buffer, SF can determine whether the data of the above-mentioned setting field exists in the buffer. If so, the configuration data of the desktop page turning animation can be obtained, and SF can use the data in the setting field (i.e., the configuration data of the desktop page turning animation) as the configuration data of the animation to be displayed. On the other hand, in the above step B4, SF can continue to receive the configuration data of the exit application window animation from the window management service, and use the received configuration data of the exit application window animation as the configuration data of the animation to be displayed. Among them, the animation to be displayed is the target animation.
[0168] In some embodiments of the present application, the first application may also use a layer identifier to mark the data of the setting field, i.e., the configuration data of the desktop page turning animation effect, wherein the layer identifier is the identifier of the layer created by the window management service (i.e., the layer identifier created by the window management service to carry the exit application window animation effect). The first application may obtain the layer identifier from the window management service.
[0169] In the above method, if the SF determines that the data of the above setting field does not exist in the buffer, the SF may only use the configuration data of the exit application window animation as the configuration data of the animation to be displayed.
[0170] B5: SF uses the configuration data of the exit application window animation and the configuration data of the desktop page turning animation as the target configuration data corresponding to the target animation, synthesizes the animation interface of the target animation according to the target configuration data, and sends it to the display screen for display.
[0171] In the above method, on the one hand, SF can obtain the configuration data of the exit application window animation from the window management service; on the other hand, SF can obtain the configuration data of the desktop page turning animation from the application through the buffer queue. Therefore, SF can use the configuration data of the exit application window animation and the configuration data of the desktop page turning animation as the configuration data of the animation to be displayed, and act on the layer created by the window management service according to the configuration data, thereby realizing the synthesis of the animation interface. After synthesizing the animation interface, SF can send the animation interface to the display screen, thereby realizing the parallel execution of the exit application window animation and the desktop page turning animation. Therefore, in the above method, the electronic device can simultaneously display the exit application window animation and the desktop page turning animation, which can achieve better display effects. In addition, as a shared memory, the buffer queue has the characteristics of efficient access, so it can realize fast and accurate data processing (such as data transmission, etc.), which helps to improve the efficiency of animation display.
[0172] Exemplarily, in the process of an electronic device displaying an exit application window animation (i.e., the animation introduced in Example 1 of the above embodiment), as shown in FIG10, when the electronic device receives a second operation while displaying the interface shown in the schematic diagram (a) in FIG10 (i.e., the interface shown in the schematic diagram (b) in FIG2), the electronic device also displays a desktop page turning animation while continuing to display the subsequent exit application window animation. Specifically, when the electronic device receives a second operation while displaying the interface shown in the schematic diagram (a) in FIG10 (i.e., the interface shown in the schematic diagram (b) in FIG2), the electronic device can switch from the interface shown in the schematic diagram (a) in FIG10 to the interface shown in the schematic diagram (b) in FIG10. Among them, the original setting window 1001 in the schematic diagram (a) in FIG10 (i.e., the setting window 202 shown in the schematic diagram (b) in FIG2) gradually shrinks and shifts to the left to become the setting window 1003 shown in the schematic diagram (b) in FIG10. The content of the desktop window, i.e., window 1002, in the schematic diagram (a) of Figure 10 is gradually translated to the left, and part of the content of window 1005 in the schematic diagram (d) of Figure 10 is gradually translated to the left into window 1002 in the schematic diagram (a) of Figure 10. Therefore, window 1002 in the schematic diagram (a) of Figure 10 is gradually transformed into window 1002 shown in the schematic diagram (b) of Figure 10. In the process of continuing to execute the animation effect, window 1003 shown in the schematic diagram (b) of Figure 10 continues to shrink, and the content of window 1002 shown in the schematic diagram (b) of Figure 10 continues to translate to the left. For example, the interface shown in the schematic diagram (b) of Figure 10 can gradually change to the interface shown in the schematic diagram (c) of Figure 10. Among them, the setting window 1003 shown in the schematic diagram (b) in Figure 10 can be changed to the setting window 1004 shown in the schematic diagram (c) in Figure 10 (the setting window 1004 is the window obtained after the setting window 1003 is reduced and the window content is adjusted), and the content in the window 1002 shown in the schematic diagram (b) in Figure 10 gradually changes to the content in the window 1002 shown in the schematic diagram (c) in Figure 10. During the process of continuing to execute the animation effect, the window 1004 shown in the schematic diagram (c) in Figure 10 continues to shrink and can disappear when it is reduced to a certain size. The content in the window 1002 shown in the schematic diagram (c) in Figure 10 continues to shift to the left. When the window 1004 shown in the schematic diagram (c) in Figure 10 disappears and the original desktop content in the window 1002 shown in the schematic diagram (a) in Figure 10 is completely replaced by the target desktop content (i.e., the content in the window 1005 shown in the schematic diagram (d) in Figure 10), the overall animation effect execution ends. After the overall motion effect is executed, the interface displayed by the electronic device may be the interface shown in the schematic diagram (d) in FIG. 10 . At this time, the desktop window is window 1005 .The process of gradually changing from the interface shown in the schematic diagram of Figure 10 (a) to the interface shown in the schematic diagram of Figure 10 (d) as described above is a display process of executing the exit application window animation and the desktop page turning animation in parallel. It should be noted that the interface shown in the schematic diagram of Figure 10 (a) to the interface shown in the schematic diagram of Figure 10 (d) only exemplarily shows part of the interface in the animation display process, rather than all the animation effect interfaces, and therefore does not impose any restrictions on the interface in the process of displaying animation effects on electronic devices.
[0173] Based on this method, when an electronic device receives a desktop page-turning action while displaying an app exit window animation, it can simultaneously display both the app exit window animation and the desktop page-turning animation. Compared to traditional solutions that only display one animation at a time, this method offers better animation display and a more enhanced user experience.
[0174] Example 2
[0175] In the solution provided by this embodiment, for the display of the hand-following effect, when the information of the hand-following operation on the display screen of the electronic device is transmitted to the application, the application can update the attribute information of the corresponding layer of the application window according to the received operation information, and can transmit the attribute information to the shared memory. SF can obtain the attribute information from the shared content, and apply the attribute information to the layer corresponding to the application window to obtain the updated layer. The hand-following effect can be realized after SF sends the updated layer to the display screen. Among them, the attribute information of the application side can be directly transmitted to SF using shared memory, and SF refreshes the layer according to the attribute information. Therefore, the time consumption of inter-process communication when the application transmits attribute information through the view framework can be reduced or avoided, thereby improving the processing speed. At the same time, it can reduce or avoid the performance overhead and time consumption caused by refreshing the layer position and page layout in the UI thread of the application. Therefore, the above solution can improve the processing performance and the hand-following nature of the hand-following effect.
[0176] Exemplarily, the shared memory described in the embodiments of the present application may be a buffer queue.
[0177] The following uses the scenario of displaying manual effects as an example and shared memory as a buffer queue as an example to illustrate the above method in combination with the specific process.
[0178] 11 , a display method provided by an embodiment of the present application may include:
[0179] S1101: A first application in the electronic device displays an application window on a display screen.
[0180] For example, in the floating window following hand scenario, the first application may be settings, and the application window may be the floating window of settings shown in the schematic diagram (a) of FIG12 .
[0181] S1102: The user performs hand-following operations on the display screen of the electronic device.
[0182] The following hand operation can be: selecting a window / control / content on the display and then sliding it. For example, in a multitasking following hand scenario, the following hand operation can be swiping up from the bottom of the display and then sliding horizontally (e.g., left or right). Another example is long pressing to select a floating window on the display and then sliding it.
[0183] For example, in the above-mentioned floating window following hand scenario, the following hand operation may be an operation of sliding upwards after selecting the set floating window.
[0184] S1103: The first application obtains operation information of the hand-following operation; wherein the operation information is used to indicate the hand-following operation.
[0185] The operation information can specifically be used to indicate the point of action of the hand-following operation on the display screen. In some embodiments of the present application, the operation information can also be used to indicate the window or layer on which the hand-following operation is applied. For example, the operation information can include identification information of the window or layer on which the hand-following operation is applied.
[0186] Optionally, the input service in the electronic device can be used to receive or detect the user's input operation, namely the hand-following operation, and pass the operation information of the hand-following operation to other services for subsequent processing. Therefore, the application can obtain the operation information of the user's hand-following operation from the input service.
[0187] For example, in the above-mentioned floating window following hand scenario, the operation information may include: the location information of the action point of the following hand operation on the display screen, and the identifier of the layer on which the following hand operation acts (that is, the identifier of the layer corresponding to the set floating window).
[0188] S1104: The first application determines attribute information of a layer corresponding to the updated application window according to the operation information of the hand-following operation, and transmits the attribute information to a buffer queue.
[0189] S1105: SF obtains the attribute information from the buffer queue.
[0190] In some embodiments of the present application, SF may obtain attribute information corresponding to the identifier of the layer corresponding to the application window from the buffer queue, and apply the attribute information to the layer indicated by the identifier.
[0191] S1106: SF synthesizes and displays the layers corresponding to the updated application window according to the attribute information.
[0192] Among them, SF can act (or apply) the configuration data on the layer corresponding to the current application window, obtain the layer corresponding to the updated application window, and send the layer to be displayed to refresh the position of the application window, that is, to follow the manual effect.
[0193] For example, in the above-mentioned floating window hand-following scenario, when the point of action of the hand-following operation is at the first position shown in the schematic diagram (b) in FIG12 , the attribute information obtained by SF may include position information for indicating the first position, and SF may use the position indicated by the position information (i.e., the first position) as the display position of the updated floating window on the display screen, and synthesize and display the corresponding layer of the updated floating window accordingly, thereby realizing the hand-following effect of the floating window. For example, after realizing the hand-following effect of the floating window in the above manner, the interface displayed on the display screen is the interface shown in the schematic diagram (b) in FIG12 , in which the position of the floating window is the first position.
[0194] In this method, the application can write layer attribute information directly to shared memory, such as a buffer queue. Each time the display interface is refreshed, the SF can retrieve the layer attribute information from the buffer queue and perform layer synthesis and display based on this attribute information. This allows the application-side layer attribute information to be directly transmitted to the SF, thereby saving time in inter-process communication, reducing lag and improving hand tracking. It also avoids performing a large number of operations on the application's UI thread, thereby reducing performance overhead, reducing lag, and improving hand tracking.
[0195] It should be noted that the specific implementation processes provided in the above embodiments are merely examples of the applicable method processes of the embodiments of the present application. The execution order of each step can be adjusted accordingly according to actual needs, and other steps can be added or some steps can be reduced. The specific implementation methods of each step can be referred to the relevant descriptions in the above embodiments and will not be described in detail here.
[0196] Based on the above embodiments and the same technical concept, an embodiment of the present application further provides a display method, as shown in FIG13 , which may include:
[0197] S1301: The electronic device receives a first operation while displaying a first animation effect, where the first operation is used to instruct the display of a second animation effect; wherein the first animation effect is a window animation of a first window, and the second animation effect is a view animation within a first application.
[0198] In one example, the first animation effect may be the exit application window animation effect described in the aforementioned embodiment, and the first window may be the application window. The second animation effect may be the desktop page turning animation effect described in the aforementioned embodiment, and the first operation may be the second operation for instructing desktop page turning described in the aforementioned embodiment.
[0199] In some embodiments of the present application, step S1301 can also be replaced by the following steps: the electronic device receives a first operation when displaying the second animation effect, and the first operation is used to indicate the display of the first animation effect; wherein the first animation effect is the window animation of the first window, and the second animation effect is the view animation within the first application.
[0200] S1302: In response to the first operation, the electronic device sends the configuration data of the first animation to the second service through the first service, and determines the configuration data of the second animation according to the first operation through the first application, and passes the configuration data of the second animation to the second service through the first application.
[0201] In some embodiments of the present application, the first service may be a window management service WMS, and the second service may be a graphics framework service SF.
[0202] In some embodiments of the present application, as an optional implementation, the electronic device sends the configuration data of the first animation effect to the second service through the first service, specifically, the first service sends the configuration data of the first animation effect to the second service through inter-process communication. As another optional implementation, the electronic device sends the configuration data of the first animation effect to the second service through the first service, specifically, the first service sends the configuration data of the first animation effect to the buffer queue, and obtains the configuration data of the first animation effect from the buffer queue through the second service. The buffer queue can be used as a shared memory.
[0203] In some embodiments of the present application, the electronic device transmits the configuration data of the second animation effect to the second service through the first application. Specifically, the first application sends the configuration data of the second animation effect to a buffer queue, and the second service retrieves the configuration data of the second animation effect from the buffer queue. The buffer queue can be used as a shared memory.
[0204] In some embodiments of the present application, the configuration data of the first animation effect and the configuration data of the second animation effect are both identified as configuration data corresponding to the first window, or the configuration data of the first animation effect and the configuration data of the second animation effect are both identified as configuration data of the layer corresponding to the first window, where the layer corresponding to the first window is the layer created by the first service.
[0205] In some embodiments of the present application, the configuration data of each animation effect is used to indicate the attribute characteristics of the layer or window carrying the animation effect, and the attribute characteristics may include at least one of the following: position, size, rotation angle, rounded corners, and transparency.
[0206] In one example, the configuration data of the first animation effect may be the configuration data of the exit application window animation effect described in the aforementioned embodiment, and the configuration data of the second animation effect may be the configuration data of the desktop page turning animation effect described in the aforementioned embodiment.
[0207] S1303: The electronic device applies the configuration data of the first animation effect and the configuration data of the second animation effect to the first window through the second service.
[0208] In some embodiments of the present application, the electronic device applies the configuration data of the first animation effect and the configuration data of the second animation effect to the first window through the second service. Specifically, the electronic device applies the configuration data of the first animation effect and the configuration data of the second animation effect to the layer corresponding to the first window through the second service, and synthesizes and displays the animation interface according to the obtained layer.
[0209] In some embodiments of the present application, the electronic device can also efficiently execute the following manual effect based on the shared memory. Taking the electronic device executing the following manual effect of translating the application window according to the user operation as an example, the execution process of the following manual effect may include: the electronic device can control the display of the second window through the second application in response to the received second operation; wherein the second operation is used to indicate the display of the second window. After displaying the second window, the electronic device can determine the configuration data of the following manual effect according to the third operation through the second application in response to the received third operation; wherein the third operation is used to indicate the execution of the following manual effect on the second window, and the following manual effect is the dynamic effect of translating the window according to the third operation. After the electronic device determines the configuration data of the following manual effect, it can send the configuration data of the following manual effect to the shared memory through the second application, and then obtain the configuration data of the following manual effect from the shared memory through the second service, and apply the configuration data of the following manual effect to the second window.
[0210] In an example, the first service may be a window management service WMS, and the second service may be a graphics framework service SF.
[0211] In some embodiments of the present application, the shared memory may be the buffer queue described in the aforementioned embodiments.
[0212] During the execution of the above-mentioned hand-following effect, the second window may also be replaced by objects such as icons, controls, or content selected by the user.
[0213] The specific implementation methods corresponding to the above methods can refer to the introduction of the relevant methods in the above embodiments, which will not be repeated here.
[0214] Based on the above embodiments and the same technical concept, the embodiments of the present application also provide an electronic device that can be used to implement the display method provided in the embodiments of the present application. As shown in Figure 14, the electronic device 1400 may include: a display screen 1401, a memory 1402, one or more processors 1403, and one or more computer programs (not shown in the figure). The above-mentioned components can be coupled via one or more communication buses 1404.
[0215] The display screen 1401 is used to display application interfaces and other related user interfaces.
[0216] One or more computer programs (codes) are stored in the memory 1402, and the one or more computer programs include computer instructions; one or more processors 1403 call the computer instructions stored in the memory 1402, so that the electronic device 1400 executes the display method provided in the embodiment of the present application.
[0217] In a specific implementation, the memory 1402 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. The memory 1402 may store an operating system (hereinafter referred to as the system), such as an embedded operating system such as ANDROID, IOS, WINDOWS, or LINUX. The memory 1402 may be used to store the implementation program of the embodiment of the present application. The memory 1402 may also store a network communication program, which may be used to communicate with one or more additional devices, one or more user devices, or one or more network devices.
[0218] The one or more processors 1403 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.
[0219] It should be noted that FIG14 is only one implementation of the electronic device 1400 provided in an embodiment of the present application. In actual applications, the electronic device 1400 may also include more or fewer components, which is not limited here.
[0220] Based on the above embodiments and the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a computer, the computer executes the method provided in the above embodiments.
[0221] Based on the above embodiments and the same technical concept, an embodiment of the present application further provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer executes the method provided in the above embodiments.
[0222] The methods provided in the embodiments of the present application may be implemented in whole or in part through software, hardware, firmware, or any combination thereof. When implemented using software, they may be implemented in whole or in part in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. A computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs), or semiconductor media (e.g., SSDs), etc.
[0223] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
Claims
1. A display method, applied to an electronic device, characterized in that: The method comprises: When displaying a first motion effect, receiving a first operation, the first operation being used to instruct to display a second motion effect; wherein the first motion effect is a window motion effect of the first window, and the second motion effect is a view motion effect within the first application; In response to the first operation, the configuration data of the first motion effect is sent to the second service through the first service, and the configuration data of the second motion effect is determined according to the first operation through the first application, and the configuration data of the second motion effect is passed to the second service through the first application; The configuration data of the first animation effect and the configuration data of the second animation effect are applied to the first window through the second service.
2. The method according to claim 1, characterized in that The applying the configuration data of the first motion effect and the configuration data of the second motion effect to the first window through the second service includes: The configuration data of the first motion effect and the configuration data of the second motion effect are applied to the layer corresponding to the first window through the second service, and the motion effect interface is synthesized and displayed according to the obtained layer.
3. The method according to claim 1 or 2, characterized in that The transmitting the configuration data of the second animation effect to the second service through the first application includes: Sending the configuration data of the second animation effect to a buffer queue through the first application; The configuration data of the second animation effect is obtained from the buffer queue through the second service.
4. The method according to any one of claims 1 to 3, characterized in that: The first service is a window management service WMS, and the second service is a graphic framework service SF.
5. The method according to any one of claims 1 to 4, characterized in that: The configuration data of the first motion effect and the configuration data of the second motion effect are both identified as configuration data corresponding to the first window.
6. The method according to any one of claims 1 to 5, characterized in that: The configuration data of any animation effect is used to indicate the attribute characteristics of the layer or window carrying the animation effect, and the attribute characteristics include at least one of the following: position, size, rotation angle, rounded corners, and transparency.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to the received second operation, controlling display of the second window through the second application; wherein the second operation is used to instruct display of the second window; In response to the received third operation, determining, by the second application, configuration data of the tracking effect according to the third operation; wherein the third operation is used to instruct to execute the tracking effect on the second window; Sending the configuration data of the tracking effect to the shared memory through the second application; Acquire the configuration data of the tracking effect from the shared memory through the second service; The configuration data of the tracking effect is applied to the second window through the second service.
8. The method according to claim 7, characterized in that The shared memory is a buffer queue.
9. An electronic device, characterized in that: The electronic device includes a display screen, a memory and one or more processors; The memory is used to store computer program codes, and the computer program codes include computer instructions; when the computer instructions are executed by the one or more processors, the electronic device executes the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.
11. A computer program product, characterized in that The computer program product comprises a computer program or instructions. When the computer program or instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Interactive interface display method and device and storage medium
CN109976861A
Interface processing method and device, storage medium and terminal
CN112732143A
Display method and electronic equipment
CN114443194A
Display method and electronic equipment
CN115480833A
View drawing method and device and storage medium
CN115705668A
