Display method for electronic device, and electronic device and storage medium

By decoupling the animation drawing and rendering process from the rendering thread to the UI thread, the problem of stuck animation interfaces on electronic devices when the main thread load is high is solved and the user experience is improved.

WO2024193666A1PCT designated stage expired Publication Date: 2024-09-26HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/083106
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-22
Filing Date
2024-03-21
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

When the load on the main thread of existing electronic devices is high, the animation interface is prone to freezes, affecting the user experience.

Method used

By decoupling the animation drawing and rendering process from the rendering thread to the UI thread, it ensures that animation and UI threads run independently, and animation display will not be affected even if the UI thread load is high.

Benefits of technology

It effectively solves the animation interface stuck problem caused by high main thread load and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083106_26092024_PF_FP
    Figure CN2024083106_26092024_PF_FP
Patent Text Reader

Abstract

The embodiments of the present application provide a display method for an electronic device, and an electronic device and a storage medium. The method comprises: an electronic device receiving a first operation of a user, wherein the first operation is used for triggering the playing of a first animation of a first application; according to the first animation and in response to the first operation, the electronic device acquiring first initial attribute information and first end point attribute information by means of calling a UI thread; on the basis of the first initial attribute information and the first end point attribute information, the electronic device determining, by means of a rendering thread, at least one piece of first intermediate attribute information corresponding to the first animation; on the basis of the first initial attribute information, the first end point attribute information and the at least one piece of first intermediate attribute information, the electronic device executing drawing and rendering processes of the first animation by means of the rendering thread so as to obtain M image frames of the first animation; and the electronic device playing the first animation on the basis of the M image frames. Thus, the decoupling of an animation and a UI thread is realized, and the problem of an animation interface lagging due to the high load of a UI thread can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Display method of electronic device, electronic device and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on March 22, 2023, with application number 202310294472.1 and application name "A display method for an electronic device, an electronic device and a storage medium", the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present invention relates to the field of electronic technology, and in particular to a display method of an electronic device, an electronic device, and a storage medium. Background Art

[0004] With the continuous development of information technology, electronic devices have become an indispensable tool in people's lives. For example, users can install various applications (APPs) on electronic devices. In order to provide users with a better user experience, electronic devices will play an animation when launching or exiting an application.

[0005] When an application runs, it creates a process consisting of a main thread (i.e., the UI thread) and a rendering process. In the current animation framework, the UI thread handles business events, animation execution, and page measurement, layout, and drawing. The rendering thread is awakened by the business thread for each frame to synchronize data. After synchronization, the rendering thread performs rendering. If the UI thread is busy, takes a long time, or is under high load, animation drawing can be delayed, resulting in frame drops, interface lag, and other issues, resulting in a poor user experience.

[0006] Summary of the Invention

[0007] Embodiments of the present application provide a display method for an electronic device, an electronic device, and a storage medium, which are applied to an electronic device with a display screen to solve the problem of animation interface freeze caused by high main thread load.

[0008] In a first aspect, an embodiment of the present application provides a display method for an electronic device, which is applied to an electronic device with a display screen, the method comprising: the electronic device receives a first operation from a user, the first operation being used to trigger the playback of a first animation of a first application; the electronic device performs the first animation, in response to the first operation, by calling a UI thread to obtain first initial attribute information and first endpoint attribute information; based on the first initial attribute information and the first endpoint attribute information, the electronic device determines at least one first intermediate attribute information corresponding to the first animation through a rendering thread; based on the first initial attribute information, the first endpoint attribute information and the at least one first intermediate attribute information, the electronic device executes the drawing and rendering process of the first animation through a rendering thread to obtain M image frames of the first animation; the electronic device plays the first animation based on the M image frames.

[0009] Based on this method, the first initial attribute information and the first end point attribute information are obtained by calling the UI thread, and the calculation, drawing and rendering process of the first animation are executed through the rendering thread, thereby realizing decoupling of the animation and the UI thread. In this way, even if the UI thread load is high or the processing of time-consuming business logic is time-consuming, it will not affect the animation display, thereby solving the problem of animation interface freeze caused by high load of the main thread (UI thread).

[0010] In one possible design, any attribute information among the first initial attribute information, the first endpoint attribute information, and at least one first intermediate attribute information includes at least one of the following: X-direction scaling ratio; Y-direction scaling ratio; X-direction displacement; Y-direction displacement; clipping value from the left border; clipping value from the right border; clipping value from the top; clipping value from the bottom; transparency; and rounded corner attribute value.

[0011] In one possible design, the electronic device may also receive a second operation from the user while playing the first animation, where the second operation is used to trigger the playing of the second animation of the first application; the electronic device responds to the second operation by calling the UI thread to obtain the second endpoint attribute information; based on the second initial attribute information and the second endpoint attribute information, the electronic device determines at least one second intermediate attribute information corresponding to the second animation through the rendering thread, where the second initial attribute information is the attribute information corresponding to the image frame displayed when the electronic device receives the second operation; based on the second initial attribute information, the second endpoint attribute information, and at least one second intermediate attribute information, the electronic device executes the drawing and rendering process of the second animation through the rendering thread to obtain N image frames of the second animation; the electronic device plays the second animation based on the N image frames. With this design, when the second operation is received while playing the first animation, the electronic device can directly play the second animation, thereby realizing an animation interruptible mechanism, without having to wait for the first animation to finish playing before playing the second animation, thereby improving the user experience.

[0012] In one possible design, before the electronic device receives the user's first operation, it includes: the electronic device displays the main interface; the first animation is the startup animation of the first application; after the electronic device receives the user's second operation, it also includes: if the operation distance of the second operation is less than a threshold, the second animation is determined to be a hand-following animation; or, if the operation distance of the second operation is greater than or equal to the threshold, the second animation is determined to be an animation of returning to the main interface.

[0013] In a possible design, when the electronic device receives the first operation from the user, the first application is in the startup state, the first animation is the exit animation of the first application, and the second animation is the reverse animation of the exit animation.

[0014] In a possible design, the attribute information corresponding to the M image frames of the first animation and the attribute information corresponding to the N image frames of the second animation conform to an elastic curve, thereby achieving a smooth transition from the first animation to the second animation.

[0015] In a possible design, the animation leash corresponding to the second animation is the same as the animation leash corresponding to the first animation. The first animation and the second animation are both animations drawn by the same animation leash, so the first animation and the second animation belong to the same animation segment, and there will be no problem of unnatural transition when switching between the first animation and the second animation.

[0016] In a second aspect, an embodiment of the present application further provides an electronic device comprising modules / units for executing any of the possible design methods of any of the above aspects. These modules / units may be implemented by hardware, or by executing corresponding software implementations through hardware.

[0017] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a display screen; the display screen is used to display a user interface; the memory is used to store one or more computer programs, which, when executed by the processor, enable the electronic device to execute the method in the above-mentioned first aspect and any possible design of the first aspect.

[0018] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes the above-mentioned first aspect and any possible design method of the first aspect.

[0019] In a fifth aspect, an embodiment of the present application further provides a method comprising a computer program product, which, when the computer program product is run on a terminal, enables the electronic device to execute the above-mentioned first aspect and any possible design of the first aspect.

[0020] For the beneficial effects of the second to fifth aspects above, please refer to the beneficial effects of the first aspect and will not be repeated. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] FIG1 is a schematic diagram of the hardware structure of a mobile phone provided in an embodiment of the present application;

[0022] FIG2A is a schematic diagram of the software structure of a mobile phone provided in an embodiment of the present application;

[0023] FIG2B is a schematic diagram of an elasticity curve provided in an embodiment of the present application;

[0024] FIG3 is a schematic diagram of a flow chart of a display method of an electronic device provided in an embodiment of the present application;

[0025] FIG4A is a schematic diagram of the main interface provided in an embodiment of the present application;

[0026] FIG4B is a schematic diagram of an image frame of a WeChat startup animation provided in an embodiment of the present application;

[0027] FIG4C is a schematic diagram of the WeChat interface provided in an embodiment of the present application;

[0028] FIG5 is a timing diagram of an interruptible application startup according to an embodiment of the present application;

[0029] 6A to 6D are schematic diagrams of a set of user interfaces provided in an embodiment of the present application;

