An animation display method and related device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2026-08-11
AI Technical Summary
When a user interrupts the startup animation and returns to the desktop during the application launch process on an electronic device, the return animation and the startup animation are not connected, resulting in screen flickering or blackout.
If the return animation is interrupted, the electronic device can achieve a smooth transition between the return animation and the startup animation by stopping the rendering of the return animation, using transition image frames, and switching to desktop application rendering mode.
It avoids discontinuities between animations, prevents screen flickering or blackouts, and improves the smoothness of user interface transitions.
Smart Images

Figure CN122555907A_ABST
Abstract
Description
An animation display method and related device TECHNICAL FIELD
[0001] The present application relates to the technical field of terminals, and in particular to an animation display method and related device. BACKGROUND
[0002] In the starting process of an application (which can be referred to as an app for short), an electronic device can play an app starting animation (which can be referred to as a starting animation for short) to improve the continuity of the electronic device from displaying a desktop interface to displaying a user interface of a started app, and achieve smooth transition. In the case where the electronic device displays other interfaces (for example, user interfaces of other apps), a user can swipe up to trigger the electronic device to return to the desktop, and in this case, the electronic device can play a return-to-desktop animation (which can be referred to as a return animation for short) to improve the continuity of the electronic device from displaying a user interface of a started app to displaying a desktop interface, and achieve smooth transition.
[0003] If the user interrupts the starting animation in the process of starting the app by the electronic device, triggers the electronic device to return to the desktop, and interrupts the return animation before the return animation ends, and triggers the electronic device to continue starting the app, the starting animation and the return animation are not connected, which can cause a flashing screen or a black flashing background.
[0004] SUMMARY
[0005] The present application discloses an animation display method and related device. According to the method, in the case where a return animation drawn in a second animation drawing mode is interrupted, the electronic device can stop drawing the return animation, draw a transition image frame based on drawing parameters corresponding to a last image frame of the return animation and drawing parameters corresponding to an interrupted image frame of the return animation, and then draw a second starting animation in a first animation drawing mode. This method can achieve smooth connection between the return animation and the starting animation by changing the animation drawing mode and drawing a transition image frame, and avoid phenomena such as flashing screen or black flashing.
[0006] In a first aspect, an embodiment of the present application provides an animation display method. The method can be applied to an electronic device. The method can include: displaying a first interface, the first interface being an interface of a desktop application, the first interface including a first application icon; in response to a first operation on the first application icon, displaying a first animation; the first application icon being an application icon corresponding to a first application, the first animation including an animation of starting the first application; during display of the first animation, in response to a second operation of returning to the desktop, stopping display of the first animation and displaying a second animation; the second animation including an animation of returning to the first interface; during display of the second animation, in response to a third operation on a first image frame in the second animation, stopping display of the second animation and displaying a third animation; wherein the first animation is drawn by the electronic device through a SurfaceFlinger, the second animation is drawn by the electronic device through the desktop application, and the third animation is drawn by the electronic device through the desktop application.
[0007] In the scheme provided in the present application, in the case that the return animation drawn by the SurfaceFlinger is interrupted, the electronic device can stop drawing the return animation through the SurfaceFlinger and draw a second start animation through the desktop application. Through this method, the electronic device does not need to first display the last image frame of the return animation in the case that the return animation drawn by the SurfaceFlinger is interrupted, and then continue to draw the second start animation through the SurfaceFlinger, but can realize smooth connection of the return animation and the second start animation by changing the animation drawing method from being drawn by the SurfaceFlinger to being drawn by the desktop application, thereby avoiding phenomena such as screen flashing or black flashing.
[0008] In some embodiments of the present application, the first animation can be the first start animation mentioned below, the second animation can be the return animation mentioned below, and the third animation can be the second start animation mentioned below.
[0009] In some embodiments of the present application, the first interface can be a desktop interface.
[0010] In some embodiments of the present application, the first image frame in the second animation can be the N2th image frame of the return animation mentioned below, or the interrupted image frame of the return animation.
[0011] In some embodiments of the present application, the first operation and the third operation can be a click operation, and the second operation can be an operation of swiping upward from the bottom of the screen. For details, refer to FIGS. 3A-3B, 4A-4B, 10A-10B, and 11A-11B.
[0012] With reference to the first aspect, in a possible implementation manner, after the third animation is displayed, the method further includes: in a process of displaying the third animation, in response to a fourth operation of returning to the desktop, displaying a fourth animation; the fourth animation includes an animation of returning to the first interface, and the fourth animation is drawn by the electronic device through the SurfaceFlinger.
[0013] In the scheme provided in the present application, in the case that the return animation drawn in the second animation drawing manner is interrupted and the second start animation is drawn in the first animation drawing manner, if the second start animation drawn in the first animation drawing manner is interrupted before the second start animation ends, the electronic device can continue to draw the return animation in the first animation drawing manner. In this way, in the scenario of multiple interruptions of the animation, the electronic device can select the corresponding animation drawing manner based on the drawing state (ended or not ended) when the animation is interrupted, so as to realize smooth connection of the return animation and the start animation, and avoid the phenomenon of flashing screen or flashing black.
[0014] In some embodiments of the present application, the fourth animation can be the return animation mentioned below.
[0015] In some embodiments of the present application, the fourth operation can be an operation of swiping upward from the bottom of the screen, and details can be referred to FIG. 11A-FIG. 11B.
[0016] With reference to the first aspect, in a possible implementation manner, after the third animation is displayed, the method further includes: after the third animation is displayed, displaying an interface of the first application; in response to a fourth operation of returning to the desktop, displaying a fourth animation; the fourth animation includes an animation of returning to the first interface, and the fourth animation is drawn by the electronic device through the SurfaceFlinger.
[0017] In the scheme provided in the present application, in the case that the return animation drawn in the second animation drawing manner is interrupted and the second start animation is drawn in the first animation drawing manner, if the second start animation drawn in the first animation drawing manner is interrupted before the second start animation ends, the electronic device can continue to draw the return animation in the first animation drawing manner. In this way, in the scenario of multiple interruptions of the animation, the electronic device can select the corresponding animation drawing manner based on the drawing state (ended or not ended) when the animation is interrupted, so as to realize smooth connection of the return animation and the start animation, and avoid the phenomenon of flashing screen or flashing black.
[0018] With reference to the first aspect, in a possible implementation manner, before the first animation is displayed, the method further includes: in response to the first operation, based on the animation effect flag bit being the first content, drawing the first animation by the SurfaceFlinger. The stopping displaying the first animation in response to the second operation of returning to the desktop includes: in response to the second operation, based on the first animation not being ended yet, stopping drawing the first animation. After the stopping displaying the first animation, the method further includes: based on the target interface being the first interface, the third animation not being currently drawn, and the animation effect flag bit being the first content, drawing the second animation by the SurfaceFlinger; after the drawing the second animation by the SurfaceFlinger, the method further includes: in response to the third operation, setting the animation effect flag bit to the second content.
[0019] In the scheme provided in the application, after the electronic device receives the operation (such as the second operation) of triggering the return to the desktop, the electronic device can determine whether the return animation is drawn in the second animation effect drawing manner or the first animation effect drawing manner through a series of judgments. This is a complete method logic. First, this indicates that the above method can be applied to the scene of interrupting the animation multiple times. Second, this indicates that the above method can be applied not only to the electronic device supporting the second animation effect drawing manner, but also to the electronic device not supporting the second animation effect drawing manner. That is, whether the electronic device supports the second animation effect drawing manner or not, the electronic device can use the method to draw the animation and respond after the animation is interrupted. The technical personnel do not need to formulate corresponding methods for the electronic device supporting the second animation effect drawing manner and the electronic device not supporting the second animation effect drawing manner, which simplifies the process to a certain extent and improves the applicability of the device.
[0020] It can be understood that after the electronic device receives the operation (such as the second operation) of triggering the return to the desktop, the electronic device can determine whether the return animation is constructed in the second animation effect drawing manner or the first animation effect drawing manner based on the setting condition of the flag bit, which is more simple and fast, and does not need to determine whether the drawing operation involved in starting the animation is executed by the SurfaceFlinger or the desktop application to determine the way of constructing the starting animation.
[0021] With reference to the first aspect, in a possible implementation manner, the stopping displaying the second animation and displaying the third animation includes: stopping displaying the second animation and displaying a second image frame; the content of the second image frame is the same as the content of the first image frame; after displaying the second image frame, the third animation is displayed.
[0022] In the scheme provided in the present application, in the case that the return animation drawn by the SurfaceFlinger is interrupted, the electronic device can stop drawing the return animation by the SurfaceFlinger, draw a frame of a transition image frame with the same content as the image frame in which the return animation is interrupted, and then draw a second start animation by the desktop application, so as to realize a smooth transition from drawing an animation in a second dynamic effect drawing mode to drawing an animation in a first dynamic effect drawing mode, that is, realize a smooth connection of the return animation and the second start animation, and avoid the phenomenon of flashing screen or flashing black.
[0023] In some embodiments of the present application, the second image frame is a transition image frame mentioned below.
[0024] In combination with the first aspect, in a possible implementation manner, the first image frame is synthesized based on a first layer, a second layer and a third layer; the first layer includes the first application icon, the second layer includes other application icons or components except the first application icon, and the third layer is a window layer of the first application; the stopping displaying the second animation includes: destroying the first layer; notifying the SurfaceFlinger to stop drawing the second animation; before the displaying the second image frame, the method further includes: determining a first drawing parameter according to a played time length of the second animation; the first drawing parameter is a drawing parameter corresponding to the second layer; drawing a fourth layer based on a second drawing parameter by the SurfaceFlinger, and adjusting content in the fourth layer based on the first drawing parameter by the desktop application to obtain a drawn fourth layer; the second drawing parameter is a drawing parameter corresponding to a last image frame of the second animation; and the second image frame is synthesized by the SurfaceFlinger based on the drawn fourth layer and the drawn third layer.
[0025] In the scheme provided in the present application, after the return animation constructed in the second dynamic effect drawing mode is interrupted, the electronic device can destroy the icon layer to avoid the influence on the image frame drawn in the first dynamic effect drawing mode, and can also determine the drawing parameters corresponding to the return animation interrupted image frame and the drawing parameters corresponding to the last image frame of the return animation, and still draw the transition image frame in the second dynamic effect drawing mode through SurfaceFlinger. In the process of drawing the transition image frame, the electronic device can draw the desktop layer based on the drawing parameters corresponding to the last image frame of the return animation through SurfaceFlinger, so that the size of the desktop layer in the transition image frame is the same as the size of the desktop layer in the last image frame of the return animation, and then the subsequent image frame drawn in the first dynamic effect drawing mode will not be affected by the size of the desktop layer. In the process of drawing the transition image frame, the electronic device can also adjust the size of the content of the desktop layer in the transition image frame through the desktop application, so that the size of the content of the desktop layer in the transition image frame is the same as the size of the content of the desktop layer in the return animation interrupted image frame. The electronic device can also synthesize the adjusted desktop layer and the application layer in the return animation interrupted image frame through SurfaceFlinger to obtain the transition image frame, and then display it on the display screen. It can be understood that the content and the size of the content in the transition image frame are the same as those in the return animation interrupted image frame. That is, the transition image frame is the same as the image frame displayed on the electronic device last time, which can realize smooth connection of the return animation and the second start animation, and avoid the phenomenon of flashing or black flashing.
[0026] In some embodiments of the present application, the first layer is an icon layer, the second layer and the fourth layer are second desktop layers corresponding to different image frames, and the third layer is an application layer.
[0027] In combination with the first aspect, in a possible implementation manner, before the third animation is displayed, the method further includes: determining third drawing parameters according to the played duration of the second animation, the third drawing parameters being drawing parameters corresponding to the third layer; determining drawing parameters corresponding to each image frame in the third animation based on the third drawing parameters, and drawing the third animation based on the drawing parameters corresponding to each image frame in the third animation.
[0028] In the scheme provided in the present application, after the return animation constructed in the second dynamic effect drawing mode is interrupted, the electronic device can determine the drawing parameters corresponding to the return animation interruption image frame, determine the drawing parameters corresponding to each image frame of the second start animation based on the drawing parameters corresponding to the return animation interruption image frame, and construct the second start animation in the first dynamic effect drawing mode based on the drawing parameters corresponding to each image frame. That is, the next image frame of the transition image frame is drawn by the electronic device with the return animation interruption image frame as a reference, and belongs to the continuous image frame, which can further realize the smooth connection of the return animation and the second start animation.
[0029] In combination with the first aspect, in a possible implementation, the fourth animation is displayed in response to the fourth operation of returning to the desktop, including: in response to the fourth operation, based on the first animation being stopped from being displayed, the target interface being the first interface, and the third animation not having ended playing, stopping drawing the third animation; based on the dynamic effect flag bit being the second content, drawing the fourth animation by the desktop application.
[0030] In combination with the first aspect, in a possible implementation, the fourth animation is displayed in response to the fourth operation of returning to the desktop, including: in response to the fourth operation, based on the first animation being stopped from being displayed, the target interface being the first interface, and the third animation not having ended playing, stopping drawing the third animation; based on the dynamic effect flag bit being the second content, drawing the fourth animation by the desktop application.
[0031] In the scheme provided in the present application, the electronic device can indicate whether the second dynamic effect drawing mode is supported by the electronic device based on the corresponding flag bit, and indicate whether the specific way of drawing the current animation is the first dynamic effect drawing mode or the second dynamic effect drawing mode. In this way, once the user triggers the electronic device to return to the desktop, the electronic device can determine whether to draw the return animation in the second dynamic effect drawing mode or in the first dynamic effect drawing mode based on the flag bit. This method is simple and fast, can save time to a certain extent, and can avoid the unsmooth connection of the start animation after being interrupted and the return animation.
[0032] In the second aspect, the present application provides an electronic device, which includes one or more memories and one or more processors; the one or more memories are coupled with the one or more processors, and the memory is used to store computer program code including computer instructions, and the one or more processors invoke the computer instructions to enable the electronic device to perform the method described in the first aspect or any one of the implementation manners of the first aspect.
[0033] In a third aspect, the present application provides a computer storage medium. The computer storage medium includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any of the implementation forms of the first aspect.
[0034] In a fourth aspect, the embodiments of the present application provide a chip. The chip can be applied to an electronic device. The chip includes one or more processors configured to invoke computer instructions to cause the electronic device to perform the method described in the first aspect or any of the implementation forms of the first aspect.
[0035] In some embodiments of the present application, the chip system can be an application processor (AP) or a system on chip (SoC) including an AP. The method described in the first aspect or any of the implementation forms of the first aspect can be implemented by an AP, and the method described in the second aspect or any of the implementation forms of the second aspect can be implemented by an AP.
[0036] In yet some embodiments of the present application, the chip system can include an AP and other modules. The other modules can be a modem (also referred to as a baseband processor).
[0037] In a fifth aspect, the embodiments of the present application provide a computer program product including instructions. When the computer program product is executed on an electronic device, the electronic device performs the method described in the first aspect or any of the implementation forms of the first aspect.
[0038] It can be understood that the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, the chip provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to perform the method described in the first aspect or any of the implementation forms of the first aspect. Therefore, the beneficial effects that can be achieved thereby can refer to the beneficial effects of any of the implementation forms of the first aspect, which will not be described herein again. BRIEF DESCRIPTION OF DRAWINGS
[0039] FIG. 1A is a schematic diagram of a start animation provided in an embodiment of the present application;
[0040] FIG. 1B is a schematic diagram of a return animation provided in an embodiment of the present application;
[0041] FIG. 2A is a schematic diagram of another start animation provided in an embodiment of the present application;
[0042] FIG. 2B is a schematic diagram of a return animation provided in an embodiment of the present application;
[0043] FIG. 3A and FIG. 3B are schematic diagrams of a set of image frame changes caused by interrupting the playing of an animation according to an embodiment of the present application;
[0044] FIG. 4A and FIG. 4B are schematic diagrams of another set of image frame changes caused by interrupting the playing of an animation according to an embodiment of the present application;
[0045] FIG. 5 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application;
[0046] FIG. 6 is a schematic diagram of a software structure of an electronic device according to an embodiment of the present application;
[0047] FIG. 7 is a flowchart of an animation display method according to an embodiment of the present application;
[0048] FIG. 8 is a flowchart of another animation display method according to an embodiment of the present application;
[0049] FIG. 9A and FIG. 9B are schematic diagrams of a set of comparison between a return animation end image frame and a transition image frame according to an embodiment of the present application;
[0050] FIG. 10A-FIG. 10B are schematic diagrams of image frame changes caused by interrupting the playing of an animation according to an embodiment of the present application;
[0051] FIG. 11A-FIG. 11B are schematic diagrams of another set of image frame changes caused by interrupting the playing of an animation according to an embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, “ / ” represents the meaning of or, for example, A / B can represent A or B; the “and / or” in the text only represents a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, “multiple” means two or more than two.
[0053] It should be understood that the terms “first”, “second” and the like in the specification and claims of the present application and the drawings are used to distinguish different objects, and are not used to describe a specific order. In addition, the terms “include” and “have” and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.
[0054] It should be understood that the term “user interface” in the specification and claims of the present application and the drawings is a medium interface for interaction and information exchange between an application or operating system and a user. The commonly used form of a user interface is a graphic user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be an icon, window, control, etc. interface element displayed in the display screen of an electronic device, wherein the control can include an icon, button, menu, tab, text box, dialog box, status bar, navigation bar, widget, etc. visual interface element.
[0055] Reference to “an embodiment” in this application means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The occurrence of the phrase “in one embodiment” in various places in the specification does not necessarily all refer to the same embodiment, nor is it necessarily mutually exclusive of other embodiments. It is explicitly and implicitly understood that the embodiments described in this application can be combined with each other.
[0056] During the starting process of an application (which can be referred to as an app), the electronic device can play an application starting animation (which can be referred to as a starting animation) to improve the continuity of the electronic device from displaying a desktop interface to displaying a user interface of the started application.
[0057] As shown in FIG. 1A, in response to the user's operation of clicking an application icon, the electronic device can play a starting animation. For ease of understanding and description, the application icon clicked by the user (or the clicked application icon) is denoted as a first application icon, the application corresponding to the first application icon is denoted as a first application, and the window corresponding to the first application is denoted as a first application window.
[0058] For example, during the playing of the starting animation, the first application icon displayed by the electronic device gradually disappears, and the first application window gradually appears until the size of the first application window is consistent with the size of the screen (or display screen), i.e., the electronic device displays the first application window in full screen. It can be understood that the first application icon displayed by the electronic device gradually disappears, which can specifically include that the transparency of the first application icon displayed by the electronic device becomes higher (i.e., the first application icon becomes more transparent). In some embodiments of the present application, during the process in which the first application icon displayed by the electronic device gradually disappears, the first application icon displayed by the electronic device gradually becomes larger, i.e., the size of the first application icon becomes larger and larger. Similarly, the electronic device gradually displays the first application window, which can specifically include that the size of the first application window displayed by the electronic device becomes larger and larger, and the transparency of the first application window displayed by the electronic device becomes lower and lower (i.e., the first application window becomes less and less transparent).
[0059] The transparency of the first application icon can be 0 at the lowest, in which case the first application icon is opaque (or completely opaque), and the transparency of the first application icon can be 100% at the highest, in which case the first application icon is completely transparent (understandably invisible to the user). Understandably, the transparency of the first application icon in the desktop interface is 0, and in the case that the electronic device displays the first application window full screen, the transparency of the first application icon is 100%. In the process of playing the start-up animation, the first application icon displayed by the electronic device is the same as the first application icon originally included in the desktop interface (that is, the minimum size of the first application icon is the same as the size of the first application icon originally included in the desktop interface), and the size of the first application icon displayed by the electronic device is smaller than the size of the screen (that is, the maximum size of the first application icon is smaller than the size of the screen), and the specific value can be set according to actual needs, which is not shown in the present application. For example, the maximum width of the first application icon is half the width of the screen, and the maximum length of the first application icon is half the length of the screen. Similarly, the transparency of the first application window can be 0 at the lowest, in which case the first application window is opaque (or completely opaque), and the transparency of the first application window can be 100% at the highest, in which case the first application window is completely transparent (understandably invisible to the user). Understandably, in the case that the electronic device displays the first application window full screen, the transparency of the first application window is 0. In the process of playing the start-up animation, the first application window displayed by the electronic device is the same as the size of the screen (that is, the maximum size of the first application window is the same as the size of the screen), and the minimum size of the first application window displayed by the electronic device can be set according to actual needs, which is not shown in the present application. For example, the minimum width of the first application window is half the width of the screen, and the minimum length of the first application window is half the length of the screen.
[0060] In some embodiments of the present application, the first image frame of the complete start-up animation is the first image frame displayed by the electronic device after the user clicks the first application icon and lifts the hand, which can be the same as the desktop interface or different from the desktop interface. In order to facilitate understanding and description, the first frame of the complete start-up animation is taken as an example in the present application.
[0061] Exemplarily, as shown in FIG. 1A, the complete start-up animation can include Z image frames in total, i.e., the complete start-up animation is composed of Z image frames (or Z-frame images). In response to the operation of the user clicking the first application icon in the desktop interface, the electronic device can display the 1st image frame of the start-up animation (specifically, the 1st image frame of the complete start-up animation). The 1st image frame (or 1st-frame image) is the same as the desktop interface, that is, compared with the size of the first application icon in the desktop interface displayed by the electronic device before the user clicks the first application icon, the size of the first application icon in the 1st image frame of the start-up animation does not change. In the subsequent process, the electronic device can continue to play the start-up animation (i.e., display other image frames of the start-up animation in order) until the Zth image frame of the start-up animation (specifically, the Zth image frame of the complete start-up animation) is displayed. In the process of continuing to play the start-up animation, the electronic device can display the M1th image frame of the start-up animation (specifically, the M1th image frame of the complete start-up animation), and compared with the 1st image frame of the start-up animation, the first application window / first application icon in the M1th image frame of the start-up animation (or M1th-frame image) is larger. It can be understood that the Zth image frame of the start-up animation (or Zth-frame image) is the last image frame of the start-up animation. In the Zth image frame of the start-up animation, the size of the first application window is consistent with the size of the screen (or display screen), i.e., the electronic device displays the application window full screen, that is, the electronic device displays the user interface of the first application full screen. It can be understood that M1 and Z are both positive integers, and M1 is less than Z.
[0062] Similarly, in the case where the electronic device displays other interfaces (for example, the user interface of other applications), the user can trigger the electronic device to return to the desktop by swiping up, in which case the electronic device can play a return desktop animation (which can be referred to simply as a return animation) to improve the continuity of the electronic device from displaying an application user interface to displaying a desktop interface.
[0063] As shown in FIG. 1B, in the case where the electronic device displays the first application window full screen, the user can swipe up from the bottom of the screen of the electronic device, and in response to the operation of the user swiping up from the bottom of the screen, the electronic device can play the return animation. Alternatively, in the case where the electronic device displays the first application window full screen, the electronic device can receive the user operation of swiping up from the bottom of the screen, and after receiving the user operation, the electronic device can play the return animation.
[0064] For example, during the playing of the return animation, the first application window displayed by the electronic device gradually becomes smaller and the first application icon gradually appears until the desktop interface is displayed. That is, during the playing of the return animation, the first application window displayed by the electronic device gradually becomes smaller and disappears, and the first application icon gradually appears until the first application icon is consistent with the first application icon originally included in the desktop interface (for example, the size and transparency of the first application icon are consistent with the size and transparency of the first application icon originally included in the desktop interface). It can be understood that the first application window displayed by the electronic device gradually becomes smaller and disappears, which can specifically include that the size of the first application window displayed by the electronic device becomes smaller and smaller, and the transparency of the first application window displayed by the electronic device becomes higher and higher (that is, the first application window becomes more and more transparent). Similarly, the electronic device gradually displays the first application icon, which can specifically include that the transparency of the first application icon displayed by the electronic device becomes lower and lower (that is, the first application icon becomes more and more opaque). In some embodiments of the present application, the electronic device gradually displays the first application icon, which can specifically further include that the size of the first application icon displayed by the electronic device becomes smaller and smaller.
[0065] The size and transparency of the first application window can refer to the size and transparency of the first application window involved in the start animation described above, and the size and transparency of the first application icon can refer to the size and transparency of the first application icon involved in the start animation described above, which will not be described herein again.
[0066] In some embodiments of the present application, the first image frame of the complete return animation is the first image frame displayed by the electronic device after the user slides upward from the bottom of the screen and lifts the hand, which can be the user interface of the first application displayed by the electronic device in full screen (or the first image frame is the same as the user interface of the first application displayed by the electronic device in full screen), or can be different from the user interface of the first application. The user interface of the first application displayed by the electronic device in full screen can be understood as that the electronic device displays the first application window in full screen, and the first application window includes the user interface of the first application.
[0067] In some embodiments of the present application, the first image frame of the complete return animation is the image frame displayed by the electronic device when the user's finger falls on the screen but has not been slid upward, which can be understood as the first image frame displayed by the electronic device after receiving the press event. The first image frame can be the user interface of the first application displayed by the electronic device in full screen, or can be different from the user interface of the first application.
[0068] For the convenience of understanding and description, the first image frame of the complete return animation is taken as the user interface of the first application displayed by the electronic device in full screen in the embodiments of the present application.
[0069] It can be understood that the following examples are described with the same number of frames of the complete return animation and the complete start animation, and in other embodiments of the present application, the number of frames of the complete return animation can be different from the number of frames of the complete start animation.
[0070] Exemplarily, as shown in FIG. 1B, like the start animation, the complete return animation can include Z image frames in total, that is, the complete return animation is composed of Z image frames (or Z-frame images). In some embodiments of the present application, the first frame of the complete return animation can be the Zth frame of the complete start animation, the N1th frame of the complete return animation can be the M1th frame of the complete start animation, and the Zth frame of the complete return animation can be the first frame of the complete start animation.
[0071] As shown in FIG. 1B, in the case that the electronic device displays the first application window in full screen (or the electronic device displays the user interface of the first application in full screen), in response to the operation of the user sliding upward from the bottom of the screen, the electronic device can display the first image frame of the return animation (specifically, the first image frame of the complete return animation). The first image frame is the same as the image frame displayed by the electronic device before the user slides upward, that is, compared with the size and content of the first application window displayed by the electronic device before the user slides upward, the size and content of the first application window in the first image frame of the return animation do not change. In the subsequent process, the electronic device can continue to play the return animation (that is, display other image frames of the return animation in order) until the Zth image frame of the return animation is displayed. In the process of continuing to play the return animation, the electronic device can display the N1th image frame of the return animation (or the N1th frame of the image), and compared with the first image frame of the return animation, the first application window / first application icon in the N1th image frame of the return animation is larger. It can be understood that the Zth image frame of the return animation is the last image frame of the return animation. The Zth image frame of the return animation can be a desktop interface. It can be understood that N1 and Z are positive integers, and N1 is less than Z.
[0072] It should be noted that the user can also trigger the electronic device to return to the desktop (or display the desktop interface) through other operations (for example, sliding downward from the top of the screen, double-clicking or long-pressing in a specific area of the screen, a specific gesture instruction, a specific voice instruction, etc.), which is not limited in the present application.
[0073] In some embodiments of the present application, during the playing of the startup animation and the return animation, the size of the application icons or components displayed on the electronic device other than the first application icon also changes. It can be understood that the specific change of the size of the application icons or components displayed on the electronic device other than the first application icon can be set according to actual needs, and the present application does not limit this. For example, with reference to the initial size of the application icons or components displayed on the desktop interface other than the first application icon, the application icons or components displayed on the desktop interface other than the first application icon can be maximized, and the application icons or components displayed on the desktop interface other than the first application icon can be minimized to 80% of the initial size.
[0074] For example, during the playing of the startup animation, the first application icon displayed on the electronic device gradually disappears, and the application icons or components displayed on the electronic device other than the first application icon gradually become smaller, and the electronic device gradually displays the first application window until the size of the first application window is consistent with the size of the screen (or display screen), that is, the electronic device displays the first application window in full screen. Specifically, as shown in FIG. 2A, the first image frame of the startup animation is displayed on the screen of the electronic device before the M2th image frame (or M2th frame image), and the M2th image frame of the startup animation is displayed on the screen of the electronic device before the M1th image frame. Compared with the other icons or components (i.e., the application icons or components other than the first application icon) in the first image frame of the startup animation, the size of the other icons or components in the M2th image frame of the startup animation is smaller, and compared with the other icons or components in the M2th image frame of the startup animation, the size of the other icons or components in the M1th image frame of the startup animation is smaller. That is, the size of the other icons or components in the M1th image frame of the startup animation is smaller than the size of the other icons or components in the M2th image frame of the startup animation, and the size of the other icons or components in the M2th image frame of the startup animation is smaller than the size of the other icons or components in the first image frame of the startup animation. It can be understood that M2 is an integer greater than 1, and M2 is less than M1. It can be understood that the change of the first application icon and the first application window shown in FIG. 2A can refer to FIG. 1A, and the present application will not be repeated here.
[0075] Similarly, during the playing of the return animation, the first application window displayed by the electronic device gradually becomes smaller, and other application icons or components displayed by the electronic device, except the first application icon, gradually become larger, and the electronic device gradually displays the first application icon until the desktop interface is displayed. For example, as shown in FIG. 2B, the first image frame of the return animation is displayed on the screen of the electronic device before the N1th image frame, and the N1th image frame of the return animation is displayed on the screen of the electronic device before the N2th image frame (or the N2th image). Compared with other icons or components in the first image frame of the return animation (i.e., other application icons or components except the first application icon), the size of the other icons or components in the N1th image frame of the return animation is larger, and compared with other icons or components in the N1th image frame of the return animation, the size of the other icons or components in the N2th image frame of the return animation is larger. That is, the size of the other icons or components in the N2th image frame of the return animation is larger than the size of the other icons or components in the N1th image frame of the return animation, and the size of the other icons or components in the N1th image frame of the return animation is larger than the size of the other icons or components in the first image frame of the return animation. It can be understood that among the Z image frames of the return animation, the other icons or components included in the Zth image frame of the return animation are the largest. It can be understood that N2 is a positive integer, N2 is greater than N1, and N2 is less than Z. It can be understood that the changes of the first application icon and the first application window shown in FIG. 2B can refer to FIG. 1B, which will not be described herein.
[0076] It can be understood that, similar to FIGS. 1A and 1B, FIGS. 2A and 2B respectively show a complete start animation and a complete return animation. As shown in FIG. 2B, the N1th image frame of the complete return animation is the same as the M1th image frame of the complete start animation, and the N2th image frame of the complete return animation is the same as the M2th image frame of the complete start animation.
[0077] The electronic device can draw the above-mentioned start animation and return animation in two animation drawing modes. For the convenience of understanding and description, the first of the two animation drawing modes is referred to as the first animation drawing mode, and the second of the two animation drawing modes is referred to as the second animation drawing mode. The first animation drawing mode specifically refers to that the application layer is responsible for drawing the image frames of the animation. Specifically, after the application layer draws the corresponding layers, the drawing result (which can be understood as the corresponding layers drawn) can be handed over to the module (which can be referred to as the application layer lower module) in the lower layer of the application layer in the software framework for composition to obtain the to-be-displayed image frame (or to-be-displayed image), and finally the to-be-displayed image frame is sent to the display screen for display. Since the application of the application layer can draw the animation by drawing a view, the animation drawn by the first animation drawing mode can be referred to as a view animation (or view animation effect). The second animation drawing mode specifically refers to that the application layer lower module draws the image frames of the animation (which can be understood as sinking the drawing operation to the application layer lower module for execution). Specifically, the application layer issues the drawing parameters corresponding to the animation to the application layer lower module, and the application layer lower module draws the corresponding layers based on the drawing parameters corresponding to each image frame of the animation, and composes the drawn corresponding layers to obtain the to-be-displayed image frame, and then sends the to-be-displayed image frame to the display screen for display, so that better animation effect can be achieved under limited computing resources. Since the application layer lower module draws through a window, the animation drawn by the second animation drawing mode can also be referred to as a window animation (or window animation effect).
[0078] Optionally, in combination with FIG. 6, the lower layer of the application layer can include an application framework layer, an Android runtime, a system library, a hardware abstraction layer, and a system kernel layer.
[0079] For example, the first animation drawing mode can be referred to as non-animation sinking, and the second animation drawing mode can be referred to as animation sinking.
[0080] In some embodiments of the present application, the above-mentioned application layer lower module can be a module in the application framework layer, for example, a SurfaceFlinger, that is, the application of the application layer issues the drawing parameters corresponding to the animation to the SurfaceFlinger, and the SurfaceFlinger draws the corresponding layers.
[0081] In some embodiments of the present application, the animation and animation effect (which can be referred to as animation effect) involved in the present application have the same meaning.
[0082] It can be understood that the construction of the animation (or creation of the animation) mentioned in the present application can refer to the entire process of generating and playing the animation (or displaying the animation), including the steps of calculating the drawing parameters, drawing the image frames, composing the image frames, and displaying the image frames.
[0083] It should be noted that in some embodiments of the present application, in the case that the electronic device draws the startup animation or the return animation by using the first dynamic effect drawing manner, the first application icon and the other application icons or components can be located in a layer, and the layer is different from the layer in which the first application window is located (i.e., the first application layer). For the convenience of description and distinction, the present application refers to the layer in which the clicked application icon and the other application icons or components are located in the process of drawing the startup animation or the return animation by using the first dynamic effect drawing manner as the first desktop layer, and refers to the application window corresponding to the clicked application icon as the application window (or the application layer).
[0084] It should be further noted that in some embodiments of the present application, in the case that the electronic device draws the startup animation or the return animation by using the second dynamic effect drawing manner, the window in which the first application icon is located is different from the first application window, that is, the electronic device draws the first application icon in a window different from the first application window. Similarly, the window in which the other application icons or components in the desktop interface except the first application icon are located is different from the first application window and also different from the window in which the first application icon is located. For the convenience of description, the present application refers to the window (or the layer) in which the clicked application icon is located in the process of drawing the startup animation or the return animation by using the second dynamic effect drawing manner as the icon window (or the icon layer), refers to the window in which the other application icons or components in the desktop interface except the clicked application icon are located as the desktop window (or the second desktop layer), and refers to the application window corresponding to the clicked application icon (i.e., the window corresponding to the application started by the electronic device) as the application window (or the application layer). It can be understood that the window in which the first application icon is located is the icon window, the window in which the other application icons or components in the desktop interface except the first application icon are located is the desktop window, and the first application window is the application window.
[0085] In some embodiments of the present application, in the case that the startup animation or the return animation is drawn by using the second dynamic effect drawing manner, in the second desktop layer, the icon layer and the application layer, the second desktop layer is located at the lowermost layer, that is, the second desktop layer is located below the icon layer and the application layer, the icon layer is located between the second desktop layer and the application layer, that is, the icon layer is located above the second desktop layer and below the application layer, and the application layer is located at the uppermost layer, that is, the application layer is located above the second desktop layer and the icon layer.
[0086] In the process of constructing the starting animation based on the second dynamic effect drawing manner, the user can trigger the return to the desktop by swiping up, in which case the starting animation is interrupted, and the electronic device can construct a return animation based on the second dynamic effect drawing manner. It can be understood that the return animation played on the basis of the interrupted starting animation is not a complete return animation, and the first image frame thereof is the image frame displayed by the electronic device when the starting animation is interrupted, rather than the first image frame of the complete return animation. During the playing of the return animation, the user can trigger the starting of the application by clicking the application window / application icon, in which case the return animation is interrupted, and the electronic device needs to first display the last image frame of the return animation, and then construct a starting animation (i.e., the animation of the continued starting) based on the second dynamic effect drawing manner, that is, the electronic device displays the last image frame of the return animation and then constructs the starting animation, so that the starting animation and the return animation do not smoothly connect, resulting in a flashing screen or a black flashing background.
[0087] It can be understood that, according to the above, the construction of the animation by the electronic device based on (or referred to as adopting) the second dynamic effect drawing manner can refer to the entire process of generating and playing the animation, including the steps of calculating the drawing parameters, drawing the layers (or layers corresponding to the image frames) by adopting the second dynamic effect drawing manner, synthesizing the image frames of the animation based on the layers, and displaying the image frames.
[0088] For example, as shown in FIG. 3A, in response to the operation of the user clicking the first application icon, the electronic device can construct a starting animation in the second dynamic effect drawing manner. In the case of displaying the M1th image frame of the starting animation, in response to the operation of the user swiping up from the bottom of the screen (the first interruption of the animation playing, as shown in FIG. 3A, which can be understood as the first interruption of the animation playing), the electronic device can construct a return animation in the second dynamic effect drawing manner starting from the M1th image frame of the starting animation (i.e., the N1th image frame of the return animation). In the case of the electronic device displaying the N2th image frame of the return animation, in response to the operation of the user clicking the first application window / first application icon (the second interruption of the animation playing, as shown in FIG. 3A and FIG. 3B, which can be understood as the second interruption of the animation playing), the next frame of the electronic device can display the last image frame of the return animation (or the Zth image frame of the return animation), that is, after the electronic device displays the N2th image frame of the return animation, the next frame can display the Zth image frame of the return animation. Further, after the electronic device displays the last image frame of the return animation, the electronic device can construct a starting animation in the second dynamic effect drawing manner. Specifically, after the electronic device displays the last image frame of the return animation, the next frame can display the N2th image frame of the return animation (i.e., the M2th image frame of the starting animation), and the electronic device can construct a starting animation in the second dynamic effect drawing manner starting from the N2th image frame of the return animation, until the electronic device displays the Zth image frame of the starting animation.
[0089] According to the above, if the user can click the application window / application icon to trigger the return application interface (or trigger the full-screen display of the application window) in the process of interrupting the start-up animation and playing the return animation, the electronic device displays the last image frame of the return animation and then plays the start-up animation, thereby causing the start-up animation and the return animation to be not smooth in transition, and further causing the screen to flash or the background to flash black. The following specifically takes the first application as the camera application and the first application icon as the camera application icon as an example to illustrate this:
[0090] As shown in FIG. 4A, the electronic device can display a desktop interface la, which can include a camera application icon 101. In response to a user operation of tapping the camera application icon 101, the electronic device can construct a start-up animation in a dynamic sinking manner. During the process in which the electronic device plays the start-up animation, the camera application icon 101 displayed by the electronic device gradually becomes larger and gradually disappears, and a camera application window displayed by the electronic device gradually appears and gradually becomes larger. Specifically, as shown in FIG. 4A, during the process in which the electronic device plays the start-up animation, the electronic device can display a start-up animation interrupted image frame lb. The start-up animation interrupted image frame lb is the M1th image frame of the start-up animation. The start-up animation interrupted image frame lb can include the camera application icon 101 and the camera application window 102. The camera application window 102 includes a user interface (for example, a shooting interface Id shown in FIG. 4B) of the camera application. The size of the camera application icon 101 in the start-up animation interrupted image frame lb is greater than the size of the camera application icon 101 in the desktop interface la. In the case where the electronic device displays the start-up animation interrupted image frame lb, in response to a user operation of swiping upward from the bottom of the screen of the electronic device (as shown in FIG. 4A, the first interruption, which can be understood as the first time the user interrupts the playing of the animation), the electronic device can play a return animation. It can be understood that the electronic device can construct the start-up animation in a dynamic sinking manner from the state when the start-up animation is interrupted, that is, the return animation is played from the start-up animation interrupted image frame lb. Since the M1th image frame of the start-up animation is the same as the N1th image frame of the return animation, it can also be understood that the electronic device can play the return animation from the N1th image frame of the return animation. During the process in which the return animation is played, the electronic device can display a return animation interrupted image frame lc. The return animation interrupted image frame lc can include the camera application icon 101 and the camera application window 102. The size of the camera application icon 101 in the return animation interrupted image frame lc is smaller than the camera application icon 101 in the start-up animation interrupted image frame lb, the size of the camera application window 102 in the return animation interrupted image frame lc is smaller than the camera application window in the start-up animation interrupted image frame lb, the size of other application icons or components in the return animation interrupted image frame lc is greater than the size of other application icons or components in the start-up animation interrupted image frame lb, and the size of other application icons or components in the return animation interrupted image frame lc is smaller than the size of other application icons or components in the desktop interface la.
[0091] In the case that the electronic device displays the return animation interrupted image frame 1c, after the user clicks the camera application icon 101 or the camera application window 102, the electronic device cannot construct the start-up animation in the second dynamic drawing manner starting from the return animation interrupted image frame 1c, but first needs to restore to the state at the end of the return animation (or the last image frame of the return animation) and then construct the start-up animation in the second dynamic drawing manner. Specifically, as shown in FIG. 4B, in the case that the electronic device displays the return animation interrupted image frame 1c, in response to the operation of the user clicking the camera application icon 101 or the camera application window 102 (the second interruption as shown in FIG. 4B, which can be understood as the second interruption of the user in the animation playing), the electronic device can display the desktop interface 1a. That is, after the electronic device displays the return animation interrupted image frame 1c, the electronic device displays the desktop interface 1a in the next frame. After the electronic device displays the desktop interface 1a, the electronic device can construct the start-up animation in the dynamic sinking manner. Specifically, after the electronic device displays the desktop interface 1a, the electronic device displays the return animation interrupted image frame 1c in the next frame, and constructs the start-up animation starting from the return animation interrupted image frame 1c. As shown in FIG. 4B, in the process of playing the start-up animation, the electronic device can display the start-up animation interrupted image frame 1b, and the electronic device can finally display the shooting interface 1d. The shooting interface 1d can be understood as the last image frame of the start-up animation (i.e., the Z image frames of the start-up animation mentioned above).
[0092] It should be noted that, whether the user triggers the electronic device to return to the desktop after the end of the start-up animation or in the case that the start-up animation has not ended, subsequent interruption of the return animation by the user will cause the phenomenon of screen flashing or black flashing of the electronic device.
[0093] Based on the above, the embodiment of the present application provides an animation display method and related equipment. According to the method, in response to the operation of the user clicking the first application icon, the electronic device can start the first application and determine whether the electronic device supports dynamic effect sinking. In the case that the electronic device supports dynamic effect sinking, the first start animation is drawn in the second dynamic effect drawing mode, and in the case that the electronic device does not support dynamic effect sinking, the first start animation is drawn in the first dynamic effect drawing mode. In response to the operation of the user sliding up from the bottom of the screen, the electronic device can determine whether the first start animation is ended. In the case that the first start animation is ended, the electronic device can determine whether the operation of the user sliding up from the bottom of the screen meets the preset condition, and in the case that the first start animation is not ended, the electronic device can end the first start animation and determine whether the operation of the user sliding up from the bottom of the screen meets the preset condition. In the case that the operation of the user sliding up from the bottom of the screen meets the preset condition and the electronic device draws the first start animation in the second dynamic effect drawing mode, the electronic device draws the return animation in the second dynamic effect drawing mode. In response to the operation of the user clicking the first application window or the first application icon, the electronic device can stop drawing the return animation (or stop building / playing the return animation), draw the second start animation in the first dynamic effect drawing mode. Through this method, in the case that the user interrupts the electronic device playing the return animation drawn in the second dynamic effect drawing mode, the electronic device can draw the same frame of transition image frame as the interrupted image frame of the return animation, and then draw the second start animation in the first dynamic effect drawing mode, so as to realize the smooth connection of the return animation and the second start animation, and avoid the phenomenon of flashing screen or flashing black.
[0094] The device related to the embodiment of the present application is introduced below.
[0095] The electronic device related to the embodiment of the present application can be a mobile phone, a tablet computer, a personal computer (PC), a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA) and the like. It can be understood that the specific type of the electronic device is not limited in the present application.
[0096] Please refer to FIG. 5, which is a schematic diagram of the hardware structure of an electronic device provided by the embodiment of the present application.
[0097] As shown in FIG. 5, the electronic device can include a processor, an external memory interface, an internal memory, a Universal Serial Bus (USB) interface, a charging management module, a power management module, a battery, an antenna 1, an antenna 2, a mobile communication module, a wireless communication module, a sensor module, a key, a motor, an indicator, a camera, a display screen, and a Subscriber Identity Module (SIM) card slot, etc. Among them, the audio module can include a speaker, a receiver, a microphone, an earphone interface, etc., the sensor module can include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0098] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. It can be understood that the components shown can be implemented in hardware, software or a combination of software and hardware. In some embodiments of the present application, the electronic device can include more components than shown. For example, the electronic device can include other types of sensors. In yet other embodiments of the present application, the electronic device can include fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device.
[0099] The processor can include one or more processing units, for example: the processor can include an Application Processor (AP), a Modem (also known as a baseband processor), a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), and / or a Neural-network Processing Unit (NPU), etc. Among them, the AP is a processor responsible for running the operating system and application programs. The Modem is a processor responsible for processing various communication protocols.
[0100] The wireless communication function of the electronic device can be implemented by the antenna 1, the antenna 2, the mobile communication module, the wireless communication module, and the modem, etc. The modem can interact with the base station through the antenna (e.g., the antenna 1, the antenna 2, etc.). In some embodiments, the antenna 1 and the mobile communication module of the electronic device are coupled, and the antenna 2 and the wireless communication module are coupled, so that the electronic device can communicate with the network and other devices through the wireless communication technology.
[0101] The electronic device can implement the display function through the GPU, the display screen, and the application processor, etc.
[0102] The GPU is a microprocessor for image processing, which is connected to the display screen and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor can include one or more GPUs, which execute program instructions to generate or change display information. The display screen is used to display images, videos, etc. In some embodiments, the electronic device can include one or more display screens.
[0103] The camera is used to capture still images or videos. The ISP is used to process the data fed back by the camera. Light is transmitted to the camera photosensitive element through the lens, and the optical signal is converted into an electrical signal, which is transmitted to the ISP for processing by the camera photosensitive element, and is converted into an image visible to the naked eye. The electronic device can include one or more cameras.
[0104] The internal memory can include one or more RAMs and one or more non-volatile memories (NVMs). The random access memory can be directly read and written by the processor, and can be used to store executable programs (e.g., machine instructions) of the operating system or other programs running, and can also be used to store data of users and application programs, etc. The non-volatile memory can also store executable programs and store data of users and application programs, etc., which can be loaded into the random access memory in advance for direct reading and writing by the processor.
[0105] In some embodiments of the present application, the code for implementing the method described in the embodiments of the present application can be stored on the non-volatile memory. When running the desktop application, the electronic device can load the executable code stored in the non-volatile memory into the random access memory.
[0106] The external memory interface can be used to connect external non-volatile memories to expand the storage capacity of the electronic device.
[0107] The electronic device can implement the audio function through the audio module, the speaker, the receiver, the microphone, the earphone interface, and the application processor, etc.
[0108] The operating system of the electronic device can employ a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. Embodiments of the present application take an Android operating system with a layered architecture as an example to illustrate the software structure of the electronic device. It should be noted that although the Android operating system (which can be referred to as the Android system for short) is taken as an example for illustration, the basic principles are also applicable to electronic devices based on iOS or Windows operating systems.
[0109] FIG. 6 is a schematic diagram of a software structure of an electronic device according to an embodiment of the present application.
[0110] The software structure of the electronic device employs a layered architecture, i.e., the software is divided into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. Taking the Android system running on the AP as an example, in some embodiments of the present application, the software structure of the Android system is divided into five layers, from top to bottom, the application layer, the application framework layer (Framework), the Android runtime and system library, the hardware abstraction layer (HAL), and the system kernel layer (Kernel).
[0111] The application layer can include a series of application packages. The application packages can include applications such as camera, gallery, calendar, call, map, WLAN, Bluetooth, music, video, and short message. The application layer can also include a note application. The application layer can also include a desktop application. The desktop application can provide quick access to various functions and applications on the electronic device. The desktop application in the Android system is implemented by using the Launcher of Android. The Launcher is an application program of the Android operating system, which is responsible for managing and presenting the user interface, including the desktop, the application drawer, and the widgets. It allows users to customize the home screen, icons, widget layout, and some basic functions of the phone, such as sliding effect and screen transition.
[0112] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer can include some pre-defined functions. For example, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. The phone manager is used to provide the call function of the electronic device, such as the management of the call state (including call connection, call hang-up, etc.). The application framework layer can also include an input module (input) and a SurfaceFlinger.
[0113] The input module can collect, process and distribute various input events (e.g., key events, touch events, etc.). In some embodiments of the present application, the input module can be an Input Manager Service (IMS). The IMS can listen to device nodes (e.g., all device nodes under / dev / input), and when a device node has data, the IMS can process the data and find a suitable window to which the input event is dispatched. In some embodiments of the present application, the input event management module can be inputflinger. The inputflinger is a service responsible for processing input events, which can receive raw input events from hardware devices and convert them into events that can be understood by the Android system, such as touch events, etc.
[0114] The SurfaceFlinger is responsible for managing the display of the UI of all applications, and is also responsible for combining the UI elements (e.g., text, images, views, etc.) of the applications into a complete image frame by interacting with the hardware abstraction layer (HAL) and GPU driver.
[0115] The runtime is responsible for the scheduling and management of the system. The runtime includes a core library and a virtual machine. The core library includes two parts: one part is the function functions required by the programming language (e.g., java language) to call, and the other part is the core library of the system. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the programming files (e.g., java files) of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.
[0116] The system library can include a plurality of functional modules. For example, media libraries, three-dimensional graphics processing libraries (e.g., OpenGL ES), and two-dimensional graphics engines (e.g., SGL), etc. The specific meanings and roles of these functional modules can be referred to related technical documents, which are not expanded here.
[0117] The hardware abstraction layer (HAL) is an interface layer between the operating system kernel and the upper layer software, and its purpose is to abstract the hardware. The hardware abstraction layer is an abstract interface of the device kernel driver, which is used to provide an application programming interface for accessing the underlying device to the higher level Java API framework. The HAL can provide a standard interface to display the device hardware functions to the higher level Java API framework. The HAL includes a plurality of library modules (e.g., camera HAL, audio HAL, etc.). When the system framework layer API requires access to the hardware of the portable device, the operating system will load the library module for the hardware component.
[0118] The kernel layer is the foundation of the Android system. It is responsible for hardware drivers, networking, power, system security, and memory management. The kernel layer acts as an intermediate layer between hardware and software, relaying application requests to the hardware. The kernel layer may include audio drivers, display drivers, camera drivers, and sensor drivers.
[0119] It should be noted that the software structure diagram of the electronic device shown in FIG6 provided in this application is merely an example and does not limit the specific module divisions within the different layers of the Android system. For details, please refer to the introduction of the Android system software structure in conventional technology. In addition, the method provided in this application can also be implemented based on other operating systems, and this application will not cite examples one by one.
[0120] The following describes an animation display method provided by an embodiment of the present application based on the software and hardware structure of the electronic device shown in FIG5 and FIG6 .
[0121] Please refer to Figure 7, which is a flow chart of an animation display method provided in an embodiment of the present application. The animation display method may include but is not limited to the following steps:
[0122] S101: In response to a user clicking a first application icon, the input module sends a first input event to the desktop application.
[0123] The user can trigger the electronic device to start the corresponding application by clicking an application icon. In response to the user clicking the first application icon, the input module can obtain a first input event and send the first input event to the desktop application. Correspondingly, the desktop application can receive the first input event sent by the input module.
[0124] It is understood that the first application icon can be an icon corresponding to any application in the application layer as shown in Figure 5, and this application does not impose specific limitations on this. For example, as shown in Figure 4A, the first application icon can be a camera application icon 101, and the first input event can be an input event generated by the input module in response to a user clicking on the camera application icon 101.
[0125] In some embodiments of the present application, in response to a user clicking on a first application icon, a lower-level module in the electronic device may convert a change in screen state caused by the user touching the screen into a raw input event (which may also be understood as encapsulating the change in screen state into an object of a more advanced class), and send the raw input event to the input module. After receiving the raw input event, the input module may process it to obtain a first input event. After obtaining the first input event, the input module may send the first input event to the desktop application.
[0126] In some embodiments of the present application, the input event can refer to an InputEvent object. InputEvent is a Java class, which can include multiple subclasses, such as MotionEvent and KeyEvent. Among them, MotionEvent can include a touch event, which is an input event generated by the user operating the device screen (i.e. the display screen) through the skin or a stylus. The touch event can include the following three types of events: a press event (e.g. MotionEvent.ACTION_DOWN), a movement event (e.g. MotionEvent.ACTION_MOVE), and a lift event (e.g. MotionEvent.ACTION_UP). It can be understood that a complete touch screen (or display screen) operation starts with a press event, and there can be no or one or more movement events in between, and ends with a lift event. For example, in the process of the user clicking the display screen with a finger, the user's finger falling on the display screen will trigger the electronic device to generate a press event, and the user's finger leaving the display screen will trigger the electronic device to generate a lift event. For another example, in the process of the user sliding the display screen with a finger, the user's finger falling on the display screen will trigger the electronic device to generate a press event, the user's finger falling on the display screen and sliding on the display screen will trigger the electronic device to generate multiple movement events, and the user's finger leaving the display screen will trigger the electronic device to generate a lift event.
[0127] In some embodiments of the present application, the first input event can be a touch event, which can specifically include a press event (e.g. MotionEvent.ACTION_DOWN) and a lift event (e.g. MotionEvent.ACTION_UP).
[0128] It can be understood that the user can also trigger the electronic device to start the first application through other ways (e.g. a specific voice instruction, a specific gesture instruction, etc.), which is not limited in the present application.
[0129] S102: The desktop application starts the first application, and judges whether the dynamic effect flag is true.
[0130] Optionally, the flag can be assigned a value before S102, and steps a and b are performed. In step a, the dynamic effect flag is assigned a value of the dynamic effect configuration information. In step b, when the desktop application is drawing an animation, the dynamic effect flag is assigned a value of false.
[0131] In a possible implementation, the animation configuration information is true when the electronic device supports the second animation drawing manner, and the animation configuration information is false when the electronic device does not support the second animation drawing manner. In another possible implementation, the animation configuration information includes preset animation information, which indicates that the electronic device supports the second animation drawing manner, and the animation flag is true; or the animation configuration information does not include preset animation information, which indicates that the electronic device does not support the second animation drawing manner, and the animation flag is false.
[0132] Because the desktop application does not draw an animation when the desktop application performs step S102, the animation flag is equal to the animation configuration information. When the animation configuration information is true, the animation flag is true.
[0133] It can be understood that the specific content of the animation configuration information and the animation flag is not limited in the present application, and in addition to true and false mentioned in the present application, 0 and 1 can also be used to represent, or other letters, strings, and the like can also be used to represent.
[0134] S103: When the animation flag is true, the desktop application sends the drawing parameters to the SurfaceFlinger, and the SurfaceFlinger draws the first startup animation.
[0135] Optionally, when the animation flag is false, the desktop application obtains the drawing parameters, and draws the first startup animation based on the obtained drawing parameters.
[0136] It can be understood that the animation flag being true indicates that the electronic device draws the current animation in the second animation drawing manner, and the animation flag being false indicates that the electronic device draws the current animation in the first animation drawing manner. It can be understood that the current animation mentioned herein can refer to the first startup animation. It can be understood that the first startup animation is an animation played in the process in which the desktop application starts the first application, and can be understood as a startup animation related to the change of the lifecycle of the activity corresponding to the application (for example, the first application) started by the electronic device. For related description of the startup animation, reference can be made to the foregoing, and the present application will not be described herein again.
[0137] In some embodiments of the present application, the desktop application drawing the first startup animation in the first animation drawing manner can be understood as constructing the first startup animation based on the first animation drawing manner, which specifically can include: the desktop application calculates the drawing parameters, draws the layers corresponding to each image frame of the first startup animation in the first animation drawing manner, such as the desktop layer (the first desktop layer or the second desktop layer), the icon layer, and the application layer, synthesizes the layers drawn, and sends the synthesized image frame to be displayed to the display screen for display.
[0138] It can be understood that the animation flag indicates that the desktop application is responsible for drawing the animation image frame. That is, in a case where the desktop application determines that the electronic device does not support the second animation drawing manner, the desktop application can draw the first startup animation in the first animation drawing manner, that is, the desktop application is responsible for drawing the animation image frame, and then sends the drawn image frame to the SurfaceFlinger for composition, and finally sends to the display for display. In this case, the desktop application can set the animation flag, and set the animation flag to false. In a case where the desktop application determines that the electronic device supports the second animation drawing manner, the desktop application can draw the first startup animation in the second animation drawing manner, that is, the desktop application is not responsible for drawing the animation image frame, but the SurfaceFlinger is responsible for drawing and composing the animation image frame, and finally sending to the display for display. In this case, the desktop application can set the animation flag, and set the animation flag to true.
[0139] In some embodiments of the present application, the desktop application can assign a value to the animation flag after the start of the first startup animation. The start of the first startup animation mentioned in the present application can refer to the state of the first startup animation changing to start, or the desktop application running the start() method corresponding to the first startup animation. In some embodiments of the present application, the desktop application draws the first startup animation in the second animation drawing manner, and in this case, after the desktop application sends the drawing parameters corresponding to each image frame of the first startup animation to the SurfaceFlinger, the state of the first startup animation changes to start. In some embodiments of the present application, the desktop application draws the first startup animation in the first animation drawing manner, and in this case, after the desktop application determines the drawing parameters corresponding to the first image frame of the first startup animation, the state of the first startup animation changes to start. In some embodiments of the present application, the desktop application draws the first startup animation in the first animation drawing manner, and in this case, the desktop application can determine the drawing parameters corresponding to the first image frame of the first startup animation, draw the layer corresponding to the first image frame of the first startup animation based on the drawing parameters, and after the desktop application sends the drawn first image frame of the first startup animation (or the drawn first image frame of the first startup animation) to the SurfaceFlinger, the state of the first startup animation changes to start.
[0140] In some embodiments of the present application, in a case where the desktop application determines that the electronic device supports the motion effect sinking, the desktop application can determine that the content to which the motion effect flag is assigned is true, and specifically, the motion effect flag can be assigned as true in the process of drawing the first startup animation in the second motion effect drawing manner. In a possible implementation manner, the desktop application can assign the motion effect flag as true after sending the drawing parameters corresponding to each image frame of the first startup animation to the SurfaceFlinger.
[0141] Similarly, in some embodiments of the present application, in a case where the desktop application determines that the electronic device does not support the motion effect sinking, the desktop application can determine that the content to which the motion effect flag is assigned is false, and specifically, the motion effect flag can be assigned as false in the process of drawing the first startup animation in the first motion effect drawing manner. In a possible implementation manner, the desktop application can assign the motion effect flag as false after determining the drawing parameters corresponding to the first image frame of the first startup animation. In a possible implementation manner, the desktop application can assign the motion effect flag as false after sending the first image frame of the first startup animation obtained by drawing to the SurfaceFlinger.
[0142] It can be understood that the desktop application can also assign the motion effect flag at other specific time periods in the process of constructing the first startup animation, which is not limited in the present application.
[0143] In some embodiments of the present application, the desktop application can assign the motion effect flag after determining that the electronic device supports the motion effect sinking and before constructing the startup animation.
[0144] It should be noted that the desktop application can clear the motion effect flag after the first startup animation ends playing. In some embodiments of the present application, after the last image frame of the first startup animation is displayed on the display screen, the desktop application can receive a corresponding callback, indicating that the first startup animation has been played completely (or ends playing). After receiving the corresponding callback, the desktop application can clear the motion effect flag.
[0145] In some embodiments of the present application, the motion effect configuration information can be pre-set in the electronic device. In some embodiments of the present application, the motion effect configuration information can include various configuration information corresponding to the motion effect (for example, the number of animation frames, the animation duration, the motion effect setting manner, etc.). In some other embodiments of the present application, the motion effect configuration information can be understood as the configuration information corresponding to the motion effect setting manner, and is only used to indicate whether the electronic device supports the motion effect sinking. It can be understood that the motion effect setting manner includes the motion effect sinking manner and the non-motion effect sinking manner.
[0146] In some embodiments of the present application, the preset animation effect information can be understood as configuration information corresponding to the animation effect sinking mode, i.e., configuration information corresponding to the window animation effect, and the present application does not limit the specific forms thereof. The presence of the preset animation effect information in the electronic device can indicate that the electronic device supports animation effect sinking, and the absence of the preset animation effect information in the electronic device can indicate that the electronic device does not support animation effect sinking.
[0147] It should be noted that the specific content of the animation effect flag can also be other forms (e.g., numbers, strings, etc.), which are not limited by the present application. For example, the electronic device can draw the animation in the second animation drawing mode by assigning the flag a value of 1, and draw the animation in the first animation drawing mode by assigning the flag a value of 0.
[0148] The meanings of the two animation drawing modes (the first animation drawing mode and the second animation drawing mode) have been briefly mentioned above, and the process of constructing an animation based on the first animation drawing mode and the second animation drawing mode will be briefly introduced below by taking the first startup animation as an example.
[0149] 1. The desktop application draws the first startup animation (the first animation drawing mode).
[0150] Step 1: The desktop application determines the total number of image frames Z of the first startup animation that the first application needs to play during the startup process, and obtains Z sets of drawing parameters corresponding to the Z image frames of the first startup animation. It can be understood that the Z sets of drawing parameters correspond to the Z image frames of the first startup animation, respectively.
[0151] In some embodiments of the present application, the image frames in the first startup animation drawn by the desktop application can include the first desktop layer and the application layer. In this case, the drawing parameters corresponding to each image frame of the first startup animation can include the drawing parameters corresponding to the first desktop layer and the drawing parameters corresponding to the application layer. That is, each set of drawing parameters in the Z sets of drawing parameters corresponding to the Z image frames of the first startup animation can include the drawing parameters corresponding to the first desktop layer and the drawing parameters corresponding to the application layer.
[0152] Second step: the desktop application draws the first desktop layer and the application layer in each image frame of the first start-up animation (or the first desktop layer and the application layer corresponding to each image frame) based on each set of drawing parameters in the Z sets of drawing parameters, and sends the drawn first desktop layer and application layer to the SurfaceFlinger. That is, the desktop application can send the drawn first desktop layer and application layer to the SurfaceFlinger after drawing the first desktop layer and the application layer based on each set of drawing parameters. Correspondingly, the SurfaceFlinger can receive the drawn first desktop layer and application layer sent by the desktop application.
[0153] In some embodiments of the present application, the desktop application can draw the first desktop layer and the application layer corresponding to each image frame of the first start-up animation based on a set of drawing parameters corresponding to the image frame after obtaining the set of drawing parameters, send the drawn first desktop layer and application layer to the SurfaceFlinger, and then obtain a set of drawing parameters corresponding to the next image frame of the first start-up animation, and draw the first desktop layer and the application layer corresponding to the next image frame based on the set of drawing parameters, and send the drawn first desktop layer and application layer corresponding to the next image frame to the SurfaceFlinger.
[0154] In some embodiments of the present application, the Z sets of drawing parameters corresponding to the Z image frames of the first start-up animation have a preset order, and the desktop application can directly draw the first desktop layer and the application layer corresponding to each image frame based on each set of drawing parameters in the Z sets of drawing parameters based on the preset order.
[0155] Third step: the SurfaceFlinger synthesizes the drawn first desktop layer and application layer corresponding to each image frame of the first start-up animation after receiving the drawn first desktop layer and application layer (or each time the SurfaceFlinger receives the first desktop layer and application layer), obtains a to-be-displayed image frame (or a frame of to-be-displayed image), and sends the to-be-displayed image frame to the display driver.
[0156] Fourth step: the display driver sends each to-be-displayed image frame received by the SurfaceFlinger to the display for display. In this way, the display can display the first image frame to the Zth image frame of the first start-up animation.
[0157] 2. The SurfaceFlinger draws the first start-up animation (second animation drawing mode).
[0158] The first step: the desktop application determines the total number of image frames, i.e., Z, of the first start-up animation that the first application needs to play during the start-up process, and obtains Z sets of drawing parameters corresponding to the Z image frames of the first start-up animation. It can be understood that the Z sets of drawing parameters correspond to the Z image frames of the first start-up animation respectively.
[0159] It can be understood that each set of drawing parameters can include the drawing parameters corresponding to one or more windows (or layers). That is, in the case where one image frame includes multiple layers, the drawing parameters corresponding to this image frame can include the drawing parameters corresponding to the multiple layers respectively.
[0160] In some embodiments of the present application, the image frames in the first start-up animation drawn by the SurfaceFlinger can include an icon layer, a second desktop layer and an application layer. In this case, the drawing parameters corresponding to each image frame of the first start-up animation can include the drawing parameters corresponding to the icon layer, the drawing parameters corresponding to the second desktop layer and the drawing parameters corresponding to the application layer. That is, each set of drawing parameters in the Z sets of drawing parameters corresponding to the Z image frames of the first start-up animation can include the drawing parameters corresponding to the icon layer, the drawing parameters corresponding to the second desktop layer and the drawing parameters corresponding to the application layer.
[0161] In some embodiments of the present application, the image frames in the first start-up animation drawn by the SurfaceFlinger can include a second desktop layer and an application layer. In this case, the drawing parameters corresponding to each image frame of the first start-up animation can include the drawing parameters corresponding to the second desktop layer and the drawing parameters corresponding to the application layer. That is, each set of drawing parameters in the Z sets of drawing parameters corresponding to the Z image frames of the first start-up animation can include the drawing parameters corresponding to the second desktop layer and the drawing parameters corresponding to the application layer.
[0162] It can be understood that the drawing parameters can include any one or more of the parameters such as transparency (alpha), scaling (scale), translation (translate) and rotation (rotate), and the present application does not limit the specific contents thereof.
[0163] The second step: the desktop application sends the Z sets of drawing parameters obtained to the SurfaceFlinger. Correspondingly, the SurfaceFlinger can receive the Z sets of drawing parameters sent by the desktop application.
[0164] The third step: the SurfaceFlinger draws the second desktop layer and the application layer (or the icon layer, the second desktop layer and the application layer) based on each set of drawing parameters in the Z sets of drawing parameters.
[0165] Step 4: SurfaceFlinger composites the second desktop layer and the application layer (or the icon layer, the second desktop layer and the application layer) into one image frame, i.e., a to-be-displayed image frame, based on each set of drawing parameters, and sends the to-be-displayed image frame to the display driver. Correspondingly, the display driver can receive the to-be-displayed image frame sent by SurfaceFlinger.
[0166] In some embodiments of the present application, the Z sets of drawing parameters sent by the desktop application to SurfaceFlinger have a preset order, and SurfaceFlinger can directly draw each image frame based on each set of drawing parameters in the Z sets of drawing parameters based on the preset order.
[0167] Step 5: The display driver displays the to-be-displayed image frame (or the already-drawn and composited image frame) on the display screen. In this way, the display screen can display the first 1 image frame to the first Z image frame of the first startup animation.
[0168] S104: In response to the operation of the user sliding upward from the bottom of the screen, the input module sends a second input event to the desktop application.
[0169] The user can slide upward from the bottom of the screen to trigger the electronic device to return to the desktop (which can also be understood as displaying the desktop interface). In response to the operation of sliding upward from the bottom, the input module can obtain a second input event and send the second input event to the desktop application. Correspondingly, the desktop application can receive the second input event sent by the input module.
[0170] It can be understood that the specific implementation manner of the input module obtaining the second input event can refer to the related description of step S101, and the present application will not repeat the description here.
[0171] In some embodiments of the present application, the second input event can be a touch screen event, which can specifically include a falling event (for example, MotionEvent.ACTION_DOWN), multiple moving events (for example, MotionEvent.ACTION_MOVE) and a lifting event (for example, MotionEvent.ACTION_UP).
[0172] According to the above, the user can also trigger the electronic device to return to the desktop through other manners, which is not limited in the present application.
[0173] S105: The desktop application determines whether the first startup animation exists.
[0174] After receiving the second input event sent by the input module, the desktop application can determine whether the first startup animation exists. In some embodiments of the present application, the desktop application can determine whether the animation object corresponding to the first startup animation exists in the electronic device. If the animation object corresponding to the first startup animation exists in the electronic device, the desktop application can determine that the first startup animation exists, and in this case, the desktop application can execute step S106. If the animation object corresponding to the first startup animation does not exist in the electronic device, the desktop application can determine that the first startup animation does not exist, and in this case, the desktop application can execute step S108.
[0175] In some embodiments of the present application, after receiving the second input event sent by the input module, the desktop application can not execute step S105, but directly execute step S106. That is, after receiving the second input event sent by the input module, the desktop application can determine whether the first startup animation is finished.
[0176] S106: The desktop application can determine whether the first startup animation is finished.
[0177] If the desktop application determines that the first startup animation exists, the desktop application can determine whether the first startup animation is finished. If the first startup animation is finished, the desktop application can continue to execute step S108. If the first startup animation is not finished, the desktop application can execute step S107, and then execute step S108 after executing step S107, that is, the desktop application can first finish the first startup animation and then execute step S108.
[0178] In some embodiments of the present application, the desktop application can determine whether the first startup animation is finished, which can specifically include that the desktop application can determine whether the state of the first startup animation is end. If the state of the first startup animation is end, the first startup animation is finished, and in this case, the desktop application can execute step S108. If the state of the first startup animation is not end, the first startup animation is not finished, and in this case, the desktop application can execute step S107, that is, finish the first startup animation.
[0179] It should be noted that the end of the first startup animation mentioned in the present application can be understood as the completion of the drawing, synthesis and display of all image frames (such as the Z image frames of the first startup animation mentioned above) of the first startup animation. In some embodiments of the present application, after the electronic device displays the last image frame of the first startup animation through the display screen, the desktop application can set the state of the first startup animation from start to end.
[0180] S107: The desktop application finishes the first startup animation.
[0181] If the first startup animation has not ended (or is not stopped from being built) after the desktop application receives the second input event sent by the input module of the desktop application, the desktop application can end the first startup animation first, and then execute step S108.
[0182] In some embodiments of the present application, the desktop application draws the first startup animation in the second animation effect drawing manner, and in this case, the desktop application ending the first startup animation can specifically include: the desktop application notifying the SurfaceFlinger to stop drawing the image frame of the first startup animation based on the drawing parameters, which can also be understood as the desktop application notifying the SurfaceFlinger to stop drawing the image frame of the first startup animation based on the drawing parameters corresponding to the layer.
[0183] In some embodiments of the present application, the desktop application can call the setAnimState() method to notify the SurfaceFlinger to stop drawing the image frame of the first startup animation based on the drawing parameters. The setAnimState() method can represent the animation state, and when the parameter value is 1, it means starting, when the parameter value is 2, it means canceling, and when the parameter value is 3, it means ending. According to the above, the first startup animation can include one or more layers (or windows), and the desktop application can specifically notify the SurfaceFlinger to stop drawing the one or more layers by calling the setAnimState() method. For example, the first startup animation can include a desktop layer and an application layer, and in this case, the desktop application can set setAnimState(2) for the desktop layer, indicating that the drawing of the desktop layer is canceled, and call setAnimState(2) for the application layer, indicating that the drawing of the application layer is canceled.
[0184] In some embodiments of the present application, the desktop application draws the first startup animation in the first animation effect drawing manner, and in this case, the desktop application ending the first startup animation can specifically include: the desktop application stopping the layer corresponding to the image frame of the first startup animation based on the drawing parameters.
[0185] Optionally, the desktop application executing step S106-step S108 can specifically include: when the first startup animation has not ended, the desktop application can first end the first startup animation, and then execute step S107-step S108, and when the first startup animation has ended, the desktop application can execute step S108.
[0186] S108: The desktop application determines whether the target interface is a desktop interface.
[0187] In a case where the first startup animation exists and has ended (including a case where the first startup animation is ended by the desktop application when the first startup animation has not been played to completion), the desktop application can determine whether the target interface is a desktop interface. If the target interface is a desktop interface, the desktop application can perform step S109. In some embodiments of the present application, if the target interface is not a desktop interface, the desktop application can determine a specific response manner based on the target interface. For example, if the target interface is a multitasking interface, the desktop application can draw a task card and send it to the SurfaceFlinger, which synthesizes it to obtain a to-be-displayed image frame, and then sends the to-be-displayed image frame to the display screen for display. The target interface refers to a to-be-switched interface (or a to-be-displayed interface). That is, the desktop application actually determines whether the electronic device switches from displaying another interface to displaying a desktop interface.
[0188] In some embodiments of the present application, the desktop application determines whether the target interface is a desktop interface, which can specifically include that the desktop application determines whether the sliding distance and the sliding speed satisfy the preset condition based on the received input event (for example, the second input event, the fourth input event, etc.).
[0189] Taking the second input event as an example, after the desktop application receives the second input event sent by the input receiving module, steps S105-S107 can be performed, and then it is determined whether the sliding distance and the sliding speed satisfy the preset condition based on the second input event. If the sliding distance and the sliding speed satisfy the preset condition, the desktop application can continue to perform step S109.
[0190] It can be understood that the second input event can include position information (for example, X / Y coordinates) corresponding to the operation of the user sliding from the bottom of the screen to the top, and can also be understood as position information of the contact point (or touch point) of the user and the screen.
[0191] According to the above, in some embodiments of the present application, the second input event can be a MotionEvent. It can be understood that in the MotionEvent class, the action that generates this event is called motion, and the subject (for example, a finger, a mouse, a stylus, etc.) that generates this action is called pointer. One MotionEvent object can contain one or more pointers, and each pointer contains attributes such as id, index, position, size, direction, etc. In this case, the desktop application can determine the sliding distance and the sliding speed based on the position and direction contained in the pointer in the second input event.
[0192] According to the above, in some embodiments of the present application, the second input event can include one drop event (for example, MotionEvent.ACTION_DOWN), a plurality of movement events (for example, MotionEvent.ACTION_MOVE) and one lift event (for example, MotionEvent.ACTION_UP). The sliding distance mentioned above can specifically refer to the moving distance of the coordinates of the touch point, and the sliding speed mentioned above can specifically refer to the moving speed of the touch point. The sliding distance determined by the desktop application based on the second input event can be understood as the distance between the touch point corresponding to the drop event and the touch point corresponding to the lift event in the second input event. In some embodiments of the present application, the desktop application can not only determine the sliding distance based on the coordinates of the press event and the lift event included in the second input event, but also determine the sliding time length (which can be specifically the time length between the generation of the press event and the generation of the lift event), and then calculate the sliding speed based on the sliding distance and the sliding time length.
[0193] In still some embodiments of the present application, the desktop application can calculate the sliding speed by calling the computeCurrentVelocity() method.
[0194] In some embodiments of the present application, after the desktop application receives the lift event included in the second input event (which can be understood as that the user slides from the bottom of the screen to the top and lifts the hand), the desktop application can determine the sliding distance and the sliding speed of the screen (i.e. the sliding speed after lifting the hand), and determine whether the sliding distance and the sliding speed meet the preset condition.
[0195] In some embodiments of the present application, whether the sliding distance and the sliding speed meet the preset condition can specifically include that the sliding distance is greater than the preset sliding distance, and the sliding speed is greater than the preset sliding speed. It can be understood that the preset sliding distance and the preset sliding speed can be set according to actual needs, and the present application does not limit this.
[0196] In some embodiments of the present application, if the sliding distance and the sliding speed do not meet the preset condition, the desktop application can further determine whether the operation of sliding from the bottom of the screen to the top of the screen needs to be responded to based on the sliding distance and the sliding speed, and the specific response mode. For example, if the sliding distance and the sliding speed do not meet the preset condition, but meet the sliding condition of triggering the display of the task card list, the desktop application can draw the task card list and send it to the display screen for display.
[0197] S109: The desktop application determines whether the second start animation exists.
[0198] After the desktop application determines that the target interface is a desktop interface, the desktop application can determine whether the second startup animation exists. Similar to step S105, in some embodiments of the present application, the desktop application can determine whether an animation object corresponding to the second startup animation exists in the electronic device. If the animation object corresponding to the second startup animation exists in the electronic device, the desktop application can determine that the second startup animation exists, and in this case, the desktop application can execute steps S110-S111, and then execute steps S112-S118. If the animation object corresponding to the second startup animation does not exist in the electronic device, the desktop application can determine that the second startup animation does not exist, and in this case, the desktop application can execute steps S112-S118.
[0199] In some embodiments of the present application, after the desktop application determines that the target interface is a desktop interface, the desktop application can not execute step S109, but directly execute step S110. That is, after the desktop application receives the determination that the target interface is a desktop interface, the desktop application can determine whether the second startup animation ends.
[0200] S110: The desktop application determines whether the second startup animation ends.
[0201] If the desktop application determines that the second startup animation exists, the desktop application can determine whether the second startup animation ends. If the second startup animation ends, the desktop application can continue to execute step S111. If the second startup animation has not ended, the desktop application can execute step S111, and then execute step S112 after executing step S111, that is, the desktop application can end the second startup animation before executing step S112.
[0202] Similar to step S106, in some embodiments of the present application, the desktop application determines whether the second startup animation ends, which can specifically include that the desktop application can determine whether the state of the second startup animation is end. If the state of the second startup animation is end, the second startup animation has ended, and in this case, the desktop application can execute step S112. If the state of the first startup animation is not end, the first startup animation has not ended, and in this case, the desktop application can execute step S111, that is, end the second startup animation, and then execute step S112.
[0203] It can be understood that the meaning of the end of the second startup animation can refer to the description of the meaning of the end of the first startup animation in step S106, which will not be repeated here.
[0204] Optionally, in combination with step S109 and step S110, in another possible implementation, the desktop application can determine whether the second startup animation exists and the second startup animation has not ended (or is not stopped playing). If the second startup animation exists and the second startup animation has not ended, the desktop application can execute step S111, and then execute step S112 after executing step S111. If the second startup animation does not exist and the second startup animation has not ended, the desktop application can execute step S112.
[0205] S111: The desktop application stops drawing the second startup animation.
[0206] If the desktop application determines that the second startup animation has not ended, the desktop application can stop drawing the second startup animation, which can also be understood as canceling drawing the second startup animation. In some embodiments of the present application, the desktop application can set a listener for the second startup animation during the process of constructing (or creating) the second startup animation. The desktop application can listen to an interruption event (or an input event that interrupts the second startup animation) of the second startup animation, such as a fourth input event, through the listener. After the desktop application listens to the interruption event of the second startup animation through the listener, the desktop application can stop drawing the second startup animation. It can be understood that the desktop application receives an input event, can execute steps S105-S110, and after determining that the second startup animation has not ended, the desktop application can determine that the interruption event of the second startup animation is listened to through the listener.
[0207] S112: The desktop application determines whether the animation flag is true.
[0208] Optionally, in combination with step S102, the desktop application can determine whether the electronic device supports the second animation drawing mode by determining whether the animation flag is true. If the animation flag is true, it indicates that the electronic device supports the second animation drawing mode. If the animation flag is false, it indicates that the electronic device does not support the second animation drawing mode.
[0209] Optionally, the flag can be assigned a value before S112, and steps a and b are executed. In step a, the animation flag is assigned a value of animation configuration information. In step b, when the desktop application is drawing an animation, the flag is assigned a value of false.
[0210] In a possible implementation, the animation configuration information is true when the electronic device supports the second animation drawing mode, and the animation configuration information is false when the electronic device does not support the second animation drawing mode. In another possible implementation, the animation configuration information includes preset animation information, which indicates that the electronic device supports the second animation drawing mode, and the animation flag is true; or the animation configuration information does not include preset animation information, which indicates that the electronic device does not support the second animation drawing mode, and the animation flag is false.
[0211] If the second startup animation does not exist, or the second startup animation exists and has ended, or the second startup animation exists and the desktop application stops drawing the second startup animation, the desktop application can determine whether the animation flag is true. If the animation flag is true, it indicates that the electronic device draws the current animation in the second animation drawing mode, and the desktop application can perform step S116, that is, the electronic device draws the return animation in the second animation drawing mode, that is, the desktop application can determine the drawing parameters, sends the drawing parameters to the SurfaceFlinger, the SurfaceFlinger draws the return animation based on the drawing parameters, and after step S116 is performed, the desktop application can further perform steps S114 and S117. If the animation flag is not true, it indicates that the electronic device draws the current animation in the first animation drawing mode, and the desktop application can perform step S113, that is, the desktop application draws the return animation in the first animation drawing mode. It can be understood that the current animation mentioned herein can be understood as a startup animation that is interrupted or a startup animation that has ended (or a startup animation that has ended playing). In the case where the second startup animation does not exist, the current animation can be understood as the first startup animation, and in the case where the second startup animation exists, the current animation can be understood as the second startup animation.
[0212] In some embodiments of the present application, if the desktop application determines that the startup animation has ended during the execution of step S106, it indicates that the startup animation ends by itself and is not interrupted during playing, in which case the desktop application can clear the animation flag set by it. In this way, the desktop application can reassign the animation flag to the animation configuration information before executing step S112. In this way, the desktop application can execute step S112 again based on the animation flag after the reassignment.
[0213] In some embodiments of the present application, if the desktop application determines that the start animation is not ended during the execution of step S106, it indicates that the start animation is interrupted, and in this case, the desktop application does not clear the animation flag set by it. In this way, the desktop application can directly determine whether the animation flag is true during the execution of step S112. If the animation flag is true, the electronic device can execute step S116, step S114 and step S117, and if the animation flag is not true but false, the electronic device can execute step S113-step S115.
[0214] S113: The desktop application draws the return animation in the first animation drawing mode and sets a listener for the return animation object.
[0215] If the animation flag is not true, it indicates that the electronic device draws the current animation in the first animation drawing mode, and the desktop application can continue to draw the return animation in the first animation drawing mode. It can be understood that the specific implementation manner of the desktop application drawing the return animation in the first animation drawing mode can refer to the specific implementation manner of constructing the first start animation in the first animation drawing mode mentioned above (as shown in step S102), and the present application will not repeat it here.
[0216] In some embodiments of the present application, the desktop application can call the buildReverseAnimator() method to implement the construction of the animation based on the first animation drawing mode. For example, if the animation flag is not true, the desktop application can call the buildReverseAnimator() method to construct the return animation. The buildReverseAnimator() method can specifically involve setTranslationX(), setTranslationY(), setScaleX(), setScaleY() and setRadius(). Among them, setTranslationX() and setTranslationY() respectively represent the offset (or displacement / translation) in the X direction and the Y direction, setScaleX() and setScaleY() respectively represent the scale (or scaling) in the X direction and the Y direction, and setRadius() represents the circular arc radian.
[0217] In some embodiments of the present application, the desktop application can call the anmiator.addListener() method to set a listener for the animation object corresponding to the return animation (which can be referred to as a return animation object). The desktop application can listen to the input event received by the desktop application during the construction of the return animation through the listener, i.e., the interrupt event of the return animation (or the input event interrupting the return animation). In the case where the desktop application listens to the interrupt event of the return animation through the listener, the desktop application can stop drawing (or constructing) the return animation.
[0218] S114: In response to the operation of the user clicking the first application window or the first application icon, the input module sends a third input event to the desktop application.
[0219] During the drawing (or construction / play) of the return animation (e.g., drawing the return animation in the first animation effect drawing mode or drawing the return animation in the second animation effect drawing mode), the user can trigger the electronic device to continue starting the first application by clicking the first application window or the first application icon. In response to the operation of the user clicking the first application window or the first application icon, the input module sends a third input event to the desktop application. Correspondingly, the desktop application can receive the third input event sent by the input module. The third input event can be understood as an input event listened to by the desktop application through the listener set for the return animation object during the construction of the return animation. That is, during the drawing (or construction / play) of the return animation, the desktop application can listen to the input event sent by the input module to the desktop application through the listener, for example, during the drawing of the return animation, the desktop application listens to the third input event sent by the input module to the desktop application through the listener, in which case the third input event can be understood as an interrupt event of the return animation.
[0220] It can be understood that the specific implementation manner of the input module obtaining the third input event can refer to the specific implementation manner of the input module obtaining the first input event (as shown in step S101), which will not be described herein.
[0221] In some embodiments of the present application, similar to the first input event, the third input event can be a touch screen event, which can specifically include a press-down event (e.g., MotionEvent.ACTION_DOWN) and a lift-up event (e.g., MotionEvent.ACTION_UP).
[0222] S115: When the third input event is listened to through the listener, the desktop application stops drawing the return animation and draws the second start animation.
[0223] In the process of drawing the return animation in the first dynamic effect drawing mode, the desktop application can listen to the input events sent by the input module based on the listener. In the case that the input module sends a third input event to the desktop application through the listener, the desktop application can stop drawing the return animation, which can also be understood as canceling the drawing of the return animation, and draw the second start animation in the first dynamic effect drawing mode.
[0224] It can also be understood that when the return animation has not ended playing, the desktop application can receive the third input event sent by the input module, and based on the third input event, stop drawing the return animation and draw the second start animation in the first dynamic effect drawing mode.
[0225] It can be understood that the second start animation refers to the reverse animation of the return animation, which is different from the first start animation mentioned above. The first start animation mentioned above involves the change of the activity corresponding to the application (for example, the first application) started by the electronic device, and the size of the corresponding application window also changes during the change of the activity corresponding to the application. However, the second start animation does not involve the change of the activity corresponding to the application started by the electronic device, but involves the change of the corresponding application window. That is, the second start animation can be understood as a start animation that does not involve the change of the activity corresponding to the application.
[0226] In some embodiments of the present application, the first start animation can be the complete start animation mentioned above (as shown in FIG. 2A), that is, the animation composed of the first image frame to the Zth image frame of the start animation, and the second start animation can be the animation composed of the M1th image frame to the Zth image frame of the complete start animation mentioned above (as shown in FIG. 2A).
[0227] In some embodiments of the present application, the desktop application can set a listener for the second startup animation, and listen to the input event received in the process of drawing the second startup animation, i.e., the interruption event of the second startup animation (or the input event interrupting the second startup animation) through the listener. If the desktop application listens to the interruption event of the second startup animation through the listener, the desktop application can stop drawing the second startup animation, or cancel the second startup animation, which can be understood with reference to step S111. In some embodiments of the present application, the desktop application listening to the interruption event of the second startup animation through the listener can involve steps S118, S105-S110. Specifically, after the desktop application listens to the fourth input event sent by the input module to the desktop application through the listener, the desktop application can determine that the first startup animation does not exist, and then determine whether the target interface is the desktop interface. If the target interface is the desktop interface, the desktop application can determine that the second startup animation exists and has not ended. In this case, the fourth input event listened to by the desktop application through the listener can be understood as the interruption event of the second startup animation. Further, the desktop application can stop drawing the second startup animation (or cancel drawing the second startup animation), and then execute steps S111-S117.
[0228] It should be noted that after the desktop application executes step S115, the entire return animation drawing process ends, and the desktop application can subsequently receive the input event sent by the input module. In response to the input event, the desktop application can execute steps S105-S115 again. For example, according to the foregoing, after the desktop application executes step S115, the desktop application can receive the fourth input event sent by the input module (e.g., step S118), and then execute steps S105-S115.
[0229] S116: The desktop application sends the drawing parameters to the SurfaceFlinger, the SurfaceFlinger draws the return animation, and the desktop application sets a listener for the return animation object.
[0230] If the animation flag is true, it indicates that the electronic device draws the current animation in the second animation drawing mode. The electronic device can continue to draw the return animation in the second animation drawing mode, i.e., the desktop application can determine the drawing parameters, send the drawing parameters to the SurfaceFlinger, and the SurfaceFlinger can draw the return animation based on the drawing parameters. The desktop application can set a listener for the animation object corresponding to the return animation (i.e., the return animation object). The listener can be described with reference to step S113, which will not be described herein.
[0231] Further, after the desktop application draws the return animation, the desktop application can receive the third input event sent by the input module (e.g., step S114), and then perform step S117. In some embodiments of the present application, the desktop application can listen to the third input event sent by the input module through a listener set for the return animation object. The specific implementation manner can refer to the related description of step S113 and step S115, and will not be described herein again.
[0232] It can be understood that the desktop application draws the return animation in the second dynamic effect drawing manner, which can specifically include: the desktop application calculates the drawing parameters corresponding to the return animation and sends the drawing parameters to the SurfaceFlinger, and then the SurfaceFlinger draws frame by frame, after drawing the layer corresponding to each image frame, composites the layer to obtain a to-be-displayed image frame, and then displays the to-be-displayed image frame. The specific implementation manner of the desktop application drawing the return animation in the second dynamic effect drawing manner can refer to the specific implementation manner of drawing the first start animation in the second dynamic effect drawing manner (e.g., step S102) mentioned above, and will not be described herein again. It should be noted that in some embodiments of the present application, the image frame of the start animation drawn in the second dynamic effect drawing manner can be obtained by compositing the second desktop layer and the application layer, and the image frame of the return animation drawn in the second dynamic effect drawing manner can be obtained by compositing the icon layer, the second desktop layer and the application layer. In this case, compared with drawing the start animation, more layers are involved in the process of drawing the return animation, and the corresponding drawing parameters will also be more.
[0233] It is worth noting that if the desktop application determines that the first startup animation has ended after receiving the second input event, the return animation drawn by the desktop application in the second animation drawing manner is a complete return animation, such as a return animation including Z image frames in total (as shown in FIG. 1B and FIG. 2B). That is, the desktop application can determine the total number of frames of the return animation, that is, Z, and obtain Z sets of drawing parameters corresponding to Z image frames of the return animation, and then send the Z sets of drawing parameters to the SurfaceFlinger. However, if the desktop application determines that the first startup animation has not ended after receiving the second input event, the return animation drawn by the desktop application in the second animation drawing manner is not a complete return animation. In this case, the desktop application can calculate the drawing parameters corresponding to a starting image frame (for example, the N1th image frame of the complete return animation shown in FIG. 3A) of the return animation and the drawing parameters corresponding to a last image frame of the return animation based on the drawing parameters corresponding to the image frame (for example, the M1th image frame of the startup animation, or the M1th image frame of the complete startup animation shown in FIG. 3A) displayed by the electronic device when the first startup animation is interrupted. In some embodiments of the present application, the desktop application can calculate the number of the image frame (or the sequence number of the frame number) of the first startup animation displayed by the electronic device when the desktop application ends the first startup animation, and determine the number of the image frame (or the sequence number of the frame number) of the return animation corresponding to the image frame. That is, the desktop application can calculate the sequence number of the frame number of the return animation corresponding to the sequence number of the frame number of the first startup animation displayed by the electronic device when the first startup animation is ended. Further, the desktop application can obtain the drawing parameters corresponding to other image frames of the return animation appearing after the image frame, and send the drawing parameters corresponding to the other image frames to the SurfaceFlinger.
[0234] For example, the first startup animation can be the startup animation shown in FIG. 3A, in which case the desktop application can determine that the M1th image frame of the first startup animation is displayed by the electronic device when the desktop application ends the first startup animation, and determine that the M1th image frame of the startup animation corresponds to the N1th image frame of the return animation. In this way, the desktop application can determine the drawing parameters corresponding to the N1th image frame of the return animation based on the drawing parameters corresponding to the M1th image frame of the first startup animation, and then obtain the drawing parameters corresponding to the N1+1th image frame to the Zth image frame (i.e., the last image frame of the return animation) of the return animation based on the drawing parameters corresponding to the N1th image frame of the return animation, and send the drawing parameters to the SurfaceFlinger.
[0235] In some embodiments of the present application, the desktop application can call the compareBuildReverseForSink() method to implement the construction of the animation based on the second dynamic effect drawing mode, which can specifically involve setAnimState(), scheduleApply(), setTranslationX(), setTranslationY(), setScaleX(), setScaleY(), and setRadius(). Among them, scheduleApply() can realize the conversion from drawing the animation in the second dynamic effect drawing mode to drawing the animation in the first dynamic effect drawing mode. Specifically, the desktop application can call the compareBuildReverseForSink() method to draw the return animation in the second dynamic effect drawing mode. If the return animation is interrupted, the desktop application can call the scheduleApply() method to realize the transition between the second dynamic effect drawing mode and the first dynamic effect drawing mode, and continue to call the buildReverseAnimator() method to draw the return animation in the first dynamic effect drawing mode after calling the scheduleApply() method. The other functions involved can refer to the related description in the above, which will not be repeated here.
[0236] S117: When the third input event is listened by the listener, the desktop application notifies the SurfaceFlinger to stop drawing the return animation, prepares to draw the transition image frame, and draws the second start animation.
[0237] In the process of drawing the return animation by the electronic device in the second dynamic effect drawing mode (which can be understood as the SurfaceFlinger drawing the return animation), the desktop application can listen to the input events sent by the input module based on the listener. In the case that the input module sends the third input event to the desktop application through the listener, the desktop application can stop drawing the return animation, which can also be understood as canceling the drawing of the return animation, prepare to draw the transition image frame, and draw the second start animation in the first dynamic effect drawing mode. The related description of the second start animation can refer to step S115, which will not be repeated here.
[0238] According to the above, it can also be understood that when the return animation has not ended playing, the desktop application can receive the third input event sent by the input module, and based on the third input event, stop drawing the return animation, prepare to draw the transition image frame, and draw the second start animation in the first dynamic effect drawing mode.
[0239] In some embodiments of the present application, the electronic device receives an operation of clicking the first application window or the first application icon by the user (or the input module obtains the third input event) when the return animation is not ended, the desktop application can determine that the third input event is the input event for interrupting the return animation, and in this case, the desktop application can listen to the third input event through the listener set for the return animation object.
[0240] It can be understood that, according to step S116, the desktop application draws the return animation in the second animation effect drawing mode, and then the desktop application stops drawing the return animation, which can specifically include that the desktop application notifies the SurfaceFlinger to stop drawing the image frame of the synthesized return animation based on the drawing parameters, or it can also be understood that the desktop application notifies the SurfaceFlinger to stop drawing the image frame of the return animation based on the drawing parameters. The layer corresponding to the drawing parameters.
[0241] In some embodiments of the present application, the return animation can include an icon layer, a desktop layer (for example, a second desktop layer), and an application layer. The desktop application stops drawing the return animation, or the desktop application notifies the SurfaceFlinger to stop drawing the image frame of the synthesized return animation based on the drawing parameters, which can specifically include that the desktop application can set setAnimState(2) for the application layer, indicating that the drawing of the application layer is cancelled, and setAnimState(2) is not set for the desktop layer.
[0242] The following describes a specific implementation of step S117 in combination with FIG. 8. It can be understood that, based on the third input event listened to by the desktop application through the listener, the specific implementation of the desktop application for stopping drawing the return animation can include steps S201-S203, the specific implementation of the desktop application for preparing to draw the transition image frame can include steps S204-S210, and the specific implementation of the desktop application for drawing the second start animation in the first animation effect drawing mode can include steps S211-S212.
[0243] S201: The desktop application destroys the icon layer.
[0244] According to the foregoing, in the process of drawing the animation in the second animation effect drawing mode, the desktop layer (for example, the second desktop layer), the icon layer, and the application layer are drawn, synthesized, and then displayed on the display screen of the electronic device. It can be understood that, in the process of drawing the return animation by the desktop application in the second animation effect drawing mode, the desktop application can create the icon layer.
[0245] Specifically, in the process of drawing the return animation in the second dynamic effect drawing manner, the desktop application can send a plurality of groups of drawing parameters corresponding to a plurality of image frames included in the return animation to the SurfaceFlinger, the SurfaceFlinger can draw the desktop layer, the icon layer and the application layer based on the plurality of groups of drawing parameters, and synthesize them to obtain a to-be-displayed image frame, and then send the to-be-displayed image frame to the display screen for display. Each group of drawing parameters can include drawing parameters corresponding to the desktop layer (for example, the second desktop layer), drawing parameters corresponding to the icon layer, and drawing parameters corresponding to the application layer.
[0246] After the desktop application receives the third input event sent by the input event receiving module, or based on the third input event listened to by the listener, the icon layer can be destroyed. It can be understood that after the icon layer is destroyed, the desktop application does not need to obtain the drawing parameters corresponding to the icon layer, and the SurfaceFlinger also does not need to draw the icon layer.
[0247] S202: The desktop application notifies the SurfaceFlinger to stop drawing the return animation.
[0248] After the desktop application destroys the icon layer, the desktop application can notify the SurfaceFlinger to stop drawing the layers corresponding to the image frames of the return animation based on the drawing parameters, and to stop synthesizing the image frames of the return animation based on the layers drawn. In some embodiments of the present application, after the desktop application notifies the SurfaceFlinger to stop drawing the return animation, the SurfaceFlinger can receive a notification sent by the desktop application to stop drawing the return animation, and stop drawing the return animation based on the notification. In some embodiments of the present application, the desktop application can directly notify the SurfaceFlinger to stop drawing the return animation by calling a corresponding function, in which case the desktop application will not receive a corresponding notification.
[0249] In some embodiments of the present application, after the desktop application destroys the icon layer, the desktop application can call setAnimState(2) for the application layer, indicating that the drawing of the application layer is cancelled, and setAnimState(2) is not set for the desktop layer, indicating that the drawing of the desktop layer is not cancelled. It can be understood that after the desktop application calls setAnimState(2) for the application layer, the SurfaceFlinger can stop drawing the application layer.
[0250] S203: The SurfaceFlinger stops drawing the return animation.
[0251] After the desktop application notifies the SurfaceFlinger to stop drawing the return animation, the SurfaceFlinger can stop drawing the layer corresponding to the image frame of the return animation based on the drawing parameters, and stop synthesizing the image frame of the return animation based on the drawn layer. Specifically, the SurfaceFlinger can stop drawing the application layer, but still draw the desktop layer (which can be referred to below).
[0252] S204: The desktop application determines the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation, and calculates the drawing parameters corresponding to the application layer in the N2th image frame of the return animation and the drawing parameters corresponding to the desktop layer in the N2th image frame of the return animation according to the playing duration of the return animation. The N2th image frame of the return animation is the last image frame of the return animation displayed by the electronic device before stopping building the return animation.
[0253] For the convenience of understanding and description, the last image frame of the return animation (or the last frame of the return animation image) displayed by the electronic device before stopping drawing the return animation (or stopping playing / building the return animation) is recorded as the N2th image frame of the return animation (as shown in FIGS. 3A and 3B) in this application.
[0254] After the desktop application notifies the SurfaceFlinger to stop drawing the return animation, the last image frame of the return animation (or the Zth image frame of the return animation) can be determined. The drawing parameters corresponding to the desktop layer in the N2th image frame of the return animation are determined, and the drawing parameters corresponding to the application layer in the N2th image frame of the return animation and the drawing parameters corresponding to the desktop layer (for example, the second desktop layer) are calculated according to the playing duration of the return animation. Specifically, the desktop application can determine the frame number sequence number N2 corresponding to the last image frame of the return animation displayed by the electronic device before stopping building the return animation (or stopping playing the return animation) in combination with the playing duration of the return animation, the total frame number of the return animation (i.e., Z mentioned above), and the screen refresh rate (indicating the frequency of refreshing the display image frame per second), and determine the drawing parameters corresponding to the N2th image frame of the return animation (which can be referred to as the N2th set of drawing parameters). It can be understood that the N2th set of drawing parameters can include the drawing parameters corresponding to the application layer in the N2th image frame of the return animation, and the drawing parameters corresponding to the desktop layer in the N2th image frame of the return animation.
[0255] S205: The desktop application sends the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation to the SurfaceFlinger.
[0256] After the desktop application determines the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation, the desktop application can send the drawing parameters to the SurfaceFlinger. Correspondingly, the SurfaceFlinger can receive the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation sent by the desktop application.
[0257] S206: The SurfaceFlinger draws the desktop layer based on the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation.
[0258] It can be understood that, in the process of drawing the return animation in the second dynamic effect drawing manner, the desktop application sends a plurality of groups of drawing parameters corresponding to a plurality of image frames in the return animation to the SurfaceFlinger. In some embodiments of the present application, the SurfaceFlinger can find the drawing parameters corresponding to the last image frame (or the Zth image frame) of the return animation from the plurality of groups of drawing parameters sent by the desktop application. The drawing parameters corresponding to the Zth image frame of the return animation can include the drawing parameters corresponding to the desktop layer in the Zth image frame.
[0259] In still some embodiments of the present application, the desktop application can determine the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation and send the drawing parameters to the SurfaceFlinger. For details, please refer to steps S204-S205.
[0260] After the SurfaceFlinger receives the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation sent by the desktop application, the SurfaceFlinger can draw the desktop layer based on the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation. The desktop layer drawn in this way is consistent with the desktop layer in the Zth image frame of the return animation, including the size and content of the desktop layer. That is, the desktop layer is adjusted (or adjusted) to the state in which the return animation is completely finished, that is, to the desktop layer in the image frame displayed by the electronic device when the return animation is completely finished (or the Zth image frame of the electronic device).
[0261] S207: The desktop application adjusts the size of the content in the desktop layer drawn by the SurfaceFlinger based on the drawing parameters corresponding to the desktop layer in the N2th image frame of the return animation.
[0262] After SurfaceFlinger draws the desktop layer based on the drawing parameters corresponding to the desktop layer in the Zth image frame of the return animation, the desktop application can adjust the size of the content (e.g., application icons or components other than the first application icon) in the drawn desktop layer based on the drawing parameters corresponding to the desktop layer in the N2th image frame of the return animation, to obtain a drawing-adjusted desktop layer. That is, the size of the content in the drawn desktop layer is adjusted to the size of the corresponding content in the image frame of the last frame of the return animation displayed by the electronic device before the return animation is stopped.
[0263] It should be noted that in the process of drawing the animation in the second dynamic effect drawing manner, the size of the desktop layer in the animation image frame and the size of the content therein are adjusted as a whole. For example, in the process of drawing the animation (e.g., a start animation, a return animation, etc.) in the second dynamic effect drawing manner, SurfaceFlinger draws the desktop layer in a certain image frame of the animation, and specifically, the desktop layer and the content therein can be reduced to 80% of the reference size, and draws the desktop layer in the next image frame of the animation, and specifically, the desktop layer and the content therein can be reduced to 60% of the reference size. In some embodiments of the present application, the scaling ratio of the desktop layer in the first image frame of the start animation is 1, the scaling ratio of the desktop layer in the last image frame of the start animation is 0.9, the scaling ratio of the desktop layer in the first image frame of the return animation is 0.9, and the scaling ratio of the desktop layer in the last image frame of the return animation is 1. It can be understood that the scaling ratio of the desktop layer in the image frames between the first image frame and the last image frame can be adjusted based on the number of image frames of the animation.
[0264] However, according to the related description of step S206 and step S207, after SurfaceFlinger stops drawing the return animation (specifically, can refer to stopping drawing the application layer), SurfaceFlinger can first draw the size of the desktop layer and the content therein as a whole, specifically, can draw in accordance with the desktop layer in the Zth image frame of the return animation, and the desktop application adjusts the size of the content in the desktop layer drawn by SurfaceFlinger, specifically, can adjust in accordance with the size of the corresponding content in the N2th image frame of the return animation, and finally, the size of the desktop layer drawn by SurfaceFlinger after adjustment is consistent with the desktop layer in the Zth image frame of the return animation, and the size of the content is consistent with the size of the corresponding content in the N2th image frame of the return animation. That is, the size of the desktop layer after drawing and adjustment and the scaling degree of the content are not completely consistent. For example, taking the size of the desktop layer in the desktop interface as a reference, in the process of constructing the return animation in the second dynamic drawing manner, the return animation is interrupted, and the desktop layer in the N2th image frame of the return animation displayed by the electronic device when the return animation is interrupted has been reduced to 80% of the reference size, after the return animation is interrupted, SurfaceFlinger can restore the desktop layer to the reference size, and the desktop application can reduce the content in the desktop layer after the restoration size to 80% of the reference size, that is, the size of the desktop layer (that is, the desktop layer in the transition image frame) finally drawn by SurfaceFlinger is consistent with the reference size, and the content in the desktop layer is still 80% of the reference size.
[0265] In some embodiments of the present application, the scaling ratio of the desktop layer in the first image frame of the complete start-up animation (for example, the first start-up animation) is 1, and the scaling ratio of the desktop layer in the last image frame thereof is 0.9, and similarly, the scaling ratio of the desktop layer in the first image frame of the complete return animation is 0.9, and the scaling ratio of the desktop layer in the last image frame thereof is 1, if the return animation is interrupted, SurfaceFlinger restores the desktop layer from the scaling ratio (for example, 0.95) when the return animation is interrupted to 1, and adjusts the scaling ratio of the content in the desktop layer from 1 to the scaling ratio (for example, 0.95) when the return animation is interrupted.
[0266] It also needs to be explained that for the user, the content in the desktop layer is visible, but the size is invisible, which can also be understood as a transparent layer with visible content.
[0267] In some embodiments of the present application, the desktop application can implement the drawing of the transition image frame by calling the scheduleApply() method. The scheduleApply() method can include a scaling ratio setting method for the desktop layer, such as the scaleX() and scaleY() set for the desktop layer, and a scaling ratio setting method for the content in the desktop layer, such as the scaleX() and scaleY() set for the content in the desktop layer, which can specifically set scaleX() and scaleY() for workSpace and hotSeat, respectively. For example, the scheduleApply() method can include setting scaleX(1.0f) and scaleY(1.0f) for the desktop layer, and setting scaleX(0.95f) and scaleY(0.95f) for workSpace and hotSeat, respectively. Among them, scaleX(1.0f) means that the scaling ratio in the X direction is adjusted to 1, scaleY(1.0f) means that the scaling ratio in the Y direction is adjusted to 1, and similarly, scaleX(0.95f) means that the scaling ratio in the X direction is adjusted to 0.95, and scaleY(0.95f) means that the scaling ratio in the Y direction is adjusted to 0.95. workSpace and hotSeat represent the desktop part (or desktop area), which can be understood as view, workSpace can include icons loaded by default by the system, manually dragged in by the user, and automatically generated by the application, and hotSeat can include the shortcut bar.
[0268] S208: SurfaceFlinger synthesizes the adjusted desktop layer and the application layer in the N2th image frame of the drawn return animation to obtain a transition image frame.
[0269] After SurfaceFlinger completes the drawing of the desktop layer and the desktop application adjusts the size of the content in the drawn desktop layer, SurfaceFlinger can synthesize the adjusted desktop layer and the application layer in the N2th image frame of the drawn return animation to obtain a synthesized image frame. For the sake of understanding and description, the present application records this image frame as a transition image frame.
[0270] It can be understood that the application layer in the N2th image frame of the drawn return animation can be the application layer drawn by SurfaceFlinger before the electronic device displays the N2th image frame of the return animation, or can be the application layer redrawn based on the drawing parameters corresponding to the application layer in the N2th image frame of the return animation after SurfaceFlinger receives the drawing parameters.
[0271] To more intuitively show the difference between the N2th image frame of the return animation and the transition image frame, the following is exemplarily described in conjunction with FIGS. 9A and 9B.
[0272] FIG. 9A shows the desktop layer in the N2th image frame of the return animation and the desktop layer in the transition image frame. The dashed box shown in FIG. 9A represents the desktop layer (which can be understood as a transparent layer), the size of the dashed box represents the size of the desktop layer, i.e., the size of the desktop layer itself (excluding the content in the desktop layer), and the small square box shown in FIG. 9A represents the content (for example, application icons or components other than the first application icon) in the desktop layer.
[0273] As shown in FIG. 9A, the size of the desktop layer in the transition image frame is equal to the size of the desktop layer in the Zth image frame of the return animation, and the size of the desktop layer in the transition image frame is greater than the size of the desktop layer in the N2th image frame of the return animation. It should be noted that the dashed box is invisible to the user, i.e., the size of the desktop layer itself mentioned above is invisible to the user.
[0274] As shown in FIG. 9A, the content included in the desktop layer in the transition image frame is consistent with the content included in the desktop layer in the N2th image frame of the return animation, and the sizes of the two are also consistent. It is worth noting that the content included in the desktop layer is visible to the user, which means that the content of the desktop layer visible to the user in the transition image frame and the N2th image frame of the return animation is exactly the same.
[0275] As shown in FIG. 9A, the application layer in the transition image frame is completely consistent with the application layer in the N2th image frame of the return animation.
[0276] As shown in FIG. 4A, after the user interrupts the animation (i.e., the start animation) played by the electronic device during the process of starting the camera application, the user triggers the electronic device to return to the desktop and interrupts the animation (i.e., the return animation) played by the electronic device during the process of returning to the desktop. As shown in FIG. 4A, the image frame of the last frame of the return animation displayed by the electronic device before the return animation is interrupted is the interrupted return animation image frame 1c. As shown in FIG. 9B, the size of the desktop layer in the transition image frame is equal to the size of the desktop layer in the Zth image frame of the return animation, and the size of the desktop layer in the transition image frame is greater than the size of the desktop layer in the N2th image frame of the return animation. In addition, the size and position of the other application icons (icons other than the camera application icon 101) in the transition image frame are completely consistent with the size and position of the other application icons in the interrupted return animation image frame 1c. It can be understood that the other application icons are the content in the desktop layer, which is the content visible to the user. The size, position, and content of the camera application window 102 in the transition image frame are completely consistent with those of the interrupted return animation image frame 1c.
[0277] S209: SurfaceFlinger sends the transition image frame to the display driver.
[0278] After SurfaceFlinger draws the synthesized transition image frame, SurfaceFlinger can send the transition image frame to the display driver. Correspondingly, the display driver can receive the transition image frame sent by SurfaceFlinger.
[0279] S210: The display driver controls the display screen to display the transition image frame.
[0280] After the display driver receives the transition image frame sent by SurfaceFlinger, the display driver can control the display screen to display the transition image frame.
[0281] S211: The desktop application sets the animation flag bit to false.
[0282] After the desktop application calculates the drawing parameters corresponding to the application layer in the N2th image frame of the return animation and the drawing parameters corresponding to the desktop layer in the N2th image frame of the return animation, the desktop application can set the animation flag bit to false, indicating that the electronic device draws the current animation in the first animation drawing manner. It can be understood that the current animation referred to here refers to the second start animation.
[0283] It can be understood that the desktop application can execute step S211 after executing step S204, can execute step S211 after executing step S205, can execute step S211 after executing step S207, can execute step S211 after SurfaceFlinger executes step S206, can execute step S211 after SurfaceFlinger executes step S208, and can execute step S211 after the display executes step S210, and the present application does not make a specific limitation in this regard.
[0284] S212: The desktop application draws the second startup animation in the first animation drawing mode based on the drawing parameters corresponding to the application layer in the N2th image frame of the return animation.
[0285] The desktop application can determine the drawing parameters corresponding to the image frames of the second startup animation based on the drawing parameters corresponding to the application layer in the N2th image frame of the return animation, and construct the second startup animation in the first animation drawing mode based on the drawing parameters corresponding to the second startup animation. The specific implementation of constructing the animation in the first animation drawing mode can be referred to the foregoing description, and the present application will not make a further description herein.
[0286] In some embodiments of the present application, the desktop application can determine the drawing parameters (for example, the scaling ratio mentioned above) corresponding to the image frames of the second startup animation based on the drawing parameters corresponding to the application layer in the N2th image frame of the return animation and the drawing parameters corresponding to the first image frame of the return animation.
[0287] S118: In response to the operation of the user sliding from the bottom of the screen to the top, the input module sends a fourth input event to the desktop application.
[0288] After the desktop application stops drawing the return animation, the user can slide from the bottom of the screen to the top to trigger the electronic device to return to the desktop, and accordingly, the input module can obtain a fourth input event and send the fourth input event to the desktop application. After receiving the fourth input event sent by the input module, the desktop application can execute steps S105-S117.
[0289] In some embodiments of the present application, the input module can send a fourth input event to the desktop application during the process of the desktop application drawing the second startup animation. In this case, the fourth input event can be understood as an input event interrupting the second startup animation, which is listened to by the listener set by the desktop application for the second startup animation. In some other embodiments of the present application, the input module can send a fourth input event to the desktop application after the second startup animation ends (or completes playing).
[0290] The above animation display method will be further described below in combination with different animation display scenarios.
[0291] 1. An animation display scene that breaks an animation twice
[0292] For example, in response to the user's operation of clicking the first application icon, the electronic device can start the first application, and draw the first start-up animation in the second dynamic effect drawing mode if the dynamic effect flag is true (e.g., steps S101-S103). As shown in (1) of FIG. 10A, the electronic device can play the first start-up animation drawn in the second dynamic effect drawing mode during the process of starting the first application. As shown in (1) of FIG. 10A, during the process of playing the first start-up animation, the user can swipe up from the bottom of the screen to trigger the electronic device to return to the desktop (e.g., step S104), thereby interrupting the playing of the first start-up animation (e.g., the first interruption shown in FIG. 10A). In response to the operation of swiping up, the electronic device can determine that the first start-up animation exists and has not ended. In this case, the electronic device ends the first start-up animation first (e.g., steps S105-S107). As shown in (1) of FIG. 10A, the electronic device stops drawing the first start-up animation, that is, the electronic device does not perform the related drawing operation of the next image frame of the first start-up animation after displaying the interrupted image frame of the first start-up animation (e.g., the M1th image frame of the first start-up animation shown in FIG. 10A). After the electronic device stops drawing the first start-up animation, the electronic device can determine that the target interface is the desktop interface (e.g., step S108), and determine that the second start-up animation does not exist (e.g., step S109). Further, based on the fact that the desktop application currently does not draw an animation, the electronic device can determine that the dynamic effect flag is true (e.g., step S112). In this case, as shown in (1) of FIG. 10A, the electronic device can draw the return animation in the second dynamic effect drawing mode (e.g., step S116). As shown in (1) of FIG. 10A, during the process of playing the return animation, the user can click the first application window or the first application icon, thereby interrupting the playing of the return animation (e.g., the second interruption shown in FIG. 10A). In response to the operation of clicking, the electronic device can stop drawing the return animation, draw a transition image frame, and draw the second start-up animation in the first dynamic effect drawing mode (e.g., steps S114 and S117). Specifically, as shown in (1) and (2) of FIG. 10A, before stopping playing the return animation, the last image frame displayed by the electronic device is the N2th image frame of the return animation. As shown in (2) of FIG. 10A, in response to the user's operation of clicking the first application window or the first application icon, the electronic device can calculate the corresponding drawing parameters to draw a layer corresponding to a transition image frame in which the visible content (e.g., the first application icon, other application icons or components, etc.) is completely consistent with the N2th image frame, and display the transition image frame on the display screen after compositing the layer, and then draw the second start-up animation in the first dynamic effect drawing mode. Since the transition image frame and the content in the N2th image frame of the return animation are consistent, the return animation and the second start-up animation are seamlessly connected, and there is no large change.
[0293] The following describes the above animation display scenario with the first application being the camera application and the first application icon being the camera application icon as an example:
[0294] For example, as shown in (1) of FIG. 10B, after the user interrupts the animation (i.e., the first startup animation) played by the electronic device in the process of starting the camera application, the user triggers the electronic device to return to the desktop and interrupts the animation (i.e., the return animation) played by the electronic device in the process of returning to the desktop. As shown in (1) and (2) of FIG. 10B, the image frame of the last frame of the return animation displayed by the electronic device before stopping playing the return animation is the interrupted return animation image frame 1c. The electronic device can calculate corresponding rendering parameters to render a frame of transition image frame that is completely consistent with the interrupted return animation image frame 1c. As shown in (2) of FIG. 10B, the camera application window 102 in the transition image frame and the content included in the camera application window 102 in the interrupted return animation image frame 1c are completely consistent. The electronic device can subsequently render the second startup animation in the first dynamic effect rendering manner. Since the electronic device displays the transition image frame between playing the return animation rendered in the second dynamic effect rendering manner and the startup animation rendered in the first dynamic effect rendering manner, and the content in the transition image frame is consistent with the content in the N2th image frame of the return animation, the return animation and the second startup animation are seamlessly connected and do not have the phenomenon of flashing or black flashing.
[0295] 2. Animation display scenario of interrupting animation multiple times
[0296] In an example, similar to the animation display scenario of the above two interruption animations, in response to the operation of the user clicking the first application icon, the electronic device can start the first application, and in the case that the animation effect flag is true, draw the first start-up animation in the second animation effect drawing mode (such as steps S101-S103), as shown in (1) of FIG. 11A, the electronic device can play the first start-up animation drawn in the second animation effect drawing mode during the process of starting the first application. As shown in (1) of FIG. 11A, during the process of playing the first start-up animation, the user can swipe up from the bottom of the screen to trigger the electronic device to return to the desktop (such as step S104), thereby interrupting the playing of the first start-up animation (such as the first interruption shown in FIG. 11A), in response to the operation of swiping up, the electronic device can determine that the first start-up animation exists and the first start-up animation has not ended, in this case, the electronic device ends the first start-up animation first (such as steps S105-S107), as shown in (1) of FIG. 11A, the electronic device stops drawing the first start-up animation, that is, after the electronic device displays the interrupted image frame of the first start-up animation (such as the M1th image frame of the first start-up animation shown in FIG. 11A), the electronic device no longer performs the related drawing operation of the next image frame of the first start-up animation. After the electronic device stops drawing the first start-up animation, the electronic device can determine that the target interface is the desktop interface (such as step S108), and determine that the second start-up animation does not exist (such as step S109), further, based on the fact that the desktop application currently has no drawing animation, the electronic device can determine that the animation effect flag is true (such as step S112), in this case, as shown in (1) of FIG. 11A, the electronic device can draw the return animation in the second animation effect drawing mode (such as step S116). As shown in (1) of FIG. 11A, during the process of playing the return animation, the user can click the first application window or the first application icon, thereby interrupting the playing of the return animation (such as the second interruption shown in FIG. 11A), in response to the clicking operation, the electronic device can stop drawing the return animation, draw a transition image frame, and draw the second start-up animation in the first animation effect drawing mode (such as steps S114 and S117). It can be understood that the electronic device sets the animation effect flag to false during the process of drawing the second start-up animation in the first animation effect drawing mode. Specifically, the related description of the transition image frame shown in FIG. 11A can refer to the related description of the transition image frame involved in FIG. 10A, which will not be repeated here.
[0297] Different from the two animation display scenarios described above, as shown in (2) of FIG. 11A, during playing of the second startup animation, the user can swipe up from the bottom of the screen to trigger the electronic device to return to the desktop (as step S118), thereby interrupting playing of the second startup animation (the third interruption as shown in FIG. 11A), in response to the up swipe operation, the electronic device can determine that the first startup animation does not exist and that the target interface is the desktop interface (as steps S105 and S108), and then determine that the second startup animation exists and has not ended, in this case, the electronic device ends the second startup animation first (as steps S109-S111), as shown in (2) of FIG. 11A, the electronic device stops drawing the second startup animation, that is, after the electronic device displays the second startup animation interrupted image frame (the M1th image frame of the second startup animation as shown in FIG. 11A), the electronic device no longer performs the related drawing operation of the next image frame of the second startup animation. After the electronic device stops drawing the second startup animation, because the second startup animation is drawn by the desktop application, it can be determined that the animation effect flag is false (as step S112), in this case, as shown in (2) of FIG. 11A, the electronic device can draw the return animation in the first animation effect drawing manner (as step S113).
[0298] The following specifically takes the first application as the camera application and the first application icon as the camera application icon as an example to describe the above animation display scenarios:
[0299] For example, as shown in (1) of FIG. 11B, after the user interrupts the animation played by the electronic device during startup of the camera application (i.e., the first startup animation drawn in the second animation effect drawing manner), the user triggers the electronic device to return to the desktop and interrupts the animation played by the electronic device during return to the desktop (i.e., the return animation drawn in the second animation effect drawing manner), that is, the first interruption and the second interruption as shown in (1) of FIG. 11B. As shown in (1) and (2) of FIG. 11B, the electronic device can stop playing the return animation and draw a frame of transition image frame (the contents of the camera application window 102 in the transition image frame and the camera application window 102 in the return animation interrupted image frame 1c are completely identical), and then draw the second startup animation in the first animation effect drawing manner to achieve smooth transition of the return animation and the second startup animation. During playing of the second startup animation by the electronic device, the user can swipe up from the bottom of the screen to trigger the electronic device to return to the desktop, thereby interrupting playing of the second startup animation (the third interruption as shown in FIG. 11B), in response to the up swipe operation, the electronic device can stop drawing the second startup animation and draw the return animation in the first animation effect drawing manner.
[0300] Based on the animation display method provided in the embodiments of the present application, in the case that the user interrupts the start animation and the return animation for multiple times, the electronic device can respond in time and select a corresponding animation effect drawing mode to draw the animation, so as to realize smooth transition of the start animation and the return animation, thereby avoiding the phenomenon of flashing screen or flashing black.
[0301] The above merely provides a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An animation display method characterized by comprising: The method is applied to an electronic device, and the method comprises: displaying a first interface, the first interface being an interface of a desktop application, the first interface comprising a first application icon; in response to a first operation on the first application icon, displaying a first animation; the first application icon being an application icon corresponding to a first application, and the first animation comprising an animation of starting the first application; in a process of displaying the first animation, in response to a second operation of returning to the desktop, stopping displaying the first animation and displaying a second animation; the second animation comprising an animation of returning to the first interface; in a process of displaying the second animation, in response to a third operation on a first image frame in the second animation, stopping displaying the second animation and displaying a third animation; wherein the first animation is drawn by a SurfaceFlinger of the electronic device, the second animation is drawn by the desktop application of the electronic device, and the third animation is drawn by the desktop application of the electronic device.
2. The method of claim 1, wherein, After the third animation is displayed, the method further comprises: in a process of displaying the third animation, in response to a fourth operation of returning to the desktop, displaying a fourth animation; the fourth animation comprising an animation of returning to the first interface, and the fourth animation being drawn by the desktop application of the electronic device.
3. The method of claim 1, wherein, After the third animation is displayed, the method further comprises: after the third animation is displayed, displaying an interface of the first application; in response to a fourth operation of returning to the desktop, displaying a fourth animation; the fourth animation comprising an animation of returning to the first interface, and the fourth animation being drawn by the SurfaceFlinger of the electronic device.
4. The method of any one of claims 1-3, wherein, Before the first animation is displayed, the method further comprises: in response to the first operation, drawing the first animation by the SurfaceFlinger for first content based on an animation effect flag bit; the stopping displaying the first animation in response to the second operation of returning to the desktop comprises: in response to the second operation, stopping drawing the first animation based on the first animation not having ended playing; after the first animation is stopped displaying, the method further comprises: drawing the second animation by the SurfaceFlinger based on the target interface being the first interface, the third animation not being currently drawn, and the animation effect flag bit being the first content; after the second animation is drawn by the SurfaceFlinger, the method further comprises: in response to the third operation, setting the animation effect flag bit to second content.
5. The method of any one of claims 1-4, wherein, the stopping displaying the second animation and displaying a third animation comprises: stopping displaying the second animation and displaying a second image frame; the content of the second image frame being the same as the content of the first image frame; after the second image frame is displayed, the third animation is displayed. 6. The method of claim 5, wherein, The first image frame is synthesized based on a first layer, a second layer and a third layer; the first layer includes the first application icon, the second layer includes other application icons or components except the first application icon, and the third layer is a window layer of the first application; The stopping of displaying the second animation comprises: Destroying the first layer; Notifying the SurfaceFlinger to stop drawing the second animation; Before the displaying of the second image frame, the method further comprises: Determining a first drawing parameter according to a played time length of the second animation; the first drawing parameter is a drawing parameter corresponding to the second layer; Drawing a fourth layer based on a second drawing parameter by the SurfaceFlinger, and adjusting content in the fourth layer based on the first drawing parameter by the desktop application to obtain a drawn fourth layer; the second drawing parameter is a drawing parameter corresponding to a last image frame of the second animation; Synthesizing the second image frame based on the drawn fourth layer and the drawn third layer by the SurfaceFlinger.
7. The method of claim 5 or 6, wherein, Before the displaying of the third animation, the method further comprises: Determining a third drawing parameter according to a played time length of the second animation; the third drawing parameter is a drawing parameter corresponding to the third layer; Determining a drawing parameter corresponding to each image frame in the third animation based on the third drawing parameter, and drawing the third animation based on the drawing parameter corresponding to each image frame in the third animation.
8. The method of claim 2, wherein, The displaying of the fourth animation in response to the fourth operation of returning to the desktop comprises: In response to the fourth operation, stopping drawing the third animation based on the stopping of displaying the first animation, the target interface being the first interface, and the third animation not having ended playing; Drawing the fourth animation by the desktop application based on the second content of the animation effect flag.
9. The method of claim 3, wherein, The displaying of the fourth animation in response to the fourth operation of returning to the desktop comprises: In response to the fourth operation, drawing the fourth animation by the SurfaceFlinger based on the stopping of displaying the first animation, the target interface being the first interface, the third animation having ended playing, and the animation effect flag being the first content.
10. An electronic device, comprising: The electronic device comprises one or more memories and one or more processors; the one or more memories are coupled with the one or more processors, the memories are used to store computer program codes, the computer program codes comprise computer instructions, and the processors invoke the computer instructions to execute the method in any one of claims 1-9.
11. A computer readable storage medium, characterized in that, A computer program product for storing computer instructions, when the computer instructions are run on an electronic device, causes the electronic device to execute the method in any one of claims 1-9. A computer program product for storing computer instructions, when the computer instructions are run on an electronic device, causes the electronic device to execute the method in any one of claims 1-9.