Animation control method, electronic device, chip system, storage medium and program product
By defining animation units to control the animation of multiple windows in parallel, the problem of low flexibility when playing animations on electronic devices is solved, achieving smoother and more efficient animation control and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2026-03-27
AI Technical Summary
When electronic devices play animations, there is a problem with the inability to control the playback and pause of the animations, resulting in low flexibility and affecting the user experience.
By defining animation units, the animations of multiple windows can be distinguished and controlled, enabling parallel playback and control. This includes animation identifiers, control commands, the window or layer to which the animation belongs, and animation parameters. Commands are used to control the playback and pause of the animation. Animation parameters are pre-calculated and stored in the window compositor, reducing the real-time computing burden.
It improves the flexibility and smoothness of animation playback on electronic devices, enhances the user experience, reduces system resource consumption, and achieves animation continuity and efficient control.
Smart Images

Figure CN121742733A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, and in particular, to an animation control method, an electronic device, a chip system, a storage medium and a program product. BACKGROUND
[0002] When opening or closing an application, an electronic device can add an animation effect, so that the interface is displayed more smoothly and naturally when changing or switching.
[0003] When playing an animation, some electronic devices can calculate the animation parameters of each frame of the animation, and then send the animation parameters of each frame to a surface flinger (SF) at one time.
[0004] However, in some scenarios, when playing an animation, an electronic device can have the problem of being unable to control the playing and pausing of the animation, resulting in low flexibility. SUMMARY
[0005] The embodiments of the present application provide an animation control method, an electronic device, a chip system, a storage medium and a program product, which are applied to the technical field of terminal and can realize parallel playing and controlling of animations of multiple windows and improve user experience.
[0006] In a first aspect, an embodiment of the present application provides an animation control method. The method comprises: in response to a first operation of triggering starting of a first application, playing a first starting animation of the first application; during playing of the first starting animation, receiving a second operation of triggering starting of a second application; in response to the second operation, continuously playing the first starting animation and playing a second starting animation of the second application, wherein the second starting animation is in an upper layer of the first starting animation. In this way, an electronic device can play animations of multiple windows in parallel, improve the flexibility of playing animations of the electronic device, and improve user experience.
[0007] In combination with the first aspect, in some implementations of the first aspect, before playing the first starting animation of the first application, the method further comprises: calculating first animation parameters of the first starting animation, the first animation parameters comprising one or more animation parameters used for playing the first starting animation. Playing the first starting animation of the first application comprises: playing the first starting animation of the first application based on first information, wherein the first information comprises a first animation identifier, the first animation parameters and a first instruction, and the first instruction is used to instruct to play the first starting animation. In this way, the electronic device can control the playing of the first starting animation, and the flexibility of animation control is improved. Moreover, the first parameters are calculated in advance before playing the animation, which can reduce the burden of real-time calculation, improve the smoothness of animation playing, and improve user experience.
[0008] In some implementations of the first aspect, based on the first information, before playing the first start animation of the first application, the method further includes: based on the second instruction, locally saving the second information, the second information including the first animation identifier and second animation parameters, the second animation parameters being the same as or different from the first animation parameters. Based on the first information, playing the first start animation of the first application includes: based on the first instruction, searching the locally saved second animation parameters according to the first animation identifier; updating the locally saved second animation parameters based on the first animation parameters, and playing the first start animation based on the first animation parameters. In this way, the second animation parameters locally saved by the window compositor can be updated based on the first animation parameters, so that the electronic device can update the animation being played during the playing of the animation, which can improve the flexibility of the electronic device in playing the animation and improve the user experience.
[0009] In some implementations of the first aspect, the second instruction further includes a sub-instruction, and based on the sub-instruction, the first animation identifier and the animation parameters of the locally saved first start animation are retained after the first start animation is played. In this way, the window compositor can retain the first animation identifier and the animation parameters of the locally saved first start animation after the animation is played, which can also be understood as not automatically deleting the local animation unit described above, thereby reducing the process of recalculating the animation parameters when the animation is played repeatedly, and improving the efficiency of playing the animation.
[0010] In some implementations of the first aspect, in response to the second operation, continuously playing the first start animation further includes: in response to the second operation, calculating third animation parameters of the first start animation, the third animation parameters being different from the first animation parameters; based on a third instruction, searching the locally saved animation parameters of the first start animation according to the first animation identifier; updating the third animation parameters to the locally saved animation parameters of the first start animation, and playing the first start animation based on the third animation parameters. In this way, the electronic device can quickly respond and adjust the animation parameters and the playing of the animation in the case of frequent user operations, which can improve the flexibility of the electronic device in playing the animation and improve the user experience.
[0011] In some implementations of the first aspect, before calculating the third animation parameters of the first start animation, the method further includes: based on a fourth instruction, obtaining a playing progress of the first start animation; and calculating the third animation parameters of the first start animation includes: based on the playing progress of the first start animation, calculating the third animation parameters of the first start animation. In this way, the electronic device can adjust the animation parameters according to the playing progress of the current animation, which can update the animation parameters without recalculating all the animation parameters, thereby saving system resources and improving the flexibility of the animation control and the user experience.
[0012] With reference to the first aspect, in some implementations of the first aspect, the animation control method further includes: during playing of the second start animation, receiving a third operation triggering exit of the second application; in response to the third operation, stopping playing of the second start animation and playing a third exit animation of the second application. In this way, the electronic device can stop the currently playing animation and play the corresponding exit animation when receiving the triggering exit operation, which can improve the continuity of animation playing and improve the user experience.
[0013] With reference to the first aspect, in some implementations of the first aspect, in response to the third operation, stopping playing of the second start animation and playing a third exit animation of the second application includes: in response to the third operation, stopping playing of the second start animation based on the fifth instruction, and playing the third exit animation of the second application based on the first instruction. In this way, the electronic device can stop the start animation of the application based on the fifth instruction and play the exit animation based on the first instruction when receiving the operation triggering exit of the application, which can improve the continuity of animation playing, improve the flexibility of animation control, and enhance the user experience.
[0014] With reference to the first aspect, in some implementations of the first aspect, in response to the third operation, stopping playing of the second start animation and playing a third exit animation of the second application includes: in response to the third operation, calculating a fourth animation parameter of the third exit animation, the fourth animation parameter including one or more frames of animation parameters for playing the third exit animation; based on the third instruction, searching for the animation parameters of the second start animation saved locally according to the second animation identifier; updating the fourth animation parameter into the animation parameters of the second start animation saved locally, and playing the third exit animation based on the fourth animation parameter. In this way, the electronic device can update the playing animation through the third instruction, improve the smoothness of animation playing, improve the flexibility of animation control, and enhance the user experience.
[0015] With reference to the first aspect, in some implementations of the first aspect, the animation control method further includes: deleting the related information of the first start animation saved locally based on a sixth instruction related to the first start animation. In this way, the electronic device can delete the related information of the locally saved animation through the sixth instruction, reduce the processing burden of the electronic device, and save memory resources.
[0016] With reference to the first aspect, in some implementations of the first aspect, the first animation parameter includes one or more of the following: a position of an animation window, a size of the animation window, a scaling matrix of the animation, a rotation matrix of the animation, a transparency of the animation, and a color of the animation. By calculating the position, size, scaling matrix, rotation matrix, transparency, and color of the animation window, the accuracy and flexibility of animation playing and control of the electronic device can be improved, and the user experience can be improved.
[0017] With reference to the first aspect, in some implementations of the first aspect, the first instruction comprises a START instruction, the second instruction comprises a CREAT instruction, the third instruction comprises an UPDATE instruction, the fourth instruction comprises a QUERY instruction, the fifth instruction comprises a CANCEL instruction, and the sixth instruction comprises a DELETE instruction. Based on the first instruction, the second instruction, the third instruction, the fourth instruction, the fifth instruction, and the sixth instruction, the animation of the multiple windows can be played and controlled in parallel, the accuracy and flexibility of the animation control can be improved, the animation switching process can be smoother, and the user experience can be enhanced.
[0018] In a second aspect, an embodiment of the present application provides an animation control apparatus. The animation control apparatus can be an electronic device, or a chip or chip system in the electronic device. The animation control apparatus can include a processing unit. The processing unit can be a processor. The apparatus can further include a storage unit. The storage unit can be a memory. The storage unit is configured to store instructions. The processing unit is configured to execute the instructions stored in the storage unit, so that the electronic device implements an animation control method described in the first aspect or any possible implementation manner of the first aspect. When the apparatus is a chip or chip system in the electronic device, the processing unit can be a processor. The processing unit is configured to execute the instructions stored in the storage unit, so that the electronic device implements an animation control method described in the first aspect or any possible implementation manner of the first aspect. The storage unit can be a storage unit (for example, a register, a cache, etc.) in the chip, or a storage unit (for example, a read-only memory, a random access memory, etc.) in the electronic device and located outside the chip.
[0019] In a third aspect, an embodiment of the present application provides an electronic device. The electronic device includes a processor and a memory. The memory is configured to store code instructions. The processor is configured to execute the code instructions to perform the method described in the first aspect or any possible implementation manner of the first aspect.
[0020] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program or instructions. When the computer program or instructions are executed on a computer, the computer is caused to perform the method described in the first aspect or any possible implementation manner of the first aspect.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program is executed on a computer, the computer is caused to perform the method described in the first aspect or any possible implementation manner of the first aspect.
[0022] In a sixth aspect, the present application provides a chip or a chip system, which comprises at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is configured to run a computer program or an instruction to execute the method described in the first aspect or any possible implementation manner of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0023] In a possible implementation, the chip or the chip system described in the present application further comprises at least one memory, and the at least one memory stores the instruction. The memory can be a storage unit inside the chip, for example, a register, a cache, etc., or a storage unit of the chip (for example, a read-only memory, a random access memory, etc.).
[0024] It should be understood that the second aspect to the sixth aspect of the present application correspond to the technical solution of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding possible implementation manner are similar, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0025] Figure 1 A schematic diagram of a start-up animation of an application program is shown;
[0026] Figure 2 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown;
[0027] Figure 3 A software structural schematic diagram of an electronic device provided by an embodiment of the present application is shown;
[0028] Figure 4 A schematic diagram of animation control of scenario one provided by an embodiment of the present application is shown;
[0029] Figure 5 A flowchart of a first animation control method provided by an embodiment of the present application is shown;
[0030] Figure 6 A schematic diagram of animation control of scenario two provided by an embodiment of the present application is shown;
[0031] Figure 7 A flowchart of a second animation control method provided by an embodiment of the present application is shown;
[0032] Figure 8 A schematic diagram of animation control of scenario three provided by an embodiment of the present application is shown;
[0033] Figure 9 A flowchart of a third animation control method provided by an embodiment of the present application is shown;
[0034] Figure 10A flowchart of a fourth animation control method provided by an embodiment of the present application is shown in FIG. 4.
[0035] Figure 11 A flowchart of a fifth animation control method provided by an embodiment of the present application is shown in FIG. 5.
[0036] Figure 12 A structure diagram of a chip provided by an embodiment of the present application is shown in FIG. 6. DETAILED DESCRIPTION
[0037] To clearly describe the technical solutions of the embodiments of the present application, the following briefly introduces some terms and technologies involved in the embodiments of the present application:
[0038] 1. Window: refers to a visual area of an application on a display screen of an electronic device, which can be used for interaction with a user. The visual area can occupy the entire display screen in a full-screen manner, or occupy part of the display screen in the form of a small window. Illustratively, in response to a user's operation of opening an application, the display screen of the electronic device can display a window of the application.
[0039] 2. Terms
[0040] In the embodiments of the present application, the terms "first", "second", and the like are used to distinguish the same or similar items with basically the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and do not limit the sequence. Those skilled in the art can understand that the terms "first", "second", and the like do not limit the quantity and execution sequence, and the terms "first", "second", and the like do not necessarily mean different.
[0041] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design solution described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or having more advantages than other embodiments or design solutions. Rather, the words "exemplary" or "for example" are used in the sense of presenting a specific example or instance.
[0042] In the embodiments of this application, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
[0043] 3. Electronic device
[0044] The electronic device of the embodiments of this application can also be any form of terminal device. For example, the electronic device can include a mobile phone, a tablet computer, a palm computer, a notebook computer, a mobile Internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, an electronic device in a 5G network, or an electronic device in a future evolved public land mobile network (PLMN), etc. The embodiments of this application are not limited in this regard.
[0045] As an example but not limitation, in the embodiments of the present application, the electronic device can also be a wearable device. The wearable device can also be referred to as a wearable smart device, which is a general term for devices that are designed and developed by applying wearable technology to daily wear, such as glasses, gloves, watches, clothing, and shoes. The wearable device is a portable device that can be directly worn on the body or integrated into the user's clothes or accessories. The wearable device is not only a hardware device, but also a powerful function achieved through software support and data interaction, cloud interaction. The general wearable smart device includes a full function, large size, and can realize complete or partial functions without relying on a smart phone, such as a smart watch or smart glasses, and focuses on a certain application function, and needs to cooperate with other devices such as a smart phone, such as various smart wristbands, smart jewelry, and the like.
[0046] In addition, in the embodiments of the present application, the electronic device can also be an electronic device in an Internet of Things (IoT) system. The IoT is an important part of the future information technology development, and its main technical feature is to connect objects through communication technology and network, so as to realize the intelligent network of man-machine interconnection and object-object interconnection.
[0047] The electronic device in the embodiments of the present application can also be referred to as a user equipment (UE), a mobile station (MS), a mobile terminal (MT), an access terminal, a subscriber unit, a subscriber station, a mobile station, a mobile terminal, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent, or a user device, etc.
[0048] In the embodiments of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes a central processing unit (CPU), a memory management unit (MMU), and a memory (also referred to as a main memory), etc. The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system, etc. The application layer includes a browser, an address book, a word processing software, an instant messaging software, etc.
[0049] The electronic device can complete the connection between different interfaces in the interface switching process of the electronic device in the form of playing an animation, so that the interface conversion process becomes smooth and natural. For example, the electronic device can play a start-up animation or a closing animation in a window when opening or closing an application, and the start-up animation or the closing animation can realize the transition of the application between the start-up icon and the full-screen display application window.
[0050] Exemplarily, Figure 1 A schematic diagram of a start-up animation of an application is shown, taking an information application as an example. As Figure 1 shown, when the user clicks the information application in interface A, the electronic device can complete the transition of the information application from the start-up icon to the full-screen display information application window by playing the frames of the start-up animation of the information application in the window in quick succession in response to the user's click operation on the start-up icon of the information application. For example, Figure 1 The four frames of the window corresponding to interface B, interface C, interface D and interface E in
[0051] It can be understood that if the electronic device directly displays the corresponding window interface in interface E of Figure 1 on the display screen, the user will feel that the interface conversion is harsh and abrupt in vision, and lacks coherence.
[0052] In an implementation manner, the electronic device can calculate the corresponding animation parameters in real time when each frame is to be played by an animation initiator, such as a desktop launcher, during the process of playing the animation in the window, and send the animation parameters to the window compositor for composition and display. However, since the image of each frame needs to calculate the animation parameters in real time and transmit them to the window compositor, when the animation frame rate is high or the system resources of the electronic device are insufficient, the animation parameters may be delayed in the calculation or transmission process, resulting in the phenomenon of image loss and interface freezing during the process of playing the animation, which affects the user experience.
[0053] Exemplarily, as Figure 1 shown in the process of playing the start-up animation of the information application, if the system resources of the electronic device are insufficient during the calculation or transmission of the C frame image, the start-up animation may not be played or the C frame image may be delayed, causing the phenomenon of freezing or frame loss during the process of playing the start-up animation, resulting in unsmooth animation playing and affecting the user experience.
[0054] In another implementation, before playing the animation in a window, the electronic device can pre-calculate the animation parameters for each frame of the animation to be played and send them all at once to the window compositor. After receiving the animation parameters for each frame, the window compositor composites the animation parameters frame by frame and displays them on the screen, thereby enabling the animation to play.
[0055] However, since the animation parameters for each frame are calculated before the animation is played, the animation initiator may not be able to adjust the animation parameters immediately during the animation playback, resulting in low flexibility for electronic devices to play animations.
[0056] To address the aforementioned technical problems, this application provides an animation control method that can create corresponding animation units based on the animation parameters of each frame of the animation, thereby distinguishing and controlling the animations of multiple windows. It can also control the playback and pause of the animations of these multiple windows through control commands, enabling parallel playback and control of the animations of multiple windows, improving the flexibility of electronic devices in the animation playback process, and enhancing the user experience.
[0057] Figure 2 This is a schematic diagram of the structure of the electronic device 200 provided in an embodiment of this application. Figure 2 As shown, the electronic device 200 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (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, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0058] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 200. In other embodiments of this application, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0059] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP) and a coprocessor (CP), etc. The application processor includes an application program framework layer, a hardware abstraction layer, a kernel layer, etc. of a software architecture adopted by the electronic device 200; the coprocessor includes a sensor hub, etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors. Optionally, the processor 110 can be used to calculate the animation parameters of each frame of the animation.
[0060] In some embodiments, the electronic device 200 can include 1 or N display screens 194, N being a positive integer greater than 1. After the window compositor composites the image of each frame based on the animation parameters of each frame, the 1 or N display screens 194 can be used to display the image of each frame of the animation, and the animation effect can be achieved by playing the images of multiple frames quickly and continuously on the display screen.
[0061] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, at least one application program required by a function, etc. The data storage area can store data created during the use of the electronic device, etc. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), etc. The processor 110 executes various function applications and data processing of the electronic device by running the instructions stored in the internal memory 121 and / or the instructions stored in the memory arranged in the processor.
[0062] For example, in the embodiment of the present application, the internal memory 121 can be used to store an animation unit, and when a certain animation is played repeatedly, the animation parameters do not need to be calculated again, but the animation unit stored in the internal memory 121 is reused, which saves the system resources of the electronic device and improves the animation playing efficiency.
[0063] It should be understood that Figure 2 It should be understood that
[0064] Figure 3FIG. 1 is a schematic diagram of a software structure of an electronic device 200 according to an embodiment of the present application. As shown in FIG. 1, the layered architecture divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer. Figure 3
[0065] The application layer can include a series of application packages. As shown in FIG. 2, the application package can include applications such as information, desktop launcher, etc. Figure 3
[0066] The desktop launcher can calculate the animation parameters of the to-be-played animation of each window. Alternatively, in response to a user triggering operation on the application A, the desktop launcher can calculate the animation parameters of the start-up animation of the application A based on the triggering operation.
[0067] The application framework layer can also be referred to as the Framework layer, which can provide application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The Framework layer can include some pre-defined functions.
[0068] As shown in FIG. 3, the Framework layer can include a window manager, a window compositor, an activity manager, a resource manager, a notification manager, etc. Figure 3
[0069] In an embodiment of the present application, the window manager can be responsible for the management of the window program. The window manager can obtain the size of the display screen, determine whether there is a status bar, a lock screen, a touch screen, a drag screen, a screen capture, etc. For example, in an embodiment of the present application, the window manager can be used to obtain a user triggering operation on an application, etc.
[0070] The window compositor can generate a corresponding image based on the animation parameters of each frame of the to-be-played animation and display it on the display screen after receiving the animation unit of the to-be-played animation.
[0071] The specific window manager, window compositor, activity manager, resource manager, and notification manager, etc. can refer to related technologies, which will not be described here.
[0072] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for the control and management of the Android system.
[0073] The core library includes two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
[0074] The application layer and the framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the framework layer into binary files. The virtual machine is used to execute the functions of object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0075] The system library can also be called the native layer, and the native layer can include multiple function modules. For example: media library, function library, graphics processing library (such as OpenGL ES), etc.
[0076] The HAL is an abstract layer structure between the kernel layer and the Android runtime. The hardware abstraction layer can be a package of hardware drivers, and provides a unified interface for the call of the upper layer application.
[0077] The kernel layer is the layer between hardware and software. The kernel layer can include display driver, camera driver, audio driver, battery driver, Bluetooth driver, CPU driver, USB driver, etc.
[0078] It should be noted that the embodiments of the present application are only exemplified by the Android system. In other operating systems (such as Windows system, real time operating system (RTOS), IOS system, etc.), as long as the functions of each function module are similar to the embodiments of the present application, the scheme of the present application can also be realized.
[0079] The method of the embodiments of the present application will be described in detail through specific embodiments. The following embodiments can be combined or implemented independently, and the same or similar concepts or processes can not be described in detail in some embodiments.
[0080] As can be known from the above embodiments, the electronic device can distinguish and manage multiple animations by defining animation units, wherein the animation unit can include one or more of animation identifier, control instruction, belonging window or layer, and animation parameter.
[0081] The animation identifier can be used to uniquely identify an animation, so that the electronic device can distinguish multiple animations. The multiple animations can be multiple animations of one window, or multiple animations of different windows. The window or layer to which the animation identifier belongs can indicate the window to which the animation is applied, so as to ensure that the animation parameters can be correctly applied to the corresponding window or layer. Optionally, the animation identifier can be represented by a number, or can be a string or other data type, which is not limited here.
[0082] Optionally, the animation parameters can be used to indicate the parameter information of each frame image in the animation. The parameter information of each frame image can include one or more of the position, size, scaling matrix, rotation matrix, transparency, color, and other attributes of the frame image. The window compositor reads the animation parameters frame by frame, composes and displays the parameter information in the animation parameters, and the electronic device can play the animation.
[0083] The position can be used to indicate the specific coordinates of each frame image in the animation on the screen. For example, in the case of taking the upper left corner of the screen of the electronic device as the origin of the coordinate system, the coordinates of the lower left corner of the image can be used as the position attribute of the image.
[0084] The size can be used to indicate the width and height of each frame image displayed on the screen, which can be represented in pixels.
[0085] The scaling matrix can be used to indicate the scaling ratio of the size of the transformed image.
[0086] The rotation matrix can be used to indicate the rotation angle of the image. For example, the rotation angle can indicate the angle of rotation of the image around a certain point.
[0087] The transparency can be used to indicate the transparency of the image.
[0088] The color can be used to represent the color attribute of the image.
[0089] In the embodiments of the present application, the control instruction can be used to control the play, pause, and other operations of the window animation corresponding to the animation unit. For example, the control instruction can include a creation instruction, a start instruction, a query instruction, an update instruction, a cancellation instruction, and a deletion instruction. The creation instruction can also be referred to as a CREAT instruction, the start instruction can also be referred to as a START instruction, the query instruction can also be referred to as a QUERY instruction, the update instruction can also be referred to as an UPDATE instruction, the cancellation instruction can also be referred to as a CANCEL instruction, and the deletion instruction can also be referred to as a DELETE instruction.
[0090] Exemplarily, for the creation instruction, after the desktop launcher calculates the animation parameters corresponding to the animation, the desktop launcher can send the related information of the animation unit to the window compositor, where the related information of the animation unit can include an animation identifier, a window or layer to which the animation unit belongs, the creation instruction, and the animation parameters, etc. After receiving the creation instruction, the window compositor can establish the animation unit based on the animation identifier and the window or layer to which the animation unit belongs in the local storage space, and save the animation parameters in the animation unit.
[0091] The local storage space can occupy a part of the storage space in the memory of the electronic device, and be used to store the animation units established by the window compositor. Therefore, the animation unit established by the window compositor can also be referred to as a local animation unit.
[0092] For the start instruction, after the desktop launcher calculates the animation parameters corresponding to the animation, the desktop launcher can send the related information of the animation unit to the window compositor, where the related information of the animation unit can include an animation identifier, a window or layer to which the animation unit belongs, the start instruction, and the animation parameters, etc. After receiving the start instruction, the window compositor can first search the local storage space based on the animation identifier to determine whether a corresponding local animation unit exists in the local storage space. In the case that the corresponding animation unit exists in the local storage space, the window compositor can fuse the animation parameters into the existing local animation unit, and start playing in the next frame.
[0093] For the query instruction, the desktop launcher can send the animation identifier and the query instruction to the window compositor. After receiving the query instruction, the window compositor can obtain the playing progress of the corresponding animation unit based on the animation identifier, where the playing progress can include the animation parameters corresponding to the currently played frame.
[0094] For the update instruction, the desktop launcher can update the playing animation through the update instruction. For example, after the desktop launcher calculates the new animation parameters of the animation to be updated, the desktop launcher can send the related information of the animation unit to the window compositor, where the related information of the animation unit can include an animation identifier, an update instruction, and the new animation parameters, etc. After receiving the update instruction, the window compositor can first search the local animation unit of the animation to be updated based on the animation identifier, and then fuse the new animation parameters with the existing animation parameters in the animation unit to update the local animation unit, so that the window compositor can play the image corresponding to the updated local animation unit in the next frame.
[0095] Exemplarily, in some scenarios, the desktop launcher can need to make the playing animation more transparent, then the desktop launcher can calculate the new animation parameter of the transparency, and then send the corresponding animation identifier, update instruction and new animation parameter of the transparency to the window compositor. After receiving the update instruction, the window compositor can first search for the local animation unit of the animation to be updated according to the animation identifier, and after finding the corresponding local animation unit, the window compositor fuses the new animation parameter of the transparency with the existing animation parameter in the local animation unit to update the transparency in the local animation unit, so that the window compositor makes the image more transparent when playing the next frame of image.
[0096] For the cancel instruction, the desktop launcher can send the animation identifier of the animation to be stopped and the cancel instruction to the window compositor, and the window compositor stops playing the corresponding local animation unit based on the animation identifier after receiving the cancel instruction.
[0097] For the delete instruction, the desktop launcher can send the animation identifier of the animation to be deleted and the delete instruction to the window compositor, and the window compositor can delete the corresponding local animation unit based on the animation identifier after receiving the delete instruction. Exemplarily, after the desktop launcher determines that a certain animation is no longer needed to be played, the desktop launcher can send the animation identifier of the animation to be deleted and the delete instruction to the window compositor, and the window compositor can delete the corresponding local animation unit after receiving the corresponding delete instruction, so as to release the system resources occupied by the animation unit and improve the system performance.
[0098] It can be known from the above embodiments that the electronic device can realize the playing and pausing control of multiple window animations by defining the animation unit. The playing and pausing control process of the electronic device on the animations of multiple windows can be different in different scenarios. In order to facilitate understanding, the scenarios that can exist in the animation playing process of the electronic device are introduced as follows.
[0099] Scenario one: in the process of playing the start animation in the window of application A, the user triggers the operation of exiting application A, wherein the start animation can also be referred to as the zoom-in animation.
[0100] Exemplarily, Figure 4 The schematic diagram of the animation control of scenario one provided by the embodiments of the present application is shown in FIG. 1. Figure 4 As shown in FIG. 1, Figure 4 The interfaces A, B and C in FIG. 1 are schematic diagrams of three frames of images in the zoom-in animation playing process of application A. When the zoom-in animation is played to the image shown in interface C, in response to the operation of the user interrupting the playing of the zoom-in animation, the electronic device can play the zoom-out animation shown in interfaces D, E and F. It can be understood that the electronic device can make the user feel the fluency of the system operation process by playing the zoom-out animation, thereby improving the user experience.
[0101] For ease of understanding, the following takes the animation initiator as the desktop launcher, and the window animation as the zoom-in animation of application A as an example, introduces the process of the electronic device playing the zoom-out animation in the scenario that the user interrupts the zoom-in animation while the zoom-in animation is being played, from the perspective of the interaction between the desktop launcher and the window compositor. Specifically as follows. Figure 5 The process of the electronic device playing the zoom-out animation in the scenario that the user interrupts the zoom-in animation while the zoom-in animation is being played is introduced from the perspective of the interaction between the desktop launcher and the window compositor. Specifically as follows.
[0102] Figure 5 A flowchart of an animation control method 500 provided for an embodiment of the present application. The animation control method 500 can be executed by an electronic device, the hardware structure of the electronic device can be as shown in Figure 2 , and the software structure can be as shown in Figure 3 . As shown in Figure 5 , the method 500 includes the following steps:
[0103] S501, in response to the operation of the user clicking the application A icon, the desktop launcher calculates the animation parameters of the zoom-in animation.
[0104] The zoom-in animation can be the start-up animation of the information application program as shown in Figure 1 , in which the window gradually increases during the playing process.
[0105] Optionally, the animation parameters can include one or more combinations of the position, size, scaling matrix, rotation matrix, transparency, color, etc. of the image in each frame of the zoom-in animation.
[0106] S502, the desktop launcher sends the related information of the animation unit of the zoom-in animation to the window compositor.
[0107] The related information of the animation unit of the zoom-in animation can include the animation identifier of the zoom-in animation, the window or layer to which it belongs, the animation parameters, and the initial instruction, etc. The initial instruction can be a creation instruction or a start-up instruction, in which the creation instruction and the start-up instruction can be as described above, and will not be described here again.
[0108] Optionally, in the case that the animation unit corresponding to the zoom-in animation does not exist in the local storage space of the window compositor, the desktop launcher can send a creation instruction to the window compositor, so that the window compositor creates the animation unit corresponding to the zoom-in animation based on the animation identifier of the zoom-in animation, the window or layer to which it belongs, and the animation parameters after receiving the creation instruction.
[0109] In the case that the animation unit corresponding to the zoom-in animation exists in the window compositor, the desktop launcher can send a start-up instruction to the window compositor, so that the window compositor finds the local animation unit based on the animation identifier of the zoom-in animation after receiving the start-up instruction, and fuses the animation parameters of the zoom-in animation into the local animation unit corresponding to the zoom-in animation.
[0110] In some scenarios, the desktop launcher can calculate the animation parameters in advance and preset to the window compositor after the electronic device is powered on or when the electronic device is idle. After the user clicks the icon of application A, the desktop launcher can send an initial instruction to the window compositor to improve the animation playing efficiency and reduce the possibility of the electronic device freezing during the animation playing process, thereby improving the user experience.
[0111] S503, after the window compositor receives the related information of the animation unit of the zoom-in animation, the window compositor plays the zoom-in animation.
[0112] It should be understood that after the window compositor receives the related information of the animation unit of the zoom-in animation, the window compositor can create a local animation unit for the zoom-in animation based on the type of the initial instruction, or update the existing local animation unit of the zoom-in animation.
[0113] Optionally, in the case where the initial instruction is a creation instruction, the window compositor can create a local animation unit for the zoom-in animation based on the animation identifier of the zoom-in animation and the window or layer to which the zoom-in animation belongs, and save the animation parameters in the local animation unit of the zoom-in animation.
[0114] It should be understood that in the case where the initial instruction is a creation instruction, when the desktop launcher needs to play the zoom-in animation, the desktop launcher can send a start instruction to the window compositor to make the window compositor play the zoom-in animation based on the created local animation unit.
[0115] Alternatively, in the case where the initial instruction is a start instruction, the window compositor can find the local animation unit based on the animation identifier of the zoom-in animation, and fuse the animation parameters of the zoom-in animation into the local animation unit to obtain an updated local animation unit. Moreover, the window compositor can start playing the updated local animation unit in the next frame of the animation playing.
[0116] S504, during the playing of the zoom-in animation of application A, in response to the user interrupting the playing of the zoom-in animation, the desktop launcher calculates the animation parameters of the zoom-out animation.
[0117] It can be understood that when the zoom-in animation is played to the image displayed in interface C as shown in FIG. 6B, if the user interrupts the playing of the zoom-in animation at this time, in response to the user interrupting the playing of the zoom-in animation, the desktop launcher calculates the animation parameters of the zoom-out animation. Figure 4
[0118] Exemplarily, the desktop launcher can send a query instruction to the window compositor to obtain the playing progress of the current zoom-in animation. Optionally, the playing progress can be an animation parameter of a frame corresponding to the currently played zoom-in animation, for example, can be the position, size and other information of the current frame. When the desktop launcher obtains the animation parameter of the currently played frame, the animation parameter of the zoom-out animation is calculated based on the animation parameter of the currently played frame. In order to facilitate understanding, the process of the desktop launcher calculating the animation parameter of the zoom-out animation is introduced below.
[0119] It can be understood that the zoom-out animation can be an animation of shrinking from the image of the currently played frame to the icon of application A. Exemplarily, the desktop launcher can determine the total duration and total frame number of the zoom-out animation, and obtain the position and size of the currently played image based on the obtained animation parameter of the currently played frame, and obtain the position and size of the icon of application A. Then, the desktop launcher can calculate the position change amount of each frame based on the position of the currently played image and the position of the icon of application A, and calculate the size change amount of each frame of the image based on the size of the currently played image and the size of the icon of application A.
[0120] After the desktop launcher calculates the position change amount and size change amount of each frame of the zoom-out animation, the animation parameter of the zoom-out animation can be obtained based on the position change amount and size change amount of each frame of the image.
[0121] S505, the desktop launcher sends the related information of the animation unit of the zoom-out animation to the window compositor.
[0122] The related information of the animation unit of the zoom-out animation can include one or more of the animation identifier of the zoom-out animation, the window or layer to which it belongs, the animation parameter and the control instruction.
[0123] In an implementation manner, the control instruction can be used to make the window compositor playing the zoom-in animation play the zoom-out animation. Therefore, it can be understood that the process of making the window compositor playing the zoom-in animation play the zoom-out animation can be realized by the instruction of stopping playing the zoom-in animation and playing the zoom-out animation, that is, the control instruction can include the instruction of stopping playing the zoom-in animation and the instruction of playing the zoom-out animation.
[0124] The instruction of stopping playing the zoom-in animation can be a cancel instruction, and the instruction of playing the zoom-out animation can be a create instruction and / or a start instruction.
[0125] It can be understood that if the control instruction includes the cancel instruction, the desktop launcher can also send the animation identifier of the zoom-in animation to the window compositor, so that the window compositor, after receiving the cancel instruction, finds the local animation unit of the zoom-in animation based on the animation identifier of the zoom-in animation and stops playing the zoom-in animation.
[0126] If the control instruction comprises a creation instruction or a start instruction, the animation parameter corresponding to the creation instruction or the start instruction is the animation parameter of the zoom-out animation, and it can be understood that the animation parameter of the zoom-out animation calculated in S504 is the animation parameter of the zoom-out animation.
[0127] It should be noted that the creation instruction or the start instruction of the zoom-out animation can refer to the description of the creation instruction or the start instruction of the zoom-in animation, which will not be described here.
[0128] In another implementation, the process of causing the window compositor playing the zoom-in animation to play the zoom-out animation can be implemented by updating the animation parameter of the zoom-in animation, for example, the control instruction can be an update instruction. It can be understood that if the control instruction is an update instruction, the animation parameter can comprise a scaling matrix.
[0129] Illustratively, after obtaining the total number of frames of the zoom-out animation, the scaling ratio of each frame image can be calculated based on the size of the image of the currently played frame and the size of the application icon, and then the scaling matrix of each frame image of the zoom-out animation can be obtained based on the scaling ratio of each frame image, and the animation parameter of the zoom-in animation is updated to switch the zoom-in animation to the zoom-out animation.
[0130] S506, after receiving the related information of the animation unit of the zoom-out animation, the window compositor plays the zoom-out animation.
[0131] After the window compositor receives the related information of the animation unit of the zoom-out animation, if the control instruction comprises a cancel instruction and a creation instruction or a start instruction, the window compositor can stop playing the zoom-in animation based on the cancel instruction, and play the animation of the zoom-out animation based on the creation instruction or the start instruction.
[0132] It can be understood that after the window compositor stops playing the zoom-in animation based on the cancel instruction, a local animation unit playing the zoom-out animation can be created or started based on the creation instruction or the start instruction and the animation parameter of the zoom-out animation. It can be understood that the implementation of creating or starting the zoom-out animation is similar to the implementation of creating or starting the zoom-in animation in S503, which will not be described here.
[0133] Alternatively, if the control instruction is an update instruction, after receiving the update instruction, the window compositor finds the corresponding local animation unit based on the animation identifier, and fuses the animation parameter of the zoom-out animation with the existing animation parameter in the local animation unit to obtain an updated local animation unit.
[0134] It can be understood that, in the case that the control instruction is the cancel instruction and the creation instruction, or in the case that the control instruction is the cancel instruction and the start instruction, the window compositor can realize the playing of the shrinking animation by playing the animation parameters corresponding to the local animation unit of the shrinking animation in the next frame. Or, in the case that the control instruction is the update instruction, the window compositor can realize the playing of the shrinking animation by playing the updated animation parameters corresponding to the local animation unit.
[0135] For example, after the user triggers the operation of interrupting the zoom-in animation in the interface C as shown in Figure 5 , the desktop launcher can calculate the animation parameters of the zoom-out animation, and send the related information of the zoom-out animation to the window compositor, so that the window compositor can play the images of the zoom-out animation in sequence after the interruption triggering operation, as shown in the interface D, the interface E and the interface F as shown in Figure 5 .
[0136] In the embodiment of the present application, the method 500 can make the electronic device quickly switch and play a new animation in the case that the user interrupts the playing of the animation, improve the flexibility of animation control, and enhance the user experience.
[0137] Scenario two: after playing the start animation of the application A, the electronic device continues to play the initial animation of the application A.
[0138] The start animation can be a zoom-in animation as shown in Figure 1 , which is an animation in which the application A gradually zooms from an icon state to a full-screen state. The initial animation of the application A can be an animation played by the application A after the playing of the start animation, for example, an animation showing the logo and name of the application A, which is not limited herein.
[0139] For example, Figure 6 the schematic diagram of the animation control of scenario two provided in the embodiment of the present application is as shown in Figure 6 . If the application program started by the user is a browser, after the user clicks the browser icon in the interface A as shown in Figure 6 , the electronic device plays the zoom-in animation as shown in the interface B and the interface C as shown in Figure 6 . When the zoom-in animation is played to the interface D as shown in Figure 6 , the electronic device can play the initial animation.
[0140] The following describes how to make the window compositor control the playing or stopping of the zoom-in animation and the initial animation in the case that the start animation of the application A is played and the initial animation is continued to be played, so as to realize the control of multiple window animations by the electronic device, in combination with Figure 7 . Specifically as follows.
[0141] Figure 7A flowchart of an animation control method 700 is provided for an embodiment of the present application. The animation control method 700 can be executed by an electronic device, the hardware structure of which can be as shown in Figure 2 , and the software structure of which can be as shown in Figure 3 . As shown in Figure 7 , the method 700 includes the following steps:
[0142] S701, in response to the operation of the user clicking the application A icon, the desktop launcher calculates the animation parameters of the zoom-in animation.
[0143] S702, the desktop launcher sends the related information of the animation unit of the zoom-in animation to the window compositor.
[0144] S703, after the window compositor receives the related information of the animation unit of the zoom-in animation, the zoom-in animation is played.
[0145] It should be understood that the embodiments of S701-S703 are similar to the embodiments of S501-S503 described above, and specific reference can be made to the description above, which will not be repeated here.
[0146] S704, the desktop launcher calculates the animation parameters of the initial animation.
[0147] It can be understood that the animation parameters of the initial animation are similar to the animation parameters of the zoom-in animation, and can also include one or more combinations of the position, size, scaling matrix, rotation matrix, transparency, color, etc. of each frame image in each frame of the initial animation, which is not limited here.
[0148] S705, the desktop launcher sends the related information of the animation unit of the initial animation to the window compositor.
[0149] The related information of the animation unit of the initial animation can include one or more of the animation identifier of the initial animation, the window or layer to which it belongs, the animation parameters, and the control instruction.
[0150] Optionally, the control instruction can be used to make the window compositor playing the zoom-in animation play the initial animation. Therefore, it can be understood that the process of making the window compositor playing the zoom-in animation play the initial animation can be realized by the instruction of stopping playing the zoom-in animation and playing the initial animation, that is, the control instruction B can include the instruction for stopping the zoom-in animation from playing, and also can include the instruction for playing the initial animation.
[0151] The instruction for stopping the zoom-in animation from playing can be a cancel instruction, and the instruction for playing the initial animation can be a create instruction or a start instruction.
[0152] It should be noted that the animation parameter corresponding to the control instruction or the creation instruction or the start instruction can be an animation parameter of the initial animation. The creation instruction or the start instruction of the initial animation can refer to the description of the creation instruction or the start instruction of the zoom-in animation in S503, and details are not described herein.
[0153] S706, the window compositor plays the initial animation after receiving the related information of the animation unit of the initial animation.
[0154] After the window compositor receives the related information of the animation unit of the initial animation, the playing of the zoom-in animation can be stopped based on the cancel instruction, and then the initial animation can be played based on the creation instruction or the start instruction. It can be understood that after the window compositor stops playing the zoom-in animation based on the cancel instruction, the local animation unit for playing the initial animation can be created or started based on the creation instruction or the start instruction and the animation parameter of the initial animation. It can be understood that the implementation manner of creating or starting the initial animation is similar to the implementation manner of playing the zoom-in animation in S503, and details are not described herein.
[0155] Optionally, in order to make the switching between the zoom-in animation and the initial animation more natural and smooth, after the window compositor receives the cancel instruction for stopping the zoom-in animation, the window compositor can not immediately stop the playing of the zoom-in animation, but can continue to multicast several frames of images of the zoom-in animation, and gradually reduce the transparency of the zoom-in animation during the process of multicasting the several frames of images of the zoom-in animation, so that the image corresponding to the zoom-in animation is more transparent, and the zoom-in animation and the initial animation can be naturally connected.
[0156] For example, after the electronic device plays the image as shown in interface D in Figure 6 , several frames of images of the zoom-in animation can be played, and the transparency of the images of the zoom-in animation can be gradually reduced, so that the transition between the zoom-in animation and the initial animation is more natural.
[0157] In the embodiments of the present application, through the method 700, after the window compositor receives the related information of the animation unit of the initial animation, the window compositor can control the playing or stopping of the zoom-in animation and the initial animation, the electronic device controls multiple window animations is realized, the flexibility of animation control is improved, and the user experience is enhanced.
[0158] Scenario three, in the process that the electronic device is playing the start animation of application A, the user triggers the operation of starting application B.
[0159] Exemplarily, Figure 8 The schematic diagram of the animation control of scenario three provided by the embodiments of the present application is shown in FIG. 8A, and details are not described herein. Figure 8 After the user clicks the information application icon in interface A as shown in Figure 8 , the electronic device plays the zoom-in animation of the information application,Figure 8 Interfaces B and C in the diagram can be used as illustrations of two frames during the zoom-in animation playback process of the messaging application. When the zoom-in animation reaches the image displayed on interface C, the user triggers the operation to launch the phone application. At this time, the electronic device can play, for example,... Figure 8 Zoom-in animation of the phone application shown in interfaces D, E, and F.
[0160] To facilitate understanding, the following will be combined with... Figure 9 This paper describes how to use a window compositor to control the playback and pausing of the window animations of applications A and B in a scenario where a user triggers the launch of application B while application A is playing a zoom-in animation on an electronic device. In other words, it describes how to use a window compositor to control the playback and pause of multiple window animations, allowing them to play in parallel. The details are as follows.
[0161] Figure 9 This is a flowchart illustrating an animation control method 900 provided in an embodiment of this application. The animation control method 900 can be executed by an electronic device, and the hardware structure of the electronic device can be as follows: Figure 2 As shown, the software structure can be as follows: Figure 3 As shown. Figure 9 As shown, method 900 includes the following steps:
[0162] S901, In response to the user clicking the icon of application A, the desktop launcher calculates the animation parameters of the zoom-in animation of application A.
[0163] S902, The desktop launcher sends information about the animation unit of the zoom-in animation of application A to the window compositor.
[0164] S903. After receiving the relevant information of the animation unit of the zoom-in animation of application A, the window compositor plays the zoom-in animation of application A.
[0165] It should be understood that the implementation methods of S901-S903 are similar to those of S501-S503, and can be referred to the description above, which will not be repeated here.
[0166] S904. During the playback of the zoom-in animation in application A, in response to the user's trigger operation of launching application B, the desktop launcher calculates the animation parameters of the zoom-in animation in application B.
[0167] It's understandable that when application A's zoom-in animation plays to a point like... Figure 8 When the image displayed on interface C is launched, if the user launches application B at this time, the desktop launcher calculates the animation parameters of the zoom-in animation of application B in response to the user's launch of application B.
[0168] S905, the desktop launcher sends the window compositor the related information of the animation unit of the zoom-in animation of application B.
[0169] The related information of the animation unit of the zoom-in animation of application B can include one or more of an animation identifier of the zoom-in animation of application B, a window or layer to which the zoom-in animation of application B belongs, animation parameters, and a control instruction.
[0170] It can be understood that the control instruction can be used to make the window compositor playing the zoom-in animation of application A play the zoom-in animation of application B. Therefore, it can be understood that the process of making the window compositor playing the zoom-in animation of application A play the zoom-in animation of application B can be implemented by creating an instruction or starting an instruction.
[0171] It should be noted that if the control instruction is a creation instruction or a start instruction, the animation parameters corresponding to the creation instruction or the start instruction can be the animation parameters of the zoom-in animation of application B. The creation instruction or the start instruction of the zoom-in animation of application B can refer to the description of the creation instruction or the start instruction of the zoom-in animation in S503, which will not be described here.
[0172] Optionally, the control instruction can further include a cancel instruction, wherein the cancel instruction can be used to make the window compositor stop playing the zoom-in animation of application A. If the control instruction further includes the cancel instruction, the desktop launcher can further send the window compositor the animation identifier of the zoom-in animation of application A, so that after the window compositor receives the cancel instruction, it finds the corresponding local animation unit based on the animation identifier of the zoom-in animation of application A, and controls it to stop playing the zoom-in animation of application A.
[0173] S906, the window compositor plays the zoom-in animation of application B after receiving the related information of the animation unit of the zoom-in animation of application B.
[0174] It should be understood that after the window compositor receives the related information of the animation unit of the zoom-in animation of application B, if the control instruction is a creation instruction or a start instruction, a local animation unit for the zoom-in animation can be created based on the animation parameters of the zoom-in animation of application B, or an existing animation unit for the zoom-in animation can be updated.
[0175] Optionally, in the case where the control instruction is a creation instruction, the window compositor can create a local animation unit for the zoom-in animation of application B in the local storage space based on the animation identifier of the zoom-in animation of application B and the window or layer to which the zoom-in animation of application B belongs, and save the animation parameters in the local animation unit.
[0176] It should be understood that in the case where the control instruction is a creation instruction, when the desktop launcher needs to play the zoom-in animation of application B, the desktop launcher can send a start instruction to the window compositor, so that the window compositor plays the zoom-in animation based on the created animation unit of the zoom-in animation of application B.
[0177] Or, in the case of the control instruction is a start instruction, the desktop launcher looks for a local animation unit of the zoom-in animation of the application B in the local storage space, after finding the local animation unit of the zoom-in animation of the application B, fuses the animation parameters of the zoom-in animation of the application B into the local animation unit, obtains an updated local animation unit, and the window compositor can start playing the updated local animation unit in the next frame of the animation playing.
[0178] Exemplarily, after the window compositor receives the control instruction, the zoom-in animation shown in interfaces D, E and F in Figure 8 may be played. The animation control method 900 provided by the embodiments of the present application can realize the control of playing and pausing of multiple window animations, so that multiple window animations can be played in parallel, improve the flexibility of animation control, and enhance the user experience.
[0179] It should be understood that the above-mentioned Figure 4 , Figure 6 and Figure 8 are exemplary schematic diagrams, and more or fewer controls or information can be included in the actual interface, and the specific interface does not limit the content included.
[0180] It should be understood that in the embodiments of the present application, the electronic device can be in different scenes at different time points, so the implementation manners corresponding to the above three scenes can be used in combination. That is, the above-illustrated method 500, method 700 and method 900 can also be implemented alone or in combination. The present application does not make specific limitation on this
[0181] For ease of understanding, the process of the animation control method provided by the embodiments of the present application for controlling multiple animations of the same window and controlling multiple animations of different windows will be described below in combination with Figure 10 . Among them, the multiple animations of different windows can belong to the same application program or different application programs, which is not limited here. It can be understood that if the multiple animations of different windows can belong to the same application program, the control process can correspond to the above-mentioned scenario two; if the multiple animations of different windows can belong to different application programs, the control process can correspond to the above-mentioned scenario three.
[0182] Figure 10 A flowchart of an animation control method 1000 provided by the embodiments of the present application. The animation control method 1000 can be executed by an electronic device, the hardware structure of the electronic device can be as shown in Figure 2 , and the software structure can be as shown in Figure 3 . As shown in Figure 10 , the method 1000 includes the following steps:
[0183] S1001, the desktop launcher calculates the animation parameters of window 1.
[0184] Taking that window 1 can play animation 1 and animation 2 as an example, the desktop launcher can calculate the animation parameters of animation 1 and the animation parameters of animation 2 respectively. It can be understood that animation 1 of window 1 can correspond to the zoom-in animation of application A in the embodiment Figure 5 animation 2 of window 1 can correspond to the zoom-out animation of application A in the embodiment. Figure 5
[0185] After calculating the animation parameters of window 1, the desktop launcher can execute step S1002.
[0186] S1002, the desktop launcher sends the animation parameters to the window compositor.
[0187] Taking an example that the local animation unit of animation 1 is stored in the window compositor and the local animation unit of animation 2 is not stored, when window 1 needs to play animation 1, the desktop launcher can send the animation parameters of animation 1 and the start instruction of animation 1 to the window compositor. Among them, the animation parameters of animation 1 can include the animation identifier of animation 1, the window or layer it belongs to, and / or the parameter information of each frame image in animation 1, etc.
[0188] The desktop launcher can also send the animation parameters of animation 2 and the creation instruction of animation 2 to the window compositor. Among them, the animation parameters of animation 2 can include the animation identifier of animation 2, the window or layer it belongs to, and / or the parameter information of each frame image in animation 2, etc.
[0189] S1003, the window compositor receives and saves the animation parameters, and plays the animation.
[0190] It can be understood that after the window compositor obtains the animation parameters of animation 1, based on the start instruction of animation 1, the window compositor can find the local animation unit that already exists in the local through the animation identifier, and fuse the parameter information of each frame image of animation 1 into the local animation unit, and play animation 1. The process of playing the zoom-in animation in the embodiment can be referred to Figure 5
[0191] After obtaining the animation parameters of animation 2, the window compositor can create the local animation unit of animation 2 in the local storage space based on the creation instruction of animation 2, and the animation identifier and / or the window or layer it belongs to, and save the parameter information of each frame image of animation 2 in the local animation unit of animation 2.
[0192] S1004, the desktop launcher updates the animation state of window 1.
[0193] The animation state of the desktop launcher updating window 1 can be understood as a state in which the window 1 switches from a state in which no animation 2 is played to a state in which the animation 2 needs to be played. For example, the animation state of the desktop launcher updating window 1 can include Figure 5 After the user triggers the operation of interrupting the playing of the zoom-in animation in the embodiment, the desktop launcher can update the animation state, that is, start the playing of the zoom-out animation.
[0194] After the desktop launcher updates the animation state of the window 1, the desktop launcher can perform step S1005.
[0195] S1005, the desktop launcher sends the animation parameters to the window compositor.
[0196] When the window 1 needs to play the animation 2, the desktop launcher can send the animation parameters of the animation 2 and the start instruction of the animation 2 to the window compositor. The animation parameters of the animation 2 can include the animation identifier of the animation 2 and the like. It can be understood that if the animation parameters of the animation 2 change, the animation parameters of the animation 2 can also include the changed animation parameters.
[0197] S1006, the window compositor receives and saves the animation parameters of the animation 2, and plays the animation 2.
[0198] When the window compositor obtains the animation parameters of the animation 2 and the start instruction of the animation 2, the window compositor can find a local animation unit that already exists locally based on the animation identifier of the animation 2, update the animation parameters of the animation 2, and play the animation 2 based on the start instruction of the animation 2.
[0199] In a possible scenario, after the window compositor obtains the animation parameters of the animation 2, the window compositor can fuse the animation parameters of the animation 1 and the animation parameters of the animation 2. For example, in S706 described above, after the window compositor receives the cancel instruction of stopping the zoom-in animation, the window compositor can not immediately stop the playing of the zoom-in animation, but continue to multicast a few frames of zoom-in animation images, and gradually reduce the transparency of the zoom-in animation in the process of multicasting the few frames of zoom-in animation images. In this process, the animation parameters of the animation 1 can be fused into the animation parameters of the animation 2.
[0200] In another possible scenario, after the window compositor obtains the animation parameters of the animation 2, the window compositor finds a local animation unit that already exists locally based on the animation identifier of the animation 2, updates the animation parameters of the animation 2, and then plays the animation 2.
[0201] It can be understood that the above S1001-S1006 are operations of the desktop launcher controlling the playing and pausing of multiple animations of the same window through control instructions, which can make the connection between multiple animations of the same window more smooth, improve the flexibility of animation control, and enhance the user experience.
[0202] On the other hand, S1007-S1013 below are operations of playing and pausing a plurality of animations of different windows by the desktop launcher through a control instruction. Details are as follows.
[0203] S1007, the desktop launcher calculates the animation parameters of the window 2.
[0204] Taking that the window 2 can play the animation 3 as an example, the desktop launcher can calculate the animation parameters of the animation 3 of the window 2. It can be understood that the animation 3 can correspond to Figure 9 the zoom-in animation of the application B in the embodiment.
[0205] After calculating the animation parameters of the animation 3, the desktop launcher can execute step S1008.
[0206] S1008, the desktop launcher sends the animation parameters to the window compositor.
[0207] Exemplarily, taking that the local storage unit of the window compositor stores the animation 3 as an example, when the window 2 needs to play the animation 3, the desktop launcher can send the animation parameters of the animation 3 and the start instruction of the animation 3 to the window compositor. Among them, the animation parameters of the animation 3 can include one or more of the animation identifier of the animation 3, the window or layer to which the animation 3 belongs, and the parameter information of each frame image in the animation 3.
[0208] S1009, the window compositor receives and saves the animation parameters and plays the animation.
[0209] After obtaining the animation parameters of the animation 3, based on the start instruction of the animation 3, the window compositor can find the local animation unit that already exists in the local through the animation identifier of the animation 3, and fuse the parameter information of each frame image of the animation 3 into the local animation unit, and play the animation 3. The process of playing the animation 3 of the window 2 can refer to Figure 9 the related description of playing the zoom-in animation of the application B in the corresponding embodiment.
[0210] S1010, the desktop launcher updates the animation state of the window 2.
[0211] Among them, the desktop launcher updating the animation state of the window 2 can be understood as that the window 2 switches from the state of playing the animation 3 to the state of playing the animation 4. For example, the desktop launcher updating the animation state of the window 2 can include Figure 7 the state of switching from playing the zoom-in animation to playing the initial animation in the embodiment.
[0212] After the desktop launcher updates the animation state of the window 2, the desktop launcher can execute step S1011.
[0213] S1011, the desktop launcher sends the animation parameters to the window compositor.
[0214] When the window 2 switches from the state of playing the animation 3 to the state of playing the animation 4, the desktop launcher can send the animation parameters of the animation 3 and the cancel instruction of the animation 3 to the window compositor, wherein the animation parameters of the animation 3 can include information such as the animation identifier of the animation 3.
[0215] The desktop launcher can also send the animation parameters of the animation 4 and the start instruction of the animation 4 to the window compositor. Wherein the animation parameters of the animation 4 can include information such as the animation identifier of the animation 4. It can be understood that if the animation parameters of the animation 4 change, the animation parameters of the animation 4 can also include the changed animation parameters.
[0216] S1012, the desktop launcher receives and saves the animation parameters, and plays the animation.
[0217] It can be understood that after the window compositor obtains the animation parameters of the animation 3, based on the cancel instruction of the animation 3, the window compositor can find the local animation unit that already exists locally through the animation identifier, and stop playing the local animation unit of the animation 3.
[0218] When the window compositor obtains the animation parameters of the animation 4 and the start instruction of the animation 4, the window compositor can find the local animation unit that already exists locally based on the animation identifier of the animation 4, update the animation parameters of the animation 4, and play the animation 4 based on the start instruction of the animation 4.
[0219] S1013, the desktop launcher plays the animations of the window 1 and the window 2 until the animation playing ends.
[0220] That is, after the window 1 animation playing ends, the desktop launcher continues to play the window 2 animation until the window 2 animation playing ends.
[0221] Figure 11 An animation control method of an embodiment of the present application is shown. The method comprises:
[0222] S1101, in response to a first operation of triggering starting a first application, playing a first start animation of the first application.
[0223] Wherein, the first application can be an application program in the electronic device, for example, it can be an information, telephone or browser application program. The first operation can be a trigger operation of the user starting the first application, for example, the first operation can be an operation of the user clicking the first application icon, or the first operation can be an operation of the user giving a voice instruction to open the first application to the voice assistant of the electronic device, which is not limited here. The first start animation can be an animation from the first application icon to the full-screen display of the first application window, which can be referred to the description of the start animation in the above, and will not be repeated here.
[0224] In the embodiments of the present application, in response to the user triggering the first operation of starting the first application, the electronic device can play the first start animation of the first application. For example, in response to the user triggering the operation of starting the application A, the electronic device can play the start animation of the application A. For details, please refer to the specific embodiments of the present application. Figure 5 For the related description of S501-S503 in the corresponding embodiments, details are not described herein again.
[0225] S1102, in the process of playing the first start animation, receiving the second operation of triggering the start of the second application.
[0226] In the embodiments of the present application, the second application can be other application program in the electronic device except the first application, and the second operation can be the operation of the user triggering the start of the second application. In the process of playing the first start animation, the second operation of the user triggering the start of the second application, for example, can refer to the image displayed in the interface C in Figure 8 , wherein the first application can be an information application program, and the second application can be a telephone application program. When the first start animation is played to the image as shown in the interface C, the user triggers the second operation of starting the second application, and the electronic device can receive the second operation of triggering the start of the second application.
[0227] S1103, in response to the second operation, continuously playing the first start animation, and playing the second start animation of the second application, wherein the second start animation is in the upper layer of the first start animation.
[0228] The second start animation can be an animation of transitioning from the second application icon to the full-screen display of the second application window. For details, please refer to the description of the start animation in the foregoing, and details are not described herein again.
[0229] In the embodiments of the present application, in response to the second operation of the user triggering the start of the second application, the electronic device can continuously play the first start animation and play the second start animation of the second application. It can be understood that when playing the first start animation and the second start animation, the second start animation can be in the upper layer of the first start animation, that is, the second start animation can be overlaid on the first start animation. For example, in response to the second operation, the process of continuously playing the first start animation and playing the second start animation of the second application can refer to Figure 9 For the related description of S904-S906 in the corresponding embodiments, details are not described herein again.
[0230] In the embodiments of the present application, in the process of the electronic device playing the first start animation, in response to the second operation of triggering the start of the second application, the electronic device can continuously play the first start animation and play the second start animation. In this way, the electronic device can play the animations of multiple windows in parallel, improve the flexibility of the electronic device playing the animations, and improve the user experience.
[0231] Optionally, before playing the first start-up animation of the first application, the method further includes: calculating a first animation parameter of the first start-up animation, the first animation parameter including one or more animation parameters used for playing the first start-up animation. Figure 11 According to the corresponding embodiments, before playing the first start-up animation of the first application, the method further includes: calculating a first animation parameter of the first start-up animation, the first animation parameter including one or more animation parameters used for playing the first start-up animation. Playing the first start-up animation of the first application includes: playing the first start-up animation of the first application based on the first information, wherein the first information includes a first animation identifier, the first animation parameter, and a first instruction, and the first instruction is used to instruct playing the first start-up animation.
[0232] The animation parameter can include one or more of the following attributes of an image: position, size, scaling matrix, rotation matrix, transparency, color, and the like. For details, refer to the description of the animation parameter above. The first animation identifier can be used to uniquely identify the first animation. Optionally, the first animation identifier can be represented by a number or a string, or other data types. The first instruction can be used to instruct the window compositor to play the first start-up animation. For details, refer to the description of the start-up instruction above.
[0233] It can be understood that the first information can correspond to the animation unit described above. For details, refer to the description of the animation unit above.
[0234] The electronic device calculating the first animation parameter of the first start-up animation can be performed by the desktop launcher described above. For details, refer to the description of the desktop launcher above. Figure 5 According to the description of S501 in the corresponding embodiments, the electronic device playing the first start-up animation of the first application based on the first information can be performed by the window compositor described above. For details, refer to the description of the window compositor above. Figure 5 According to the description of S503 in the corresponding embodiments, the details are not repeated here.
[0235] It can be understood that after the desktop launcher calculates the first animation parameter, the desktop launcher can send the first information, i.e., the first animation identifier, the first animation parameter, and the first instruction, to the window compositor. After receiving the first information, the window compositor can play the first start-up animation of the first application based on the first information. For details, refer to the description of S501-S503 in the corresponding embodiments. Figure 5 According to the description of S501-S503 in the corresponding embodiments, the details are not repeated here.
[0236] In the embodiments of the present application, before playing the first start animation of the first application, the first animation parameter can be calculated by the desktop launcher, and the first animation parameter, the corresponding first animation identifier and the first instruction are sent to the window compositor for playing, so that the electronic device can control the playing of the first start animation, and the flexibility of animation control is improved. Moreover, the first parameter is calculated in advance before playing the animation, which can reduce the burden of real-time calculation, improve the smoothness of animation playing and enhance the user experience.
[0237] Optionally, in Figure 11 Based on the corresponding embodiments, based on the first information, before playing the first start animation of the first application, further comprising: based on the second instruction, locally saving the second information, the second information comprising the first animation identifier and the second animation parameter, the second animation parameter being the same as or different from the first animation parameter. Based on the first information, playing the first start animation of the first application, comprising: based on the first instruction, searching the locally saved second animation parameter according to the first animation identifier; updating the locally saved second animation parameter in combination with the first animation parameter, and playing the first start animation based on the first animation parameter.
[0238] The second animation parameter can comprise one or more animation parameters of the first start animation, and the second animation parameter can also be calculated by the desktop launcher, similar to the first animation parameter. The second instruction can be used to instruct the window compositor to locally save the second information.
[0239] It can be understood that after the desktop launcher calculates the second animation parameter, the desktop launcher can send the second instruction, the first animation identifier and the second animation parameter to the window compositor. After receiving the second instruction, the first animation identifier and the second animation parameter, the window compositor can save the second information locally based on the second instruction. Wherein, the window compositor locally saving the second information can be understood as the window compositor establishing a local animation unit in the above, that is, the window compositor can create a local animation unit based on the second instruction and the first animation identifier, and save the second animation parameter to the local animation unit.
[0240] The second instruction can be understood as the creation instruction in the above, which can be used to instruct the window compositor to create a local animation unit, and the first instruction can be understood as the start instruction in the above, which can be used to make the window compositor play the animation. It can be understood that the second animation parameter and the first animation parameter can be the same or different.
[0241] If the second animation parameter and the first animation parameter are the same, it can be understood that the desktop launcher does not update the window animation when playing the animation, and still plays the pre-calculated second animation parameter. If the second animation parameter and the first animation parameter are different, it can be understood that the desktop launcher updates the window animation when playing the animation, and needs to update the pre-calculated second animation parameter based on the first animation parameter.
[0242] In the embodiments of the present application, if the window compositor locally stores the second information, it can be understood that the window compositor has a corresponding local animation unit as described above. After the window compositor receives the first information, the window compositor can find the locally stored second animation parameters based on the first animation identifier, and update the locally stored second animation parameters based on the first animation parameters. The process of updating the locally stored second animation parameters based on the first animation parameters can be referred to the description of updating the local animation unit of the window compositor as described above, and will not be repeated here.
[0243] Further, the window compositor can play the first startup animation based on the first animation parameters, for example, it can be referred to the description of the first startup animation as described above, and will not be repeated here. Figure 5 The related description of S503 in the corresponding embodiments will not be repeated here.
[0244] Optionally, if the second animation parameters and the first animation parameters are the same, the locally stored second animation parameters can not be updated, and the first startup animation can be played based on the second animation parameters, which is not limited here.
[0245] In the embodiments of the present application, the second animation parameters stored locally by the window compositor can be updated based on the first animation parameters, so that the electronic device updates the animation being played in the process of playing the animation, which can improve the flexibility of the electronic device playing the animation and improve the user experience.
[0246] Optionally, in the embodiments of the present application, Figure 11 Based on the corresponding embodiments, the second instruction further includes a sub-instruction. After the first startup animation is played, the first animation identifier and the animation parameters of the locally stored first startup animation are retained based on the sub-instruction.
[0247] In the embodiments of the present application, the second instruction can further include a sub-instruction. The sub-instruction can be used to instruct the window compositor to retain the first animation identifier and the animation parameters of the locally stored first startup animation after the first startup animation is played, which can also be understood as instructing the window compositor not to automatically delete the first animation identifier and the animation parameters of the locally stored first startup animation after the first startup animation is played.
[0248] In the embodiments of the present application, the window compositor can not automatically delete the corresponding first animation identifier and the animation parameters of the locally stored first startup animation after the animation is played, which can also be understood as not automatically deleting the local animation unit as described above. The process of calculating the animation parameters again when the animation is played repeatedly is reduced, thereby improving the efficiency of playing the animation.
[0249] Optionally, in the embodiments of the present application, Figure 11According to the embodiment, in response to the second operation, the first startup animation is continuously played, and the method further includes: in response to the second operation, calculating a third animation parameter of the first startup animation, the third animation parameter being different from the first animation parameter; based on the third instruction, searching for the animation parameter of the first startup animation saved locally according to the first animation identifier; and updating the third animation parameter into the animation parameter of the first startup animation saved locally, and playing the first startup animation based on the third animation parameter.
[0250] The third instruction can be used to make the window compositor update the playing animation, for example, the window compositor can make the playing first startup animation gradually transparent based on the third instruction. Alternatively, the third instruction can be understood as the update instruction described above, and details can be referred to the description of the third instruction above, which will not be repeated here.
[0251] It can be understood that, in response to the second operation, the desktop launcher can control the window compositor to update the animation effect of the window compositor playing the first startup animation in the process of continuously playing the first startup animation, for example, the first startup animation can be made gradually transparent in the process of the window compositor continuously playing the first startup animation.
[0252] For example, in the implementation process, in response to the second operation, the desktop launcher can calculate a third animation parameter of the first startup animation, wherein the third animation parameter is different from the first animation parameter. For example, the third animation parameter can include an animation parameter for making the first startup animation gradually transparent. After the third animation parameter is calculated, the desktop launcher can send the first animation identifier, the third animation parameter, and the third instruction to the window compositor.
[0253] After the window compositor receives the first animation identifier, the third animation parameter, and the third instruction, the window compositor can search for the animation parameter of the first startup animation saved locally according to the first animation identifier based on the third instruction, which can be understood as an update instruction. After the window compositor searches for the animation parameter of the first startup animation saved locally, the window compositor can update the third animation parameter into the animation parameter of the first startup animation saved locally.
[0254] For example, in order to make the first startup animation gradually transparent, the third animation parameter can include a new transparency, and the window compositor can replace the corresponding transparency in the animation parameter of the first startup animation with the new transparency to complete the update operation. Further, the window compositor can play the first startup animation based on the third animation parameter, for example, the window compositor can play the first startup animation which is gradually transparent.
[0255] In the embodiments of the present application, the desktop launcher can calculate the third animation parameter for updating the animation in the process of playing the animation, so that the window compositor can update the animation being played based on the third instruction. Based on the third instruction, the electronic device can quickly respond and adjust the animation parameter and adjust the animation playing in the case of frequent user operations, improve the flexibility of the electronic device in the process of playing the animation, and improve the user experience.
[0256] Optionally, in the embodiments of the present application, Figure 11 Based on the corresponding embodiments, before calculating the third animation parameter of the first start-up animation, the method further includes: obtaining the playing progress of the first start-up animation based on a fourth instruction; and calculating the third animation parameter of the first start-up animation includes: calculating the third animation parameter of the first start-up animation based on the playing progress of the first start-up animation.
[0257] In the embodiments of the present application, the fourth instruction can be used to query the animation playing progress, for example, the fourth instruction can be understood as the query instruction in the above. It can be understood that before the desktop launcher calculates the third animation parameter for updating the first start-up animation, the playing progress of the first start-up animation can be obtained first, and then the third animation parameter is calculated based on the current playing progress after the desktop launcher obtains the playing progress. Exemplarily, the playing progress of the first start-up animation can be the animation parameter of the frame of the first start-up animation being currently played.
[0258] Exemplarily, the desktop launcher can send the first animation identifier and the fourth instruction to the window compositor, and after the window compositor obtains the first animation identifier and the fourth instruction, the window compositor can find the animation parameter of the first start-up animation stored locally based on the fourth instruction according to the first animation identifier, and obtain the playing progress of the first start-up animation, and then return the playing progress to the desktop launcher.
[0259] Further, the desktop launcher can calculate the third animation parameter based on the playing progress of the first start-up animation, wherein the process of calculating the third animation parameter can refer to the description of the process of calculating the third animation parameter in the embodiments of the present application. Figure 5 The related description of S504 in the corresponding embodiments will not be repeated here.
[0260] In the embodiments of the present application, the third animation parameter can be calculated based on the playing progress of the first start-up animation, so that the electronic device can adjust the animation parameter according to the playing progress of the current animation, and the animation parameter can be updated without recalculating all the animation parameters, which saves the system resources and improves the flexibility of the animation control and the user experience.
[0261] Optionally, in the embodiments of the present application, Figure 11 Based on the corresponding embodiments, the animation control method further includes: receiving a third operation of triggering the exit of the second application in the process of playing the second start-up animation; and in response to the third operation, stopping playing the second start-up animation and playing a third exit animation of the second application.
[0262] The third operation can be understood as Figure 5 The third exit animation can be a transition animation from full-screen state to icon state of the second application, or, if the second application is in a state of occupying part of the display screen, the third exit animation can be a transition animation from the state of occupying part of the display screen to the icon state of the second application, for example, the zoom-out animation in the above, which will not be described here.
[0263] During the playing of the second start-up animation, if the electronic device receives a third operation triggering the exit of the second application, the electronic device can stop playing the second start-up animation and play a third exit animation of the second application. For example, after receiving the third operation, the desktop launcher can send a stop instruction to the window compositor to stop playing the second start-up animation, and send a creation instruction or a start instruction to play the third exit animation.
[0264] Alternatively, after receiving the third operation, the desktop launcher can send an update instruction to the window compositor to update the second start-up animation, so as to switch from the second start-up animation being played to the third exit animation being played. The specific implementation of this process can refer to the description of the first operation in the above Figure 5 The related description of S504-S506 in the corresponding embodiment will not be repeated here.
[0265] In the embodiments of the present application, when the electronic device receives a trigger exit operation, the currently playing animation can be stopped and the corresponding exit animation can be played, which can improve the continuity of animation playing and improve the user experience.
[0266] Optionally, in Figure 11 Based on the corresponding embodiment, in response to the third operation, the second start-up animation is stopped from being played, and the third exit animation of the second application is played, including: in response to the third operation, based on a fifth instruction, the second start-up animation is stopped from being played, and based on a first instruction, the third exit animation of the second application is played.
[0267] The fifth instruction can be used to make the window compositor stop playing the animation, for example, the related description of the cancel instruction in the above can be referred to, which will not be described here.
[0268] Optionally, in response to the third operation, the desktop launcher sends the animation identifier of the second start animation and the fifth instruction to the window compositor, and after the window compositor receives the animation identifier and the fifth instruction, the window compositor can stop playing the second start animation according to the animation identifier of the second start animation based on the fifth instruction. Moreover, the desktop launcher can calculate the animation parameters of the third exit animation, and send the animation parameters of the third animation, the animation identifier and the first instruction to the window compositor, and after the window compositor receives the animation parameters of the third animation, the animation identifier and the first instruction, the window compositor can play the third exit animation based on the first instruction. For specific implementation, refer to the description of the first embodiment. Figure 5 The related description of S504-S506 in the corresponding embodiment.
[0269] In the embodiment of the application, when the electronic device receives the operation of triggering the exit of the application, the start animation of the application can be stopped based on the fifth instruction, and the exit animation can be played based on the first instruction, which can improve the continuity of animation playing, improve the flexibility of animation control, and enhance the user experience.
[0270] Optionally, in the embodiment of the application, Figure 11 Based on the corresponding embodiment, in response to the third operation, the second start animation is stopped from being played, and the third exit animation of the second application is played, including: in response to the third operation, calculating fourth animation parameters of the third exit animation, the fourth animation parameters including one or more animation parameters for playing the third exit animation; based on the third instruction, searching for the animation parameters of the second start animation saved locally according to the second animation identifier; updating the fourth animation parameters to the animation parameters of the second start animation saved locally, and playing the third exit animation based on the fourth animation parameters.
[0271] In the embodiment of the application, in response to the third operation, for example, the third operation can be an operation of the user interrupting the second start animation, the desktop launcher can calculate fourth animation parameters of the third exit animation, wherein the third exit animation can be understood as the zoom-out animation in the above, which will not be described here. The fourth animation parameters can include one or more animation parameters for playing the third exit animation. For example, the fourth animation parameters can include, for example, Figure 5 The scaling matrix in S505 in the corresponding embodiment, which will not be described here.
[0272] It can be understood that the desktop launcher can send the fourth animation parameter, the second animation identifier and the third instruction to the window compositor after determining the fourth animation parameter. After receiving the fourth animation parameter, the second animation identifier and the third instruction, the window compositor can search the locally saved animation parameter of the second startup animation according to the second animation identifier based on the third instruction. After searching the animation parameter of the second startup animation, the window compositor can update the locally saved animation parameter of the second startup animation based on the fourth animation parameter, for example, the fourth animation parameter can be fused with the animation parameter of the second startup animation.
[0273] After the animation parameter of the second startup animation is updated, the window compositor can play the third exit animation based on the fourth animation parameter and the updated animation parameter of the second startup animation. It can be understood that the implementation manner in which the electronic device stops playing the second startup animation and plays the third exit animation can refer to the implementation manner in which the electronic device stops playing the second startup animation and plays the third exit animation in the corresponding embodiment. Figure 5 For the related description of playing the zoom-out animation based on the update instruction in S504-S506 in the corresponding embodiment, details are not described herein again.
[0274] In the embodiment of the present application, after the electronic device receives the third operation, the electronic device can update the playing animation through the third instruction, for example, the electronic device can switch the playing second startup animation to play the third exit animation, improve the smoothness of animation playing, improve the flexibility of animation control, and enhance the user experience.
[0275] Optionally, in the embodiment of the present application, Figure 11 On the basis of the corresponding embodiment, the animation control method further includes: deleting the locally saved related information of the first startup animation based on a sixth instruction related to the first startup animation.
[0276] The sixth instruction can be used to delete the related information of the animation, for example, it can be understood as the deletion instruction in the above description, and details are not described herein again. Exemplarily, the desktop launcher can send the first animation identifier of the first startup animation and the sixth instruction to the window compositor. After receiving the first animation identifier and the sixth instruction, the window compositor can search and delete the locally saved related information of the first startup animation according to the first animation identifier based on the sixth instruction, so as to release the system memory resources occupied by the related information of the first startup animation.
[0277] In the embodiment of the present application, the electronic device can delete the locally saved related information of the animation through the sixth instruction, reduce the processing burden of the electronic device, and save the memory resources.
[0278] Optionally, in the embodiment of the present application, Figure 11 On the basis of the corresponding embodiment, the first animation parameter includes one or more of the following: the position of the animation window, the size of the animation window, the scaling matrix of the animation, the rotation matrix of the animation, the transparency of the animation, and the color of the animation.
[0279] The position, size, scaling matrix, rotation matrix, transparency, and color of the animation window can be referred to the description of animation parameters above, and will not be repeated here. In this embodiment, by calculating parameters such as the position, size, scaling matrix, rotation matrix, transparency, and color of the animation window, the accuracy and flexibility of animation playback and control on electronic devices can be improved, thereby enhancing the user experience.
[0280] Optional, in Figure 11 Based on the corresponding embodiments, the first instruction includes the START instruction, the second instruction includes the CREAT instruction, the third instruction includes the UPDATE instruction, the fourth instruction includes the QUERY instruction, the fifth instruction includes the CANCEL instruction, and the sixth instruction includes the DELETE instruction.
[0281] The first, second, third, fourth, fifth, and sixth instructions can be referred to in the above descriptions of the start instruction, create instruction, update instruction, query instruction, cancel instruction, and delete instruction, respectively, and will not be repeated here.
[0282] In this embodiment, the animations of multiple windows can be played and controlled in parallel based on the first, second, third, fourth, fifth, and sixth instructions, which improves the accuracy and flexibility of animation control, makes the animation switching process smoother, and enhances the user experience.
[0283] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0284] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the method steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0285] The embodiments of the present application can divide the functional modules of the device for implementing the method according to the above method examples, for example, each functional module can be divided according to each function, or two or more functions can be integrated in one processing module. The integrated module can be realized in the form of hardware or in the form of a software functional module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, another division mode can be used.
[0286] As Figure 12 A structure diagram of a chip provided by the embodiments of the present application is shown. The chip 1200 includes one or two or more (including two) processors 1201, a communication line 1202, a communication interface 1203 and a memory 1204.
[0287] In some embodiments, the memory 1204 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0288] The method described in the embodiments of the present application can be applied to the processor 1201 or implemented by the processor 1201. The processor 1201 can be an integrated circuit chip with a processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the processor 1201. The processor 1201 described above can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, a discrete gate or transistor logic device, or a discrete hardware component, the processor 1201 can implement or execute the disclosed processing-related methods, steps and logic block diagrams in the embodiments of the present application.
[0289] The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processing executed by a processor, or executed by a combination of hardware and software modules in the code processing. Among them, the software module can be located in a mature storage medium in the field, such as random access memory, read-only memory, programmable read-only memory or electrically erasable programmable read-only memory (EEPROM) and the like. The storage medium is located in the storage 1204, and the processor 1201 reads the information in the storage 1204, and combines the hardware to complete the steps of the above method.
[0290] The processor 1201, the storage 1204 and the communication interface 1203 can communicate through the communication line 1202.
[0291] In the above embodiments, the instructions stored in the storage for the processor to execute can be realized in the form of a computer program product. Among them, the computer program product can be written in the storage in advance, or downloaded and installed in the storage in the form of software.
[0292] The embodiments of the present application also provide a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. Computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another, for example, computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.)) way. The computer-readable storage medium can be any available medium that the computer can store or include one or more available media integrated into a server, data center or other data storage device. For example, available media can include magnetic media (such as floppy disk, hard disk or magnetic tape), optical media (such as digital versatile disc (DVD)), or semiconductor media (such as solid state disk (SSD)) and the like.
[0293] The embodiments of the present application further provide a computer readable storage medium. The method described in the above embodiments can be realized by software, hardware, firmware or any combination thereof, in whole or in part. The computer readable medium can include computer storage medium and communication medium, and can further include any medium that can transfer computer program from one place to another. The storage medium can be any target medium that can be accessed by computer.
[0294] As a possible design, the computer readable medium can include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disk storage; the computer readable medium can include magnetic disk storage or other magnetic disk storage device. Moreover, any connection line can also be appropriately referred to as a computer readable medium. For example, if software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave) is included in the definition of the medium. As used herein, the disk and the optical disk include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein the disk is usually reproduced by magnetism, and the optical disk is optically reproduced by laser.
[0295] The embodiments of the present application are described with reference to flowcharts and / or block diagrams of the method, device (system) and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be realized by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the computer or other programmable data processing device produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The device that realizes the functions specified in one flow or multiple flows and / or blocks.
Claims
1. An animation control method applied to electronic devices, characterized in that, The method includes: In response to the first operation that triggers the launch of the first application, the first launch animation of the first application is played. During the playback of the first startup animation, a second operation is received that triggers the launch of the second application; In response to the second operation, the first startup animation is continuously played, and a second startup animation of the second application is played, wherein the second startup animation is on top of the first startup animation.
2. The method according to claim 1, characterized in that, Before playing the first startup animation of the first application, the method further includes: Calculate the first animation parameters of the first startup animation, the first animation parameters including one or more frames of animation parameters for playing the first startup animation; Playing the first startup animation of the first application includes: Based on the first information, the first startup animation of the first application is played; wherein, the first information includes a first animation identifier, the first animation parameters, and a first instruction, and the first instruction is used to instruct the playback of the first startup animation.
3. The method according to claim 2, characterized in that, Before playing the first startup animation of the first application based on the first information, the method further includes: Based on the second instruction, second information is stored locally. The second information includes the first animation identifier and the second animation parameters. The second animation parameters may be the same as or different from the first animation parameters. Playing the first startup animation of the first application based on the first information includes: Based on the first instruction, locate the locally stored second animation parameters according to the first animation identifier; The second animation parameters, which are stored locally, are updated in conjunction with the first animation parameters, and the first startup animation is played based on the first animation parameters.
4. The method according to claim 3, characterized in that, The second instruction also includes a sub-instruction that, after the first startup animation finishes playing, retains the first animation identifier and the animation parameters of the first startup animation stored locally, based on the sub-instruction.
5. The method according to any one of claims 2-4, characterized in that, The response to the second operation, continuously playing the first startup animation, further includes: In response to the second operation, a third animation parameter for the first startup animation is calculated, the third animation parameter being different from the first animation parameter; Based on the third instruction, the animation parameters of the first startup animation stored locally are retrieved according to the first animation identifier; The third animation parameter is updated to the animation parameters of the first startup animation stored locally, and the first startup animation is played based on the third animation parameter.
6. The method according to claim 5, characterized in that, Before calculating the third animation parameters of the first startup animation, the method further includes: Based on the fourth instruction, obtain the playback progress of the first startup animation; The calculation of the third animation parameters of the first startup animation includes: The third animation parameters of the first startup animation are calculated based on the playback progress of the first startup animation.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: During the playback of the second startup animation, a third operation is received that triggers the exit of the second application; In response to the third operation, the second startup animation is stopped, and the third exit animation of the second application is played.
8. The method according to claim 7, characterized in that, The response to the third operation, stopping the playback of the second startup animation and playing the third exit animation of the second application, includes: In response to the third operation, based on the fifth instruction, the playback of the second startup animation is stopped, and based on the first instruction, the playback of the third exit animation of the second application is resumed.
9. The method according to claim 7, characterized in that, The response to the third operation, stopping the playback of the second startup animation and playing the third exit animation of the second application, includes: In response to the third operation, a fourth animation parameter for the third exit animation is calculated, the fourth animation parameter including one or more frames of animation parameters for playing the third exit animation; Based on the third instruction, and according to the second animation identifier, find the animation parameters of the second startup animation stored locally; The fourth animation parameter is updated to the animation parameters of the second startup animation stored locally, and the third exit animation is played based on the fourth animation parameter.
10. The method according to any one of claims 1-9, characterized in that, The method further includes: Based on the sixth instruction related to the first startup animation, delete the information related to the first startup animation stored locally.
11. The method according to any one of claims 2-10, characterized in that, The first animation parameters include one or more of the following: the position of the animation window, the size of the animation window, the scaling matrix of the animation, the rotation matrix of the animation, the transparency of the animation, and the color of the animation.
12. The method according to claim 10, characterized in that, The first instruction includes the START instruction, the second instruction includes the CREAT instruction, the third instruction includes the UPDATE instruction, the fourth instruction includes the QUERY instruction, the fifth instruction includes the CANCEL instruction, and the sixth instruction includes the DELETE instruction.
13. An electronic device, characterized in that, The electronic device includes: one or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-12.
14. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-12.
16. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-12.