[0030] FIG6E is a schematic diagram of image frames of a hand-following animation provided in an embodiment of the present application;

[0031] FIG7A is a schematic diagram of a point reporting method in a hand-following scenario according to an embodiment of the present application;

[0032] FIG7B is a schematic diagram of an elasticity curve provided in an embodiment of the present application;

[0033] 8A to 8D are schematic diagrams of a set of user interfaces provided in an embodiment of the present application;

[0034] FIG8E is a schematic diagram of image frames of a return-to-HOME animation provided in an embodiment of the present application;

[0035] FIG9 is a timing diagram of an interruptible application exit according to an embodiment of the present application;

[0036] FIG10 is a schematic diagram of image frames of a return-to-HOME animation provided in an embodiment of the present application;

[0037] 11A to 11E are schematic diagrams of a set of user interfaces provided in an embodiment of the present application;

[0038] 12A to 12C are schematic diagrams of a set of user interfaces provided in an embodiment of the present application;

[0039] 13A to 13E are schematic diagrams of a set of user interfaces provided in an embodiment of the present application;

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

[0041] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship.

[0042] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0043] The "multiple" involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first" and "second" are only used for the purpose of distinguishing the description and cannot be understood as indicating or implying relative importance or order.

[0044] This application provides a display method for an electronic device, an electronic device, and a storage medium for resolving the issue of animation interface lag caused by high main thread load. The method and the electronic device are based on the same technical concept. Since the method and the electronic device solve the problem based on similar principles, the implementation of the electronic device and the method can refer to each other, and any repetitions will not be repeated.

[0045] In the solution provided in the embodiment of the present application, business event processing and page measurement and layout are performed in the UI thread, and the animation is uniformly processed, calculated and drawn in the rendering thread, thereby decoupling the animation from the UI thread. In this way, even if the UI thread is highly loaded or the processing of business logic takes a long time, it will not affect the animation display, and the problem of animation interface freezes caused by high load on the main thread can be solved.

[0046] Below, some terms in this application are explained to facilitate understanding by those skilled in the art.

[0047] (1) Electronic devices are devices equipped with a display screen and capable of human-computer interaction through the display screen. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a netbook, a car-mounted device, a business intelligent terminal (including: videophone, conference desktop intelligent terminal, etc.), a personal digital assistant (PDA), an augmented reality (AR)\virtual reality (VR) device, etc. The electronic device includes a device capable of realizing data processing functions (such as a processor, or an application processor, or an image processor, or other processors), and a device capable of displaying a user interface (such as a display screen). Exemplary embodiments of the electronic device include but are not limited to a device equipped with Or devices with other operating systems. The electronic device may also be other portable devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present application, the electronic device 01 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel). The embodiments of the present application do not limit the specific form of the electronic device.

[0048] (2) Interface, also known as user interface (UI), is presented on the display screen. It is the medium interface for interaction and information exchange between the application or operating system in the electronic device and the user. It can realize the conversion between the internal form of information and the user's visual form. The commonly used form of user interface is graphical user interface (GUI), which refers to the user interface related to computer operation displayed in a graphical way. It can be an interface element such as an icon, window, control, etc. displayed on the display screen of the electronic device. The control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc.

[0049] (3) A process is a computer program's activity on a set of data. It is the basic unit for resource allocation and scheduling in the system and the foundation of the operating system structure. When an application is started, the application's process is created.

[0050] (4) A thread is the smallest unit that an operating system can schedule operations on. It is contained within a process and is the actual operating unit within the process. A thread refers to a single sequential flow of control within a process. A process can have multiple threads running concurrently, each executing different tasks in parallel. Multiple threads in the same process will share all system resources within the process, such as virtual address space, file descriptors, and signal processing.

[0051] The structure of the electronic device is further described with reference to the accompanying drawings.

[0052] FIG1 is only a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application. Based on the structure shown in FIG1 , other variant structures may exist. As shown in FIG1 , the electronic device 100 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include one or more of the following: a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light 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.

[0053] The following is a detailed introduction to the components of the electronic device 100 shown in FIG1 .

[0054] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. The processor is the nerve center and command center of the electronic device 300. The processor may generate an operation control signal based on the instruction opcode and the timing signal to complete the control of instruction fetching and execution.

[0055] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory, thereby avoiding repeated accesses and reducing processor 110 latency, thereby improving system efficiency.

[0056] In some embodiments, the processor 110 may include one or more interfaces. For example, the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface. It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation of the electronic device 100.

[0057] The charging management module 140 is configured to receive charging input from a charger. The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The wireless communication function of the electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, a modem processor, and a baseband processor.

[0058] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0059] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0060] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0061] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0062] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with a network and other devices via wireless communication technology.

[0063] The electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0064] In some other embodiments, the electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0065] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0066] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and an application required for at least one function. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0067] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0068] Although not shown in FIG. 1 , the electronic device 100 may further include a Bluetooth device, a positioning device, a flashlight, a micro-projection device, a near field communication (NFC) device, etc., which are not described in detail here.

[0069] It is understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in FIG1 , or may combine or separate certain components, or may have different component arrangements. The components shown in FIG1 may be implemented in hardware, software, or a combination of software and hardware.

[0070] The following embodiments can all be implemented in the electronic device 100 having the above hardware structure.

[0071] The software system of the electronic device can adopt a layered architecture, event-driven architecture, micro-core architecture, micro-service architecture, or cloud architecture. system) as an example to illustrate the software structure of the electronic device.

[0072] Figure 2A illustrates a schematic diagram of the layered software structure of an electronic device provided by an embodiment of the present application. The layered architecture divides the software system of an electronic device into several layers, each with clear roles and divisions of labor. The layers communicate with each other through software interfaces.

[0073] In some embodiments, the Android system is divided into five layers: the application layer (applications), the application framework layer (application framework), the system runtime layer (Native), the hardware abstraction layer (HAL), and the kernel layer (kernel). The embodiments of the present application do not limit the layering of the software structure of the electronic device. It should be understood that Figure 2A also adds the hardware layer of the electronic device on the basis of the Android system.

[0074] It should be understood that the modules included in each layer shown in FIG2A are modules involved in the embodiments of the present application. The modules included in each layer below do not constitute a limitation on the structure of the electronic device and the hierarchy of module deployment (illustrative example). In one embodiment, the modules shown in FIG2A can be deployed separately, or several modules can be deployed together. The division of modules in FIG2A is an example. In one embodiment, the names of the modules shown in FIG2A are illustrative examples.

[0075] The application layer may include a series of application packages. The application layer may include, but is not limited to, applications such as camera, gallery, calendar, call, map, navigation, Bluetooth, music, video, and short message. In some embodiments, the application layer also includes a desktop launcher (Launcher). Launcher is the desktop launcher in the Android system, and the desktop interface (user interface, UI) of the Android system is collectively referred to as Launcher. Among them, the desktop interface includes icons of various applications installed on the electronic device. Exemplarily, the desktop interface includes a phone icon, an email icon, a calendar icon, a camera icon, etc. Users can start the corresponding application by clicking on these shortcut icons.

[0076] When an application is running, the electronic device creates a process for the application to perform all tasks in the application (such as accessing the network, displaying the user interface, refreshing the user interface, etc.). Multiple tasks in the application are assigned to each thread in the process for specific execution. A process may include a UI thread and multiple non-UI threads. The UI thread may also be referred to as the main thread. The UI thread runs in the Launcher. The non-UI thread is, for example, the rendering thread (RenderThread) in Figure 2A. The rendering thread is in the system library. In an embodiment of the present application, event processing, measurement, layout, etc. are performed in the UI thread, and functions such as animation execution and drawing are sunk into the rendering thread in the system library, so as to achieve decoupling of animation from the UI thread, thereby reducing the load of the UI thread, and thus solving problems such as animation frame drops and interface freezes due to excessive UI thread load.

[0077] Launcher includes application window animation, View animation and physical animation engine. Application window animation can create animation tasks such as application startup, swiping up and application exit. View animation can create animation tasks such as desktop background startup and desktop background return. The physical animation engine can generate displacement animation, scaling animation, transparency animation and cropping animation, etc.

[0078] The application framework layer can provide an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer can include some predefined functions.

[0079] As shown in FIG. 2A , the application framework layer may include a spring animation F interface, an activity manager service (AMS), a window manager service (WMS), and a RenderNodeAnimator.

[0080] Among them, the physical animation engine can call the rendering thread through the spring animation F interface, so that the rendering thread can complete the calculation, drawing, and rendering of the corresponding animation.

[0081] AMS is used to manage the life cycle of each application and the navigation fallback function.

[0082] WMS is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0083] RenderNodeAnimator includes HwSurfaceSpringAnimator and HwViewSpringAnimator. HwSurfaceSpringAnimator can be used to implement window animation, and HwViewSpringAnimator can be used to implement view animation.

[0084] The application framework layer also includes functions that can be used to implement animation playback (start), cancellation (cancel), end (end), and update the end point value.

[0085] The system runtime layer (Native) includes the Java native interface (JNI), RenderThread, and surface flinger (SF). JNI is a feature of Java calling the Native language.

[0086] RenderThread includes window attribute animation, view attribute animation, spring curve, window / view attribute calculation module and rendering module. Window attribute animation can be used to generate displacement animation, scaling animation, transparency animation and cropping animation for the window that conforms to the spring curve, and view attribute animation can be used to generate displacement animation, scaling animation, transparency animation, cropping animation and rotation animation for the View that conforms to the spring curve. The window / view attribute calculation module can be used to calculate the intermediate attribute information corresponding to each intermediate image frame based on the initial attribute information corresponding to the first frame image and the end attribute information corresponding to the last frame image of each attribute animation corresponding to the window / view. The rendering module is used to draw and render the various layers corresponding to each intermediate frame image of the attribute animation.

[0087] In an embodiment of the present application, the animation properties that need to be calculated for an animation include, but are not limited to, the X-direction scaling ratio (scaleX) and the Y-direction scaling ratio (scaleY) in the scale attribute, the X-direction displacement (translateX) and the Y-direction displacement (translateY) in the translate attribute, the cropping value (crop left), the cropping value (crop top), the cropping value (crop right), and the cropping value (crop bottom) from the left border in the cropping attribute, the transparency (alpha) attribute, and the corner radius attribute. Each animation property conforms to a spring curve, and each of these animation properties corresponds to a spring curve. It should be understood that when the animation is played, these spring curves start executing at the same time, and the end time may be different.

[0088] In the embodiment of the present application, the formula of the elasticity curve can be expressed as the following formula (1):

[0089] In formula (1), x′ is the initial attribute value, x(t) is the instantaneous attribute value at time t, represents exponential decay, Indicates periodic oscillation.

[0090] As shown in FIG2B , curve A is the elastic curve corresponding to the startup animation when the application is started. When the startup animation is interrupted before it is finished playing, the attribute endpoint will change. For example, when the application window is fully opened, scaleX is 1, and the scaleX of the application icon is 0.17. If the application startup animation is finished playing, the scaleX of the application window is enlarged from 0.17 to 1, as shown in FIG2B , the end point of curve A, that is, the end point value of the scaleX attribute of the startup animation is 1. It should be understood that curve A is an elastic curve that conforms to the above formula (1). When applied to the application startup scenario, the damping of the elastic curve can be set to overdamping, so that scaleX starts from 0 and continues to enlarge over time until it is enlarged to 1. During the process of continuous enlargement of scaleX, its value will not exceed 1. When the startup animation is interrupted during playback and then plays the return to HOME animation, for example, when the scaleX of the application window is enlarged from 0.17 to 0.6, it is interrupted by the user operation. As shown in curve B, scaleX will continue to enlarge from 0.6, for example, to 0.65, and then gradually shrink from 0.65, and the attribute end point value is 0.17. It should be understood that curve B is an elastic curve that conforms to the above formula (1). When applied to a scenario where the application startup is interrupted, the damping of the elastic curve can be set to underdamped. In this way, as shown in curve B, scaleX starts from 0.6 and changes over time, first amplifying to 0.65, then continuously shrinking to 0.15, and then amplifying to 0.17. Of course, the damping of the elastic curve can also be set to overdamped. In this case, in the return to HOME animation, scaleX starts from 0.6 and changes over time, first amplifying to 0.65, and then continuously shrinking to 0.17. When applying the elastic curve to different scenarios, the damping of the elastic curve can be set to overdamped or underdamped depending on the specific scenario, and this is not limited here. Here, the animation properties are only introduced using scaleX as an example. The animation properties such as scaleY, translateX, translateY, crop left, crop top, crop right, crop bottom, and alpha can be referred to scaleX and will not be repeated here. It should be understood that FIG2B is illustrated using scaleX, and the attribute value range of the vertical coordinate is set to 0 to 1. When the elastic curve is applied to other animation attributes, the attribute value range of the vertical coordinate can be 0 to 1 or other numerical ranges, which is not limited here.

[0091] The curve B may be composed of two parts, one part being the startup animation before being interrupted (called the old spring animation), and the other part being the exit animation after the startup animation is interrupted (called the new spring animation).

[0092] Among them, the initial speed of the new spring animation The instantaneous velocity v of the old spring animation can beold (t) is determined, and the specific determination method is as follows:

[0093] In the above formula (2), t is the moment when the old spring animation is interrupted.

[0094] Update the equilibrium position of the spring animation using the following formula (3) And update the initial amplitude by the following formula (4)

[0095] In an embodiment of the present application, a window attribute animation and a view attribute animation engine are constructed in the system library, and the window animation engine and the view attribute animation engine are connected to the original animation rendering framework, so as to ensure the consistency of the window and the original animation rendering. Taking the startup application A as an example, the UI thread is used to obtain the layout information of the page of application A, the initial attribute information of the startup animation of application A, and the end attribute information, wherein the initial attribute information can be the attribute information corresponding to the first frame image of the startup animation, and the end attribute information is the attribute information corresponding to the last frame image of the startup animation. The rendering thread can generate the intermediate attribute information corresponding to each intermediate image frame between the first frame image and the last frame image of the startup animation based on the initial attribute information and the end attribute information obtained by the UI thread, and draw according to the intermediate attribute information corresponding to each intermediate image frame, and render the drawn image to obtain each frame of image data to be displayed.

[0096] The layer synthesizer is used to perform layer synthesis on each layer corresponding to each frame of the rendered image to obtain each frame of the attribute animation to be displayed.

[0097] The Hardware Abstraction Layer (HAL) is an interface layer located between the application framework layer and the kernel layer. It is an encapsulation of the Linux driver and provides a unified interface to the upper layer. The upper layer application does not need to know how the lower layer hardware is implemented, shielding the details of the underlying implementation.

[0098] The kernel layer may include hardware drivers for driving hardware operations. As shown in FIG2A , the driver layer includes a display driver for driving a display screen to display a user interface. Optionally, the kernel layer may also include sensor drivers, graphics processing unit drivers (GPU drivers), etc., which are not limited in this embodiment of the present application.

[0099] The hardware layer includes the hardware in the electronic device. It can be understood that the hardware layer in FIG2A shows the display screen and the like involved in the following embodiments.

[0100] The display method of the electronic device provided by the embodiment of the present application is described below with reference to the accompanying drawings. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0101] See 3, which is a flow chart of a display method of an electronic device provided in an embodiment of the present application. As shown in FIG3 , the flow may include the following steps:

[0102] Step 301: The electronic device receives a first operation from a user, where the first operation is used to trigger the playing of a first animation of a first application.

[0103] For example, the first operation is a click operation on the icon of the first application. The electronic device receives the click operation and, in response to the click operation, starts the first application. In this example, the stage from when the application receives the click operation of the user triggering the start of the first application to when the electronic device displays the main interface of the first application is called the startup phase of the application. The first animation is a startup animation played during the startup phase of the first application. For example, the startup animation includes M frames of image frames, where M is a positive integer. The startup animation can be composed of M frames of image frames that are suspended and displayed on the user interface of the electronic device in a predetermined order, and according to a preset window size, preset display time, preset display position, preset transparency, and preset display elements. In the startup animation, the size of the M frames of image frames gradually increases from a preset minimum size to a preset maximum size. The preset minimum size can be the same as the size of the application icon, and the preset maximum size can be the same as the size of the display screen of the electronic device.

[0104] For another example, an electronic device displays the user interface of a first application, which fills the entire display screen. The first operation in step 301 is a swipe-up operation. The electronic device receives the swipe-up operation and, in response to the swipe-up operation, exits the first application. In this example, the phase from receiving the user's swipe-up operation to exit the application until the electronic device displays the main interface is called the application's exit phase. In this scenario, the first animation is an exit animation played during the exit phase of the first application. For example, the exit animation includes N image frames, where N is a positive integer. The exit animation can be composed of N image frames displayed in a predetermined order, according to a preset window size, preset display time, preset display position, preset transparency, and preset display elements, suspended on the user interface of the electronic device. In the exit animation, the size of the N image frames gradually decreases from a preset maximum size to a preset minimum size. The preset maximum size can be the same as the size of the electronic device's display screen, and the preset minimum size can be the same as the size of the application icon.

[0105] Step 302: In response to the first operation, the electronic device obtains initial attribute information and end attribute information corresponding to the first animation by calling a UI thread.

[0106] The initial attribute information is the attribute information corresponding to the first frame of the first animation, and the endpoint attribute information is the attribute information corresponding to the last frame of the first animation. Taking the first animation as a startup animation including M frames as an example, the first frame is the first frame among the M frames, and the last frame is the Mth frame among the M frames. The M-2 frames other than the first and last frames can be collectively referred to as intermediate frames. In this example, the M-2 intermediate frames are respectively the second frame, the third frame, ..., the M-1th frame. M is an integer greater than 1.

[0107] Step 303: Based on the initial attribute information and the end attribute information, the electronic device determines at least one intermediate attribute information corresponding to the first animation through a rendering thread.

[0108] In the first animation, each intermediate image frame, excluding the first and last image frames, corresponds to one piece of intermediate attribute information. For example, if the first animation includes M frames, the M frames include M-2 intermediate image frames, each of which corresponds to one piece of intermediate attribute information, and the M-2 intermediate image frames correspond to M-2 pieces of intermediate attribute information.

[0109] In an embodiment of the present application, any attribute information in the initial attribute information, the intermediate attribute information, and the end attribute information may include but is not limited to scaleX, scaleY, translateX, translateY, crop left, crop top, crop right, crop bottom, alpha, and corner radius.

[0110] Step 304: Based on the initial attribute information, the end attribute information and the at least one intermediate attribute information, the electronic device executes a drawing process and a rendering process of the first animation through a rendering thread.

[0111] After completing step 304 , the electronic device can obtain M frames of images corresponding to the first animation and then proceed to step 305 .

[0112] Optionally, after the rendering process, the layers corresponding to each image frame are obtained, and then the first electronic device can also synthesize the layers corresponding to each image frame to obtain each image frame, and then execute step 305 based on the obtained M frame images.

[0113] Step 305: The electronic device plays the first animation.

[0114] The following is an introduction using the scenario of launching the WeChat application as an example, and FIG4A exemplarily shows a schematic diagram of the main interface.

[0115] As shown in FIG4A , the electronic device displays a main interface 410, which includes icons of various applications, such as the icon 400 of the WeChat application shown in FIG4A . At time t1 , the electronic device receives a click operation on the icon 400 of the WeChat application. The electronic device starts the WeChat application in response to the click operation and plays the startup animation of the WeChat application. The startup animation includes multiple image frames. During the playback of the startup animation, the image frames played in sequence can show that the size of the WeChat application window gradually increases. The first image frame is the WeChat application icon 400 shown in FIG4A . As shown in FIG4B , the size of the first frame image 401 at time t1 is consistent with the size of the WeChat application icon 400. The original size of the application window (i.e., the size of the icon 400) can be called the preset minimum size.

[0116] Afterwards, as shown in Figure 4B, the size of the WeChat application window gradually increases. In the startup animation, at time t2, the first frame image frame 401 gradually increases from the preset minimum size to image frame 402; afterward, the size of the WeChat application window continues to increase, for example, at time t3, it gradually increases from image frame 402 to image frame 403; afterward, the size of the WeChat application window continues to increase, for example, at time t4, it gradually increases from image frame 403 to image frame 404; afterward, the size of the WeChat application window continues to increase, for example, at time t5, it gradually increases from image frame 404 to image frame 405; afterward, the size of the WeChat application window continues to increase, for example, at time t6, it gradually increases from image frame 405 to image frame 406; at time t7, the size of the WeChat application window changes to a preset maximum size, which is consistent with the size of the display area of ​​the display screen, that is, full-screen display, for example, it gradually increases from image frame 406 to image frame 407, and image frame 407 is the user interface 420 of the WeChat application shown in Figure 4C.

[0117] It should be understood that the image content of each of the above-mentioned image frames 401 to 407 may not display any elements, or may display one or more elements, and this application does not limit this. When the application is launched, the electronic device can play a startup animation during the startup phase of the application. The startup animation includes multiple image frames, and the display position and size of each image frame can be different. During the startup animation, the electronic device displays image frames 401 to 407 in sequence.

[0118] The above Figures 4A to 4B only describe the window animation of the WeChat application during the startup process of the WeChat application. When WeChat is started, the electronic device will also play the view animation. The view animation can be a background animation other than the window of the WeChat application. When the WeChat application is started, the background animation is reduced. The attribute values ​​of the view animation mainly involve but are not limited to scaleX and scaleY. For example, the attribute value scaleX is proportionally reduced from 1.0 to 0.7 times the original size X0, and the attribute value scaleY is proportionally reduced from 1.0 to 0.7 times the original size Y0. It should be understood that in the exit scene of the WeChat application, in addition to playing the exit animation of the WeChat application window, the electronic device will also play the view animation. The attribute value of the view animation in this scene gradually increases; if the view animation is interrupted in the exit scene, the attribute value of the view animation will first increase and then decrease. The principle is similar to the exit animation, and will not be repeated hereafter.

[0119] In some other embodiments, before the above-mentioned first application has been started and the interface of the application is displayed, the electronic device receives a second operation, such as a swipe-up operation, which is used to trigger the playback of the second animation. That is, before the first animation is finished playing, the second operation interrupts the playback of the first animation. Since the first animation is interrupted, for example, when the first animation plays the i-th image frame, the electronic device receives the second operation, and then the electronic device plays the second animation, thereby realizing the animation interruptibility mechanism without waiting for the first animation to finish playing before playing the second animation, thereby improving the user experience. The initial attribute information of the second animation can be the attribute information corresponding to the i-th image frame of the first animation. The electronic device can determine the specific scene based on the sliding distance of the swipe-up operation on the display screen. For example, if the sliding distance is less than a preset threshold, the second animation is a hand-following animation; if the sliding distance is greater than or equal to the preset threshold, the second animation is a return to the main interface (HOME) animation.

[0120] In the embodiment of the present application, the attribute information corresponding to the M image frames of the first animation and the attribute information corresponding to the N image frames of the second animation conform to an elastic curve, thereby achieving a smooth transition from the first animation to the second animation.

[0121] In some embodiments, the animation leash corresponding to the second animation is the same as the animation leash corresponding to the first animation. The first animation and the second animation are both animations drawn by the same animation leash, so the first animation and the second animation belong to the same animation segment, and there will be no problem of unnatural transition when switching between the first animation and the second animation.

[0122] Figure 5 exemplifies a timing diagram of an application startup that can be interrupted. As shown in Figure 5, the timing diagram includes the following steps:

[0123] S1: The UI thread receives an operation for application 1.

[0124] Exemplarily, the operation on the application 1 may be a click operation. The user clicks the icon of the application 1. The electronic device receives the click operation and starts the application 1 in response to the click operation.

[0125] S2, the UI thread notifies the Framework to start application 1.

[0126] S3, UI thread creates startup animation.

[0127] S4, the UI thread registers the startup animation with the Framework.

[0128] S5, the UI thread requests animation leash from the Framework.

[0129] Correspondingly, after receiving the request, the Framework prepares to start the startup animation and creates the startup animation leash. The UI can use the startup animation leash to control the attribute information of each image frame in the startup animation.

[0130] S6, Framework notifies the UI thread to start the application startup animation.

[0131] S7, the UI thread notifies the Framework to create a spring animation.

[0132] S8, Framework sends a create instruction to the rendering thread.

[0133] The create instruction is used to instruct the rendering thread to create a spring animation. Correspondingly, after receiving the create instruction, the rendering thread calculates the properties of the spring animation, and draws and renders M frames of image frames according to the calculation results.

[0134] The UI thread obtains the initial attribute information of the image frame in the startup animation, and then calculates the intermediate attribute information of the next image frame based on the initial attribute information, and so on, until the intermediate attribute information of all image frames in the startup animation is calculated.

[0135] S9, the UI thread sends a start instruction to the Framework, where the start instruction is used to instruct the application startup animation to start playing.

[0136] S10, Framework sends a start instruction to the rendering thread.

[0137] Correspondingly, after receiving the start instruction, the rendering thread sends the rendered M image frames to the display for playback, and executes S11 after the playback is completed.

[0138] S11, after the startup animation is finished playing, the rendering thread sends an end message to the Framework.

[0139] The end message is used to notify the UI thread that the application startup animation playback has ended.

[0140] S12, the Framework notifies the UI thread that the application startup animation is finished.

[0141] For example, when the electronic device displays the main interface shown in FIG4A and receives a click operation on the WeChat icon 400, the startup animation of the WeChat application includes image frames at times t1 to t7, and the playback order of these image frames is: image frame 401 at time t1, image frame 402 at time t2, image frame 403 at time t3, image frame 404 at time t4, image frame 405 at time t5, image frame 406 at time t6, and image frame 407 at time t7.

[0142] Before the startup animation ends, if the electronic device receives an interruption operation to interrupt the startup animation, such as a swipe up operation, the startup animation will be interrupted. The electronic device can determine the scene according to the swipe up operation and then play the corresponding animation.

[0143] S13, the UI thread receives an interrupt operation.

[0144] S14, the UI thread processes the interrupt gesture.

[0145] Exemplarily, when the interruption operation is a swipe-up operation, for example, the UI thread can determine the swipe distance corresponding to the swipe-up operation. If the swipe distance is less than the threshold, S15 to S22 are executed; if the swipe distance is greater than or equal to the threshold, S23 to S30 are executed.

[0146] For example, the WeChat app's startup animation plays from the icon size at time t1 to image frame 405 at time t5. Upon receiving an upward swipe operation, the electronic device displays the user interface shown in FIG6A . If the swipe distance of the upward swipe operation is less than a threshold, it is determined to be a hand-following scenario. At time t6, the next moment after time t5, image frame 601 is displayed. The size of image frame 601 at time t6 can be larger than image frame 405 at time t5. At this point, the electronic device displays the user interface shown in FIG6B . Image frame 601 is then reduced in size, and image frame 602 is displayed at time t7. At this point, the electronic device displays the user interface shown in FIG6C . Image frame 602 then follows the user's finger as it slides. For example, image frame 602 is also displayed at time t8, the next moment after time t7. However, the position of image frame 602 displayed at time t7 is different from that of image frame 602 displayed at time t8. Image frame 602 follows the user's finger until the user's finger leaves the display screen.

[0147] When the user's finger leaves the display screen, the return to HOME animation starts playing. For example, when the finger leaves the display screen at time t8, the first frame of the return to HOME animation is image frame 602 at time t8, and the last frame is image frame 605 as shown in Figure 6D. The content displayed in image frame 605 is the icon of the WeChat application.

[0148] As shown in FIG6E , the playback order of the image frames in the hand-following animation is: image frame 405 at time t5 , image frame 601 at time t6 , image frame 602 at time t7 , and image frame 602 at time t8 .

[0149] The playback order of the image frames in the return-to-HOME animation is: image frame 602 at time t8, image frame 603 at time t9, image frame 604 at time t10, and image frame 605 at time t11. When the user's finger leaves the display, the animation speed follows curve B shown in Figure 2B. The speed does not suddenly change at the moment of release, and the follow-up spring and the release spring smoothly connect. The user inherits the hand speed the moment the finger leaves the display, and the animation speed continues to increase before smoothly decreasing.

[0150] It should be understood that the image content of each of the above-mentioned image frames 601 to 605 may not display any elements, or may display one or more elements, and this application does not limit this.

[0151] S15, UI thread creates hand-following animation.

[0152] S16, the UI thread requests the Framework to perform window animation leash.

[0153] S17, Framework notifies the UI thread to reuse the start animation leash.

[0154] S18, UI thread starts window and hand animation.

[0155] S19, the UI thread notifies the Framework to update the animation end value.

[0156] As shown in FIG7A , the dotted line is a curve of a series of TP reporting point fitting in the hand-following stage, and the solid line is a curve of the applied window movement trajectory, which is smoother than the curve of the reporting point fitting.

[0157] S20, the Framework notifies the rendering thread to update the end value (updateFinalValue).

[0158] After the rendering thread updates the animation endpoint value, it performs hand-following animation calculations, draws and renders each image frame corresponding to the hand-following animation according to the calculation results, and then sends each image frame to the display for playback, and executes S21 after the playback is completed.

[0159] Exemplarily, for the hand-following animation, 9 animation properties need to be calculated, namely scaleX and scaleY in the scale attribute, translateX and translateY in the translation attribute, crop left, crop top, crop right, crop bottom in the crop attribute, and transparency (alpha) attribute. Each animation property conforms to the spring curve shown in Figure 7B. When playing the hand-following animation, these 9 animation properties start executing at the same time, and the end time may be different. Taking scaleX as an example, the maximum size of scaleX is 1. As shown in Figure 7B, the startup animation is played during the application opening stage. For example, when the startup animation is played to scaleX of 0.6, it is interrupted. Afterwards, as shown in curve D in Figure 7B, scaleX will first enlarge and then shrink, with a smooth transition, instead of directly shrinking at the interruption point as in the prior art (such as curve C). In the embodiment of the present application, each property changes according to curve D, which can improve the smoothness of the animation.

[0160] S21, the rendering thread sends an end message to the Framework.

[0161] S22, Framework notifies the UI thread to call back after the hand animation ends.

[0162] For example, when the startup animation of the WeChat application plays to the image frame 405 at time t5 as shown in Figure 8A, an interruption operation is received. For example, the interruption operation is a swipe up operation. As the user slides his finger, the image frame 405 moves with the hand. For example, the image frame 801 is displayed at time t6, and the electronic device displays the user interface shown in Figure 8B. The size of the image frame 801 at time t6 and the image frame 405 at time t5 can be the same, but the display position on the display screen can be different. Exemplarily, when the interruption operation is a swipe up operation, when the sliding distance of the swipe up operation is greater than or equal to the threshold, it means that the application scene is exited, so it is necessary to play the animation of returning to the main interface (HOME).

[0163] S23, the UI thread creates the application return HOME animation.

[0164] S24, the UI thread requests animation leash from the Framework.

[0165] S25, Framework notifies the UI thread to reuse the start animation leash.

[0166] S26, UI thread starts HOME animation.

[0167] S27, the UI thread notifies the Framework to update and return the end value of the HOME animation.

[0168] S28, Framework notifies the rendering thread to update the end value (updateFinalValue).

[0169] After the rendering thread updates the animation endpoint value, it calculates the return to HOME animation, draws and renders multiple image frames corresponding to the return to HOME animation according to the calculation results, and then sends the multiple image frames to the display for playback, and executes S29 after the playback is completed.

[0170] The user's finger leaves the display screen at time t6, and the first image frame of the return HOME animation is image frame 801 in the user interface as shown in FIG8B , and the last frame is image frame 806 in the user interface as shown in FIG8D .

[0171] After the finger leaves the display screen, the image frame in the return to HOME animation can be enlarged and then reduced. As shown in the user interface of FIG8C , image frame 802 is displayed at time t7, and the size of image frame 802 can be larger than image frame 801 at time t6.

[0172] For example, as shown in FIG8E , the animation after the user's finger leaves the display screen includes: image frame 801 at time t6, image frame 802 at time t7, image frame 803 at time t8, image frame 804 at time t9, image frame 805 at time t10, and image frame 806 at time t11. It should be understood that the image content of each of the above image frames 801 to 806 may not display any elements, or may display one or more elements, and this application is not limited to this.

[0173] S29, the rendering thread sends an end message to the Framework.

[0174] S30, Framework notifies the UI thread to return to the HOME animation end.

[0175] In the above example, the application's startup animation, hand-following animation, and exit animation reuse the same window animation leash. Therefore, the startup animation, hand-following animation, and exit animation are all in the same animation segment. There is no unnatural transition from the startup animation to the hand-following animation, nor is there an unnatural transition from the startup animation to the exit animation, and the animation is smooth.

[0176] In some other embodiments, after the first application has been started and the electronic device displays the interface of the first application, the electronic device receives a third operation, such as a swipe-up operation, which is used to trigger the playback of a third animation, that is, it is necessary to exit the first application, and the third animation is the exit animation. Afterwards, the electronic device receives a fourth operation, which is used to trigger the playback of a fourth animation; for example, the fourth operation is a click operation on the second application. If the click operation is received after the exit animation of the first application is played, the startup animation of the second application is played according to the click operation; if the click operation is received before the exit animation of the first application is played, the electronic device can play the return to HOME animation according to the click operation. The second application and the first application can be the same application or different applications.

[0177] Figure 9 exemplifies a timing diagram of an application exit that can be interrupted. As shown in Figure 9, the timing diagram includes the following steps:

[0178] S1, application 1 is open / started and receives interruption operations.

[0179] S2, UI thread processes the interrupt gesture.

[0180] Exemplarily, when the interruption operation is a swipe-up operation, for example, the UI thread can determine the swipe distance corresponding to the swipe-up operation. If the swipe distance is less than the threshold, S15 to S22 are executed; if the swipe distance is greater than or equal to the threshold, S23 to S30 are executed.

[0181] S3, UI thread creates hand-following animation.

[0182] S4, the UI thread requests the Framework to perform window animation leash.

[0183] S5, Framework notifies the UI thread to reuse and start the animation leash.

[0184] S6, UI thread starts window and hand animation.

[0185] S7, the UI thread notifies the Framework to update the animation end value.

[0186] S8, Framework notifies the rendering thread to update the end value (updateFinalValue).

[0187] S9, the rendering thread sends an end message to the Framework.

[0188] S10, Framework notifies the UI thread to call back after the hand animation ends.

[0189] S11, the UI thread creates an animation for the application to return to the main interface (HOME).

[0190] S12, the UI thread requests animation leash from the Framework.

[0191] S13, Framework notifies the UI thread to reuse the start animation leash.

[0192] S14, UI thread starts HOME animation.

[0193] S15, the UI thread notifies the Framework to update and return the end value of the HOME animation.

[0194] S16, the Framework notifies the rendering thread to update the end value (updateFinalValue).

[0195] After the rendering thread updates the animation endpoint value, it calculates the return to HOME animation, draws and renders K frames of image frames corresponding to the return to HOME animation according to the calculation results, and then sends the K frames of image frames to the display for playback, and executes S17 after the playback is completed.

[0196] S17, the rendering thread sends an end message to the Framework.

[0197] S18, Framework notifies the UI thread to return to the HOME animation end.

[0198] For the above S2 to S18, reference may be made to the relevant description of S14 to S30 in FIG5 , which will not be repeated here.

[0199] S19, the electronic device receives a click operation of clicking application 1.

[0200] If the return to HOME animation has finished playing when the click operation is received, S20 is executed in response to the click operation; if the return to HOME animation has not finished playing when the click operation is received, S21 to S26 are executed in response to the click operation.

[0201] S20, application 1 starts the process.

[0202] The S20 application 1 startup process can be found in S1 to S15 in FIG5 , which will not be described again here.

[0203] During the process of returning to the HOME animation, as shown in Figure 10, for example, the electronic device sequentially displays image frame 1001 at time t1, image frame 1002 at time t2, and image frame 1003 at time t3. When image frame 1003 at time t3 is played, a click operation is received, and the return to the HOME animation is interrupted. Then, the reverse animation of the return to the HOME animation is played until the electronic device displays the interface of application 1.

[0204] S21, the UI thread continues to use the leash of the return animation.

[0205] S22, the UI thread performs reverse animation on the return animation.

[0206] The reverse animation includes image frames that are first scaled down and then scaled up until the full-screen display of the user interface of application 1 is displayed. As shown in FIG10 , the reverse animation is played in the following order: image frame 1003 at time t3, image frame 1004 at time t4, image frame 1005 at time t5, image frame 1006 at time t6, and image frame 1001 at time t7.

[0207] S23, the UI thread notifies the Framework to update the animation end value.

[0208] S24, the Framework notifies the rendering thread to update the end value (updateFinalValue).

[0209] S25, the rendering thread sends an end message to the Framework.

[0210] S26, Framework notifies the UI thread that the animation has finished.

[0211] S27, switch application 1 to the foreground.

[0212] In the above example, the app's return-to-HOME animation and the reverse animation of the return-to-HOME animation both reuse the startup animation leash. Therefore, the return-to-HOME animation and the reverse animation of the return-to-HOME animation are the same animation. There will be no unnatural problem when switching from the return-to-HOME animation to the reverse animation of the return-to-HOME animation, and the animation is smooth.

[0213] In addition to being applicable to the startup and exit scenarios of the aforementioned applications, the embodiments of this application are also applicable to startup and exit scenarios for cards, folders, plug-ins, and split-screen combination icons. They support smooth transitions of attribute values ​​after animation interruptions, improving animation fluency. Furthermore, they can be applied to scenarios involving horizontal and vertical screen rotation, folding screen opening and closing, and internal and external screen switching. The embodiments of this application can also be applied to other scenarios involving animation switching or transitions.

[0214] The following describes the animation process of switching scenes when the folding screen opens and closes.

[0215] 11A to 11E are schematic diagrams showing changes in the user interface of the electronic device during the folding process of the inner folding screen from the unfolded state to the intermediate state, and from the intermediate state to the folded state.

[0216] As shown in Figure 11A, when the electronic device is in the expanded state, the user interface 1101 is displayed in full screen. The user interface 1101 can be the first image frame in the first animation, that is, the first interface when the inner folding screen is in the expanded state. The user interface 1101 includes multiple elements. The elements can be one or more of the icons of multiple applications, desktop widgets, large folders, status bars, page indicators, wallpaper pictures, etc. For example, the user interface 1101 shown in Figure 11A includes a mail application icon, a gallery application icon, a WeChat application icon, a settings application icon, a phone application icon, a text message application icon, a browser application icon, a Weibo application icon, etc. The desktop widgets may include a date component (for example, October 29, Wednesday), a time component (for example, 11:10), and a weather component (for example, Beijing, 10°C).

[0217] As shown in Figure 11B, the electronic device receives a user operation and causes screens A and B of the inner folding screen to begin folding in facing directions. The electronic device continues to play the first animation, that is, the electronic device begins to control the elements displayed on screens A and B to begin translating in the first direction. The electronic device displays user interface 1102 as shown in Figure 11B. User interface 1102 can be the second image frame in the first animation. The difference between user interface 1102 and user interface 1101 is that the display position of each element in user interface 1102 is different from the display position of each element in user interface 1101. Taking the email application icon as an example, in the first image frame, the display position of the email application icon is A. The electronic device adds a displacement to the display position of the email application icon to obtain the display position of the email application icon in the second image frame. In the second image frame, the display position of the email application icon is B. That is, in user interface 1102, the display position of the email application icon is B. Position B is different from position A.

[0218] As shown in Figure 11C , the electronic device receives a user action and continues to fold screens A and B of the inner foldable screen toward each other. The angle between screens A and B shown in Figure 11C is smaller than the angle between screens A and B shown in Figure 11B . The electronic device continues playing the first animation, i.e., the electronic device begins controlling the elements displayed on screens A and B to continue translating in the first direction. The electronic device displays user interface 1103 as shown in Figure 11C . User interface 1103 may be the third image frame in the first animation. User interface 1103 differs from user interface 1102 in that the display positions of the elements in user interface 1103 differ from those in user interface 1102, and the number of elements displayed in user interface 1103 is less than that in user interface 1102. For example, in the second image frame, the email application icon is displayed at position B. The electronic device adds the displacement to the display position of the email application icon to obtain the display position of the email application icon in the third image frame. In the third image frame, the email application icon is not visible. At the same time, the wallpaper image also starts to translate in the first direction, and the electronic device displays a black area as shown in Figure 11C on the right edge of screen B. Optionally, the width of the black area can be the same as the distance the wallpaper image translates in the first direction.

[0219] As shown in Figure 11D, the electronic device receives the user operation and continues to fold the A screen and the B screen of the inner folding screen toward each other. The angle between the A screen and the B screen shown in Figure 11D is smaller than the angle between the A screen and the B screen shown in Figure 11C. When the angle between the A screen and the B screen is greater than the preset angle, the electronic device 100 begins to obtain the interface layout information of the second interface, and draws the external screen animation based on the interface layout information of the second interface, the playback duration of the external screen animation, and the motion effect curve. The electronic device starts to play the external screen animation on the external screen, and the user interface 1104 can be the first animation frame in the external screen animation. The wallpaper picture also begins to translate in the second direction. At this time, the electronic device displays a black area as shown in Figure 11D on the right edge of the C screen.

[0220] As shown in Figure 11E , the electronic device receives user input and continues to fold screens A and B of the inner foldable screen toward each other. The electronic device assumes a folded state and displays user interface 1105 on screen C. At this point, screens A and B of the electronic device are hidden and invisible. User interface 1105 is similar to the interface displayed on screen A in Figure 11A . User interface 1105 may be the last animation frame in the first animation, i.e., the second interface when the inner foldable screen is in the folded state.

[0221] When the inner folding screen is interrupted during folding and then unfolded to its expanded state, for example, when the electronic device is folded to the state shown in Figure 11C, an unfolding operation of the folding screen is detected, and a second animation is played. User interface 1103 may be the first image frame of the second animation. The electronic device then controls the elements displayed on screens A and B to continue to translate in the first direction for a certain distance or for a certain period of time, and then controls the elements to translate in the second direction until user interface 1101 shown in Figure 11A is finally displayed.

[0222] In an embodiment of the present application, the first animation and the second animation conform to the spring curve in the above embodiment. When the first animation of the folding process of the inner folding screen is interrupted, the application window has the speed and attribute continuity capability, and the second animation can inherit the attribute state, position and speed of the original first animation, thereby achieving a smooth transition.

[0223] The following describes the animation process of switching scenes when the folding screen opens and closes.

[0224] 12A to 12C are schematic diagrams showing changes in the user interface of the electronic device during the folding process of the outer folding screen from the unfolded state to the intermediate state, and from the intermediate state to the folded state.

[0225] As shown in Figure 12A, when the electronic device is in the expanded state, the user interface 1201 is displayed in full screen, and the user interface 1201 can be the first image frame in the first animation. The user interface 1201 includes multiple elements. The elements can be one or more of the icons of multiple applications, desktop widgets, large folders, status bars, page indicators, wallpaper pictures, etc. For example, the user interface 1201 shown in Figure 12A includes an email application icon, a gallery application icon, a WeChat application icon, a settings application icon, a phone application icon, a text message application icon, a browser application icon, a Weibo application icon, etc. The desktop widgets may include a date component (for example, October 29, Wednesday), a time component (for example, 11:10), and a weather component (for example, Beijing, 10°C).

[0226] As shown in Figure 12B, the electronic device receives a user action causing screens A and B of the inner folding screen to begin folding in opposite directions. The electronic device continues playing the first animation, i.e., the electronic device begins controlling the elements displayed on screens A and B to begin translating in the second direction. The wallpaper image also begins translating in the second direction, and the electronic device displays a black area on the left edge of screen A, as shown in Figure 12B. The electronic device then displays user interface 1202, as shown in Figure 12B. User interface 1202 may be the second image frame in the first animation. The difference between user interface 1202 and user interface 1201 is that the display positions of the elements in user interface 1202 differ from those in user interface 1201. For example, in the first image frame, the email application icon is displayed at position A. The electronic device applies a displacement to the display position of the email application icon to obtain its display position in the second image frame. In the second image frame, the email application icon is displayed at position B. That is, in user interface 1202, the email application icon is displayed at position B. Position B is different from position A.

[0227] When the inner folding screen is interrupted during the folding process and unfolded again to the unfolded state, for example, when the electronic device is folded to the state shown in Figure 12B, the operation of unfolding the folding screen is detected, and then the second animation is played. User interface 1202 can be the first image frame in the second animation. Afterwards, as shown in Figure 12C, the electronic device receives the user operation to continue to fold screen A and screen B of the inner folding screen in opposite directions. The angle between screen A and screen B shown in Figure 12C is smaller than the angle between screen A and screen B shown in Figure 12B. The electronic device continues to play the first animation, that is, the electronic device begins to control the elements displayed on screen A and screen B to continue to translate in the second direction. The electronic device displays user interface 1203 as shown in Figure 12C, and user interface 1203 can be the second image frame in the second animation. The difference between user interface 1203 and user interface 1202 is that the display position of each element in user interface 1203 is different from the display position of each element in user interface 1202. Taking the email application icon as an example, in the second image frame, the display position of the email application icon is B. The electronic device adds the displacement to the display position of the email application icon to obtain the display position of the email application icon in the second image frame. In the third image frame, the email application icon is not visible. At the same time, the wallpaper image also begins to translate in the second direction. At this time, the electronic device displays a black area as shown in Figure 12C on the left edge of screen A. In some embodiments, the width of the black area can be the same as the distance the wallpaper image is translated in the second direction.

[0228] Afterwards, the electronic device receives user manipulation and continues to fold the inner folding screen A and B toward each other. The angle between screens A and B is greater than the angle between screens A and B shown in FIG12C . The black area on the left edge of screen A of the electronic device gradually decreases. This continues until the electronic device assumes a folded state under user manipulation, displaying user interface 1201 on the full screen as shown in FIG12A .

[0229] In an embodiment of the present application, the first animation and the second animation conform to the spring curve in the above embodiment. When the first animation of the folding process of the outer folding screen is interrupted, the application window has the speed and attribute continuity capability, and the second animation can inherit the attribute state, position and speed of the original first animation, thereby achieving a smooth transition.

[0230] The following describes the animation process of the horizontal and vertical screen rotation scene with reference to FIG. 13A to FIG. 13E .

[0231] As shown in FIG13A , the electronic device is in portrait mode and displays a user interface 1301. The user interface 1301 may be the first image frame in the first animation. The user interface 1301 includes multiple elements, which may be numbers, formulas, or symbols.

[0232] As shown in Figure 13B , the electronic device receives a user operation causing it to rotate in a first direction. The electronic device continues to play the first animation, i.e., the electronic device begins controlling the elements displayed on screens A and B to rotate in the first direction and displays user interface 1302 as shown in Figure 13B . User interface 1302 may be the second image frame in the first animation. User interface 1302 differs from user interface 1301 in that the display positions of the elements in user interface 1302 and the rotation angles of the elements in user interface 1301 are different. For example, the number 1 is displayed at position A in the first image frame. The electronic device applies a displacement to the position of the number 1 to obtain its display position in the second image frame. In the second image frame, the number 1 is displayed at position B. That is, in user interface 1302, the number 1 is displayed at position B, which is different from position A. The rotation angle of the number 1 in user interface 1302 is greater than that in user interface 1301. If the electronic device continues to rotate until the rotation angle reaches 90 degrees, the electronic device is in a horizontal state and displays the user interface shown in FIG13E .

[0233] When the electronic device is interrupted during the rotation process, for example, when it rotates to the state shown in Figure 13B, it rotates in the second direction again, as shown in Figure 13C. The electronic device receives the user operation to rotate the electronic device in the second direction, and the electronic device plays the second animation. The user interface 1302 is the first image frame of the second animation.

[0234] The electronic device displays user interface 1303 as shown in FIG13C . User interface 1303 differs from user interface 1302 in that the display positions of the elements in user interface 1303 are different from those in user interface 1302, and the rotation angles are different. For example, using the number 1 as an example, the rotation angle of the number 1 in user interface 1303 is greater than that in user interface 1302.

[0235] As the electronic device continues to rotate in the second direction, the electronic device displays user interface 1304 as shown in FIG13D . User interface 1304 differs from user interface 1303 in that the display positions of the elements in user interface 1303 and user interface 1304 are different, and the rotation angles are different. For example, the rotation angle of the number 1 in user interface 1304 is smaller than that in user interface 1303.

[0236] The electronic device returns to the vertical screen state under the user's operation, and the electronic device displays the user interface 1301 as shown in FIG13A .

[0237] In an embodiment of the present application, the first animation and the second animation conform to the spring curve in the above embodiment. When the first animation of the folding process of the inner folding screen is interrupted, the application window has the speed and attribute continuity capability, and the second animation can inherit the attribute state, position and speed of the original first animation, thereby achieving a smooth transition.

[0238] The solution provided in the embodiment of the present application is applicable to scenarios where two animations are switched, for example, switching from a first animation to a second animation. The first frame of the second animation can be the last frame of the first animation. The second animation can continue the terminal speed of the first animation, or inherit the terminal attribute information, position, etc. of the first animation. Moreover, the various attribute animations of the first animation and the second animation conform to the elastic curve, thereby achieving a smooth transition from the first animation to the second animation.

[0239] In the embodiments provided in the present application above, the methods provided in the embodiments of the present application are introduced from the perspective of an electronic device as an execution subject. In order to implement the various functions in the methods provided in the embodiments of the present application above, the electronic device may include a hardware structure and / or a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a function of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0240] When hardware implementation is adopted, the hardware implementation of the electronic device may refer to FIG1 and its related description.

[0241] Referring to FIG. 14 , the electronic device includes: a touch screen 1401, wherein the touch screen 1401 includes a touch panel 1407 and a display screen 1408; one or more processors 1402; a memory 1403; one or more application programs (not shown); and one or more computer programs 1404; and a sensor 1405. The aforementioned components may be connected via one or more communication buses 1406. The one or more computer programs 1404 are stored in the memory 1403 and configured to be executed by the one or more processors 1402. The one or more computer programs 1404 include instructions, which may be used to execute the method in any of the aforementioned embodiments.

[0242] An embodiment of the present application further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.

[0243] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment.

[0244] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the translation method in the above-mentioned method embodiments.

[0245] Among them, the electronic device, computer storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0246] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0247] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0248] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0249] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0250] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0251] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A display method for an electronic device, applied to an electronic device having a display screen, It is characterized in that The method comprises: The electronic device receives a first operation of a user, where the first operation is used to trigger playing a first animation of a first application; In response to the first operation, the electronic device acquires first initial attribute information and first destination attribute information by calling a UI thread; Based on the first initial attribute information and the first terminal attribute information, the electronic device determines, through a rendering thread, at least one first intermediate attribute information corresponding to the first animation; Based on the first initial attribute information, the first terminal attribute information and the at least one first intermediate attribute information, the electronic device executes a drawing and rendering process of the first animation through a rendering thread to obtain M image frames of the first animation; The electronic device plays the first animation based on the M image frames.

2. The method according to claim 1, It is characterized in that Any of the first initial attribute information, the first endpoint attribute information, and the at least one first intermediate attribute information includes at least one of the following: X-axis scaling ratio; Y-axis scaling ratio; X-axis displacement; Y-axis displacement; Clipping value from the left border; Clipping value from the right border; Clipping value from the top; Clipping value from the bottom; Transparency; Rounded corner attribute value.

3. The method according to claim 1 or 2, It is characterized in that The method further comprises: When the electronic device is playing the first animation, the electronic device receives a second operation of the user, where the second operation is used to trigger playing of a second animation of the first application; In response to the second operation, the electronic device acquires the second destination attribute information by calling a UI thread; Based on the second initial attribute information and the second terminal attribute information, the electronic device determines, through a rendering thread, at least one second intermediate attribute information corresponding to the second animation, where the second initial attribute information is attribute information corresponding to an image frame displayed when the electronic device receives the second operation; Based on the second initial attribute information, the second endpoint attribute information and the at least one second intermediate attribute information, the electronic device executes a drawing and rendering process of the second animation through a rendering thread to obtain N image frames of the second animation; The electronic device plays the second animation based on the N image frames.

4. The method according to claim 3, It is characterized in that Before the electronic device receives a first operation from a user, the electronic device includes: The electronic device displays a main interface; The first animation is a startup animation of the first application. After the electronic device receives a second operation from the user, the electronic device further includes: If the operation distance of the second operation is less than a threshold, determining that the second animation is a hand-following animation; or, If the operation distance of the second operation is greater than or equal to the threshold, the second animation is determined to be an animation of returning to the main interface.

5. The method according to claim 3, It is characterized in that When the electronic device receives a first operation from a user, the first application is in an activated state, the first animation is an exit animation of the first application, and the second animation is a reverse animation of the exit animation.

6. The method according to any one of claims 3 to 5, It is characterized in that The attribute information corresponding to the M image frames of the first animation and the attribute information corresponding to the N image frames of the second animation conform to an elastic curve.

7. The method according to any one of claims 3 to 6, It is characterized in that The animation leash corresponding to the second animation is the same as the animation leash corresponding to the first animation.

8. An electronic device, It is characterized in that Including processor, memory, display screen; The display screen is used to display a user interface; The memory is used to store one or more computer programs, and when the computer programs are executed by the processor, the electronic device performs: Receive a first operation of a user, where the first operation is used to trigger playing a first animation of a first application; In response to the first operation, acquiring first initial attribute information and first destination attribute information by calling a UI thread; Based on the first initial attribute information and the first end attribute information, determining, by a rendering thread, at least one first intermediate attribute information corresponding to the first animation; Based on the first initial attribute information, the first terminal attribute information and the at least one first intermediate attribute information, a rendering thread is used to execute a drawing and rendering process of the first animation to obtain M image frames of the first animation; Based on the M image frames, the first animation is played.

9. The electronic device according to claim 8, It is characterized in that Any of the first initial attribute information, the first endpoint attribute information, and the at least one first intermediate attribute information includes at least one of the following: X-axis scaling ratio; Y-axis scaling ratio; X-axis displacement; Y-axis displacement; Clipping value from the left border; Clipping value from the right border; Clipping value from the top; Clipping value from the bottom; Transparency; Rounded corner attribute value.

10. The electronic device according to claim 8 or 9, It is characterized in that When the computer program is executed by the processor, the electronic device further executes: When the first animation is being played, a second operation of the user is received, where the second operation is used to trigger playing of a second animation of the first application; In response to the second operation, acquiring the second destination attribute information by calling the UI thread; Based on the second initial attribute information and the second terminal attribute information, determining, through a rendering thread, at least one second intermediate attribute information corresponding to the second animation, wherein the second initial attribute information is attribute information corresponding to an image frame displayed when the electronic device receives the second operation; Based on the second initial attribute information, the second endpoint attribute information and the at least one second intermediate attribute information, executing a drawing and rendering process of the second animation through a rendering thread to obtain N image frames of the second animation; Based on the N image frames, the second animation is played.

11. The electronic device according to claim 10, It is characterized in that When the computer program is executed by the processor, the electronic device further executes: Display the main interface; If the operation distance of the second operation is less than a threshold, determining that the second animation is a hand-following animation; or, If the operation distance of the second operation is greater than or equal to the threshold, the second animation is determined to be an animation of returning to the main interface.

12. The electronic device according to claim 10, It is characterized in that The first animation is an exit animation of the first application, and the second animation is a reverse animation of the exit animation.

13. The electronic device according to any one of claims 10 to 12, It is characterized in that The attribute information corresponding to the M image frames of the first animation and the attribute information corresponding to the N image frames of the second animation conform to an elastic curve.

14. The electronic device according to any one of claims 10 to 13, It is characterized in that The animation leash corresponding to the second animation is the same as the animation leash corresponding to the first animation.

15. A computer-readable storage medium, It is characterized in that The computer-readable storage medium comprises a computer program, and when the computer program is executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 7.

16. A computer program product, It is characterized in that The computer program product stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Frame rate adjusting method and related device

    CN114443269A

  • Thread scheduling method and electronic equipment

    CN115016706A

  • Data processing method and related device

    CN115048012A

  • Dynamic effect calculation method and device

    CN115408071A