A method and device for application motion effect connection

CN115390957BActive Publication Date: 2026-09-08HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110616128.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-05-25
Filing Date
2021-06-02
Publication Date
2026-09-08
Estimated Expiration
2041-06-02

AI Technical Summary

Technical Problem

实现了第一应用程序的启动动效和退出动效在切换过程中,都是根据第一animation leash对象做的动效,因此启动动效和退出动效是同一段动效,不会出现启动动效和退出动效由于是两段动效,切换时过渡不自然的问题

Benefits of technology

[0025] In conjunction with the second aspect, in one possible implementation, before the electronic device displays the first image frame from the first animation in the first window drawn by the first animation Leash object, the one or more processors call the computer instructions to cause the electronic device to execute: create a new animation processing thread in the surfaceflinger; and determine the second parameter information of the second image frame based on the first parameter information of the first image frame through the animation processing thread. In this way, by creating a new animation processing thread on the surfaceflinger side, the electronic device can handle the animation calculation tasks of all applications in the electronic device within the animation processing thread area on the surfaceflinger side. On the one hand, this allows for centralized scheduling of the animation calculation tasks of all applications in the electronic device; on the other hand, it solves the problem of some image frames being discarded due to untimely scheduling when animation calculations are performed in the UI thread, resulting in stuttering during animation playback, thus making the animation playback smoother.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115390957B_ABST
    Figure CN115390957B_ABST
Patent Text Reader

Abstract

The application provides a method and device for application animation connection. The method realizes that an electronic device performs a starting animation and an exiting animation of a first application through a same animation leash object. The starting animation and the exiting animation can be understood as a same animation. When the electronic device pauses playing the starting animation and starts playing the exiting animation, the problem of unnatural transition when the starting animation and the exiting animation are switched does not occur.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a method and apparatus for application animation connection. Background Technology

[0002] With the continuous development of information technology, electronic devices have become indispensable tools in people's lives. For example, users... Various applications (APPs) can be installed on electronic devices. Different APPs can provide users with different service functions.

[0003] Currently, to provide a better user experience during application startup or exit phases, electronic devices play an animation during these phases. However, if the device receives a user's exit command while the startup animation of the first application is playing, it will stop playing the startup animation, create a new exit animation, and begin playing it. But because the startup and exit animations are two separate animations, the transition between them is abrupt and provides a poor user experience. Therefore, solving the problem of a smooth transition between startup and exit animations is urgently needed. Summary of the Invention

[0004] This application provides a method and apparatus for seamless application animation transitions. It ensures that the startup and exit animations of the first application are both based on a first animation leash object during the switching process. Therefore, the startup and exit animations are the same animation segment, avoiding the problem of unnatural transitions when switching between two separate animations.

[0005] In a first aspect, this application provides a method for seamlessly connecting animation effects in an application. The method includes: an electronic device receiving a first operation from a user, the first operation being used to initiate the playback of a first animation effect of a first application; according to the first operation, the electronic device displaying a first image frame from the first animation effect in a first window drawn by a first animation Leash object; the electronic device receiving a second operation from the user, the second operation being used to instruct the electronic device to play a second animation effect of the first application; according to the second operation, the electronic device displaying a second image frame from the second animation effect in a second window drawn by the first animation Leash object.

[0006] The method provided in the first aspect ensures that the startup and exit animations of the first application are based on the first animation leash object during the switching process. Therefore, the startup and exit animations are the same animation, and there will be no problem of unnatural transition when switching between the startup and exit animations, which are two separate animations.

[0007] In conjunction with the first aspect, in one possible implementation, before the electronic device displays the first image frame in the first animation effect in a first window drawn by the first animation Leash object, the method further includes: the electronic device synthesizing the first image frame based on first parameter information of the first image frame in the first animation effect; before the electronic device displays the second image frame in the second animation effect in a second window drawn by the first animation Leash object, the method further includes: the electronic device synthesizing the second image frame based on second parameter information of the second image frame in the second animation effect.

[0008] In conjunction with the first aspect, in one possible implementation, the electronic device receives a second operation from the user, including: The electronic device receives the second operation while displaying the first image frame. That is, the electronic device receives the user's second operation during the playback of the startup animation. Here, the first image frame can be the last image frame in the startup animation, or any image frame preceding the last image frame in the startup animation.

[0009] In conjunction with the first aspect, in one possible implementation, before the electronic device receives the second operation, the method further includes: after the electronic device finishes playing the first animation, displaying a first user interface of the first application. The electronic device may receive a second operation from the user to exit the first application after the startup animation has finished playing.

[0010] In conjunction with the first aspect, in one possible implementation, the second image frame is the first image frame in the second animation effect; before the electronic device displays the second image frame in the second animation effect in the second window drawn by the first animationLeash object, the method further includes: the electronic device determining the second parameter information and the attribute information of the second window based on the first parameter information; the electronic device drawing the second window using the first animationLeash object based on the attribute information of the second window. The electronic device needs to change the window attributes drawn by the first animationLeash object according to the parameter information of each image frame in the start or exit animation effect, so that the window drawn by the first animationLeash object can display each image frame in the start or exit animation effect.

[0011] In conjunction with the first aspect, in one possible implementation, the electronic device determines the second parameter information based on the first parameter information, including: the electronic device interpolates the second parameter information based on the first parameter information. That is, SurfaceFlinger calculates the parameter information of the next image frame according to the initial parameter information of the currently displayed image frame during the start or exit of the animation effect using an interpolation algorithm. In this way, when the electronic device uses the parameter information of the image frames obtained by the interpolation algorithm to synthesize the image frames and plays the animation effect, the animation effect displayed by the electronic device will be smoother.

[0012] The interpolation algorithm can obtain the parameter information of the next image frame based on the parameter information of the current image frame in the animation using the following formula: Formula (1) a=k*x / m Formula (2) V = v + a*t Formula (3) P=p+V*t As shown in formulas (1), (2), and (3), the interpolation algorithm can obtain the target parameter information based on the preset parameter information of the image frame using formulas (1), (2), and (3). In formulas (1), (2), and (3), a represents acceleration, k represents rigidity, and according to Hooke's theorem for springs, k = -F / x, where x represents the length of the spring deformation, and F represents the force received when the spring deforms to a length of x. According to Newton's law of motion, F can be expressed as F = m * a, where m is the force of the object. Based on formulas k = -F / x and F = m * a, the acceleration a = -k * x / m can be obtained.

[0013] v represents the initial velocity of the object, V represents the velocity of the object at the next moment, P represents the initial position of the object, p represents the position of the object at the next moment, and t represents the parameter information of which frame of the image in the start or end animation is being calculated by the electronic device 100. It should be noted that when the electronic device 100 is calculating the parameter information of the image frame in the start animation, v in formula (3) is a positive number; when the electronic device 100 is calculating the parameter information of the image frame in the end animation, v in formula (3) is a negative number.

[0014] In conjunction with the first aspect, in one possible implementation, before the electronic device displays the first image frame of the first animation in the first window drawn by the first animation Leash object, the method further includes: the electronic device creating a new animation processing thread in the SurfaceFlinger; the electronic device determining the second parameter information based on the first parameter information, including: the electronic device determining the second parameter information of the second image frame through the animation processing thread according to the first parameter information of the first image frame. In this way, by creating a new animation processing thread on the SurfaceFlinger side, the electronic device can handle the animation calculation tasks of all applications in the electronic device within the animation processing thread area on the SurfaceFlinger side. On the one hand, this allows for centralized scheduling of the animation calculation tasks of all applications in the electronic device; on the other hand, it solves the problem of some image frames being discarded due to untimely scheduling when animation calculations are performed in the UI thread, resulting in stuttering during animation playback, thus making animation playback smoother.

[0015] In conjunction with the first aspect, in one possible implementation, the first parameter information includes any one or more of the following: the position of the center point of the first image frame, the window size of the first image frame, the transparency of the first image frame, and the rounded corner size of the first image frame. The second parameter information includes any one or more of the following: the position of the center point of the second image frame, the window size of the second image frame, the transparency of the second image frame, and the rounded corner size of the second image frame; The attribute information of the second window includes any one or more of the following: the position of the center point of the second window, the window size of the second window, the transparency of the second window, and the rounded corner size of the second window.

[0016] Secondly, this application provides an electronic device, comprising: one or more processors and one or more memories; the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform: receiving a first operation from a user, the first operation being used to start playing a first animation effect of a first application; displaying a first image frame of the first animation effect in a first window drawn by a first animation leash object according to the first operation; receiving a second operation from a user, the second operation being used to instruct the electronic device to play a second animation effect of the first application; and displaying a second image frame of the second animation effect in a second window drawn by the first animation leash object according to the second operation. Through the method provided in the first aspect, the startup animation effect and the exit animation effect of the first application are both based on the first animation leash object during the switching process. Therefore, the startup animation effect and the exit animation effect are the same animation, and the problem of unnatural transition when switching between the startup animation effect and the exit animation effect, which are two separate animation effects, is avoided.

[0017] In conjunction with the second aspect, in one possible implementation, before the electronic device displays the first image frame in the first animation effect in a first window drawn by the first animation Leash object, the one or more processors invoke the computer instructions to cause the electronic device to perform: synthesizing the first image frame based on first parameter information of the first image frame in the first animation effect; and synthesizing the second image frame based on second parameter information of the second image frame in the second animation effect.

[0018] In conjunction with the second aspect, in one possible implementation, the one or more processors invoke the computer instructions to cause the electronic device to perform: receiving the second operation while displaying the first image frame. That is, the electronic device receives the user's second operation during the playback of the startup animation. Here, the first image frame can be the last image frame in the startup animation, or any image frame preceding the last image frame in the startup animation.

[0019] In conjunction with the second aspect, in one possible implementation, before the electronic device receives the second operation, the one or more processors invoke the computer instructions to cause the electronic device to execute: displaying a first user interface of the first application after the first animation effect has finished playing. The electronic device may receive a second operation from the user to exit the first application after the startup animation effect has finished playing.

[0020] In conjunction with the second aspect, in one possible implementation, the second image frame is the first image frame in the second animation effect. Before the electronic device displays the second image frame in the second animation effect in the second window drawn by the first animationLeash object, the one or more processors call the computer instructions to cause the electronic device to perform: determining the second parameter information and the attribute information of the second window based on the first parameter information; and drawing the second window using the first animationLeash object based on the attribute information of the second window. The electronic device needs to change the window attributes drawn by the first animationLeash object according to the parameter information of each image frame in the start or exit animation effect, so that the window drawn by the first animationLeash object can display each image frame in the start or exit animation effect.

[0021] In conjunction with the second aspect, in one possible implementation, the one or more processors invoke the computer instructions to cause the electronic device to perform: interpolation calculation of the second parameter information based on the first parameter information.

[0022] In other words, SurfaceFlinger uses an interpolation algorithm to calculate the parameter information of the next image frame based on the initial parameter information of the currently displayed image frame during the start or end of the animation. This results in a smoother animation effect when the electronic device uses the interpolated image frame to synthesize the animation.

[0023] The interpolation algorithm can obtain the parameter information of the next image frame based on the parameter information of the current image frame in the animation using the following formula: Formula (1) a=k*x / m Formula (2) V = v + a*t Formula (3) P=p+V*t As shown in formulas (1), (2), and (3), the interpolation algorithm can obtain the target parameter information based on the preset parameter information of the image frame using formulas (1), (2), and (3). In formulas (1), (2), and (3), a represents acceleration, k represents rigidity, and according to Hooke's theorem for springs, k = -F / x, where x represents the length of the spring deformation, and F represents the force received when the spring deforms to a length of x. According to Newton's law of motion, F can be expressed as F = m * a, where m is the force of the object. Based on formulas k = -F / x and F = m * a, the acceleration a = -k * x / m can be obtained.

[0024] v represents the initial velocity of the object, V represents the velocity of the object at the next moment, P represents the initial position of the object, p represents the position of the object at the next moment, and t represents the parameter information of which frame of the image in the start or end animation is being calculated by the electronic device 100. It should be noted that when the electronic device 100 is calculating the parameter information of the image frame in the start animation, v in formula (3) is a positive number; when the electronic device 100 is calculating the parameter information of the image frame in the end animation, v in formula (3) is a negative number.

[0025] In conjunction with the second aspect, in one possible implementation, before the electronic device displays the first image frame from the first animation in the first window drawn by the first animation Leash object, the one or more processors call the computer instructions to cause the electronic device to execute: create a new animation processing thread in the surfaceflinger; and determine the second parameter information of the second image frame based on the first parameter information of the first image frame through the animation processing thread. In this way, by creating a new animation processing thread on the surfaceflinger side, the electronic device can handle the animation calculation tasks of all applications in the electronic device within the animation processing thread area on the surfaceflinger side. On the one hand, this allows for centralized scheduling of the animation calculation tasks of all applications in the electronic device; on the other hand, it solves the problem of some image frames being discarded due to untimely scheduling when animation calculations are performed in the UI thread, resulting in stuttering during animation playback, thus making the animation playback smoother.

[0026] In conjunction with the second aspect, in one possible implementation, the first parameter information includes any one or more of the following: the position of the center point of the first image frame, the window size of the first image frame, the transparency of the first image frame, and the rounded corner size of the first image frame; the second parameter information includes any one or more of the following: the position of the center point of the second image frame, the window size of the second image frame, the transparency of the second image frame, and the rounded corner size of the second image frame; the attribute information of the second window includes any one or more of the following: the position of the center point of the second window, the window size of the second window, the transparency of the second window, and the rounded corner size of the second window.

[0027] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform a motion effect calculation method provided in any possible implementation of any of the above aspects.

[0028] Fourthly, this application provides a computer program product containing instructions that, when the computer program product is run on an electronic device, causes the electronic device to execute a motion effect calculation method provided in any possible implementation of any of the above aspects. Attached Figure Description

[0029] Figure 1A - Figure 1 M is a set of UI diagrams for startup animation provided in the embodiments of this application; Figure 2A - Figure 2 M is another set of UI diagrams for startup animation provided in the embodiments of this application; Figures 3A-3E Another set of UI diagrams for startup animations provided in this application embodiment; Figures 4A-4B A schematic diagram of the motion trajectory of the center point of an image frame in a set of animations provided in this application embodiment; Figure 5 A schematic diagram illustrating the start-up and exit animation effects of an electronic device 100 provided in this application embodiment; Figure 5A This application provides a schematic diagram of a multi-linear operation for layer compositing; Figure 6 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application; Figure 7 A software structure block diagram of an electronic device 100 provided in this application embodiment; Figures 8A-8H An exemplary UI diagram is shown, corresponding to an application scenario where the operation to exit the first application is a swipe operation that is perpendicular to the bottom edge of the screen of the electronic device 100 and moves upwards onto the screen. Figures 9A-9F The example shows a UI diagram of an application scenario where the operation to exit the first application is a swipe operation from the bottom edge of the screen of the electronic device 100 to the upper right. Figures 10A-10F The example shows a UI diagram of an application scenario where the operation to exit the first application is a swipe operation from the bottom edge of the screen of the electronic device 100 to the upper left. Figure 11 Examples of the effects of several interpolation algorithms on the motion curves are shown. Figure 12 A schematic diagram illustrating the playback startup and exit animations of another electronic device 100 provided in this application embodiment; Figure 13 A flowchart illustrating a method for application animation transitions provided in this application embodiment. Detailed Implementation

[0030] The technical solutions in the embodiments of this application will now be described clearly and in detail with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the "or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0031] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0032] The term "user interface (UI)" used in the specification, claims, and drawings of this application refers to the medium through which an application or operating system interacts and exchanges information with the user. It converts information between its internal form and a form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java or Extensible Markup Language (XML). This source code is parsed and rendered on the terminal device, ultimately presenting user-recognizable content such as images, text, and buttons. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, input boxes, buttons, scroll bars, images, and text. The attributes and content of controls in the interface are defined through tags or nodes, such as XML tags. <textview> 、 <imgview> 、 <videoview>Nodes define the controls contained in the interface. A node corresponds to a control or property in the interface, and after parsing and rendering, the node is presented as the content visible to the user. In addition, many applications, such as hybrid applications, often contain web pages within their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. Web pages are source code written in a specific computer language, such as Hypertext Markup Language (HTML), Cascading Style Sheets (CSS), JavaScript (JS), etc. Web page source code can be loaded and displayed as user-readable content by a browser or a web page display component with browser-like functionality. The specific content contained in a web page is also defined through tags or nodes in the web page source code; for example, HTML uses tags or nodes to define the content. 、 、 <video> 、 <canvas>Used to define the elements and attributes of a webpage.

[0033] The most common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be a window, control, or other interface elements displayed on the screen of an electronic device.

[0034] First, the technical terms involved in the embodiments of this application will be explained.

[0035] 1. Animation Motion effects refer to the M-frame image frames changing position, size, and display format in a predetermined order, making the user experience of the electronic device's user interface richer.

[0036] The animation effects involved in this application embodiment include startup animation effects and exit animation effects. The period from when the application receives a user-triggered application startup operation until the electronic device 100 displays the application's main interface is called the application startup phase, and the time spent in this phase is called the startup time. Since the electronic device 100 needs to initialize and preload the application during the startup phase, the startup time is relatively long. To provide a better user experience, the electronic device 100 plays a startup animation effect during this phase. This startup animation effect can consist of N image frames displayed in a predetermined order, with a preset window size, preset display time, preset display position, preset transparency, and preset display elements, floating on the user interface of the electronic device 100. The period from when the electronic device 100 receives a user's exit operation after the application starts until the electronic device 100 displays the main interface is called the application exit phase, and the time spent in this phase is called the exit time. Because the application exit time is relatively long, in order to provide a better user experience, the electronic device 100 will play an exit animation during the application exit phase. The exit effect can be N image frames that are floated on the user interface of the electronic device 100 in a predetermined order according to a preset window size, preset display time, preset display position, preset transparency, and preset display elements.

[0037] It is understandable that the start and exit animations can be inverses of each other, or they can be two different animations; therefore, no restrictions are imposed here.

[0038] (1) Start-up animation Figure 1A -Figure 1 M, Figures 2A-2M , Figures 3A-3E Several UI example diagrams of startup animations are shown as examples.

[0039] like Figure 1A - Figure 1 M, in some embodiments, the size of each image frame gradually increases from a preset minimum size to a preset maximum size.

[0040] In one possible implementation, the center point of the image frame in the startup animation coincides with the center point of the display screen of the electronic device 100, and the size of each image frame can gradually increase proportionally from a preset minimum size to a preset maximum size over time.

[0041] like Figure 1A As shown, Figure 1A An exemplary diagram illustrates the size change of an image frame during a startup animation.

[0042] For example, at time t1, electronic device 100 receives and responds to the user's click on the application icon. The size of the application icon remains unchanged, and the original size of the application can be called the preset minimum size. Then, at time t2, the size of the application icon gradually increases. At time t3, the size of the application icon no longer increases, and electronic device 100 displays a rectangle with the same size as the rectangle shown at time t3. At time t4, the size of the rectangle increases from the size at time t3 to the size at time t4. At time t5, the size of the rectangle increases from the size at time t4 to the size at time t4. The size of the rectangle at time t5 is called the preset maximum size.

[0043] like Figure 1B As shown, in the startup animation, the size of the first image frame 1001 is the same as the size of the application icon, and the center point of the first image frame 1001 is at the same position as the center point of the application icon, i.e., both are at position 1002. The size of the first image frame 1001 is the minimum size (i.e., width is a, height is b). The first image frame 1001 can gradually increase from the preset minimum size to the preset maximum size of image frame 1003, where the preset maximum size is width A and length B.

[0044] like Figure 1C As shown, in the startup animation, the first image frame 1001 gradually increases in size from a preset minimum size to image frame 1004, and the center point of image frame 1004 is at the same position as the center point of the application icon, i.e., both are at position 1002. The dimensions of image frame 1004 are width c and height d. c is greater than a, and d is greater than b.

[0045] like Figure 1D As shown, in the startup animation, the size of image frame 1004 gradually increases to image frame 1005, and the center of image frame 1005 is no longer at the same position as the center point 1002 of the application icon, but at the same position as the center point of image frame 1003, i.e., both are at position 1006. The dimensions of image frame 1005 are width e and height f. f is greater than d.

[0046] like Figure 1E As shown, during the startup animation, the size of image frame 1005 gradually increases to image frame 1007, and the center of image frame 1007 is no longer at the same position as the center point 1002 of the application icon, but at the same position as the center point of image frame 1003, i.e., both are at position 1006. The dimensions of image frame 1007 are width g and height h. g is greater than e, and h is greater than f.

[0047] like Figure 1F As shown, during the startup animation, the size of image frame 1007 gradually increases to image frame 1008, and the center of image frame 1008 is no longer at the same position as the center point 1002 of the application icon, but at the same position as the center point of image frame 1003, i.e., both are at position 1006. The size of image frame 1007 is width i and height j. i is greater than g, j is greater than h. i equals A, j equals B.

[0048] When an application starts, the electronic device 100 can play a startup animation during the application's startup phase. The startup animation includes multiple image frames, each of which can have a different display position and size. The electronic device 100 displays the multiple image frames sequentially.

[0049] For example, such as Figure 1G As shown, Figure 1G An exemplary user interface 10 of an electronic device 100 is shown. The user interface 10 may include icons for several applications. For example, icons for file management 1009, email 1010, music 1011, fitness and health 1012, Huawei video 1013, weather 1014, camera 1015, contacts 1016, phone 1017, and messages 1018. In some embodiments, the user interface 10 may include more or fewer application icons. In some embodiments, the user interface 10 may include some icons related to… Figure 1G The icons shown are for different applications, and no specific application is specified here.

[0050] The electronic device 100 can receive and respond to user actions (such as clicking) on ​​the Huawei Video icon 1013 on the user interface 10, and the Huawei Video application will be launched.

[0051] like Figure 1H As shown, the image content of the first image frame 1001 is the same as the image content of the Huawei Video application icon. The size of the first image frame 1001 is the same as the size of the Huawei Video application icon, and the center point of the first image frame 1001 is at the same position as the center point of the Huawei Video application icon.

[0052] like Figure 1I As shown, the first image frame 1001 gradually increases in size from the preset minimum size to image frame 1004. The image content of image frame 1004 is the same as the image content of the Huawei Video application icon, and the center point of image frame 1004 is at the same position as the center point of the Huawei Video application icon.

[0053] like Figure 1J As shown, the size of image frame 1004 gradually increases to image frame 1005. The image content of image frame 1005 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Furthermore, the center of image frame 1005 is no longer at the same position as the center point 1002 of the Huawei video application icon, but rather at the same position as the center point of the display screen of electronic device 100.

[0054] like Figure 1K As shown, the size of image frame 1005 gradually increases to image frame 1007. The image content of image frame 1007 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Furthermore, the center of image frame 1007 is no longer at the same position as the center point 1002 of the Huawei video application icon, but rather at the same position as the center point of the display screen of electronic device 100.

[0055] like Figure 1L As shown, the size of image frame 1007 gradually increases to image frame 1008. The image content of image frame 1008 may not display any elements, or it may display one or more elements. This application does not impose any limitations on this. Figure 1L As shown, the image content of image frame 1008 includes the Huawei Video icon and the text "Huawei Video" and "See the World". Furthermore, the center of image frame 1008 is no longer at the same position as the center point 1002 of the Huawei Video application icon, but rather at the same position as the center point of the display screen of electronic device 100.

[0056] like Figure 1M As shown, after the startup animation of the electronic device 100 finishes playing, the electronic device 100 displays the main interface of the Huawei Video application. The main interface of the Huawei Video application includes one or more video images. The video images can be dynamic or static. In addition, the main interface may also display a bottom menu bar, a search box, sub-channel entries, etc., but this embodiment does not limit this.

[0057] like Figures 2A-2M In some embodiments, during the startup animation, the center point of the image frame changes in real time, the size of each image frame gradually increases from a preset minimum size to a preset maximum size, and any border of the image frame contacts the border of the image frame with the preset maximum size.

[0058] like Figure 2A As shown, Figure 2A This provides an example of a schematic diagram illustrating the size change of an image frame in another startup animation.

[0059] For example, at time t1, electronic device 100 receives and responds to the user's click on the application icon. The size of the application icon remains unchanged, and the original size of the application icon can be called the preset minimum size. Then, at time t2, the size of the application icon gradually increases. At time t3, the size of the application icon no longer increases, and electronic device 100 displays a rectangle, the size of which is the same as the size of the rectangle shown at time t3. At time t4, the size of the rectangle increases from the size at time t3 to the size at time t4, and one border of the rectangle at time t4 (e.g., the bottom border) coincides with the border of the rectangle at the preset maximum size (attempting to overlap with the bottom border). At time t5, the size of the rectangle increases from the size at time t4 to the size at time t5, and the other border of the rectangle at time t5 (e.g., the left border) coincides with the other border of the rectangle at the preset maximum size (e.g., the left border). At time t6, the size of the rectangle increases from the size at time t5 to the size at time t6, and the size of the rectangle at time t6 is called the preset maximum size.

[0060] like Figure 2B As shown, in the startup animation, the size of the first image frame 2004 is the same as the size of the application icon, and the center point of the first image frame 2004 is at the same position as the center point of the application icon, i.e., both are at position 2001. The center point of the first image frame 2004 does not coincide with the center point 2002 of the display screen of the electronic device 100. The size of the first image frame 2004 is the minimum size (i.e., width a, height b). The first image frame 2004 can gradually increase from the preset minimum size to the preset maximum size of image frame 2003, where the preset maximum size is width A and length B.

[0061] like Figure 2C As shown, in the startup animation, the first image frame 2004 gradually increases in size from a preset minimum size to image frame 2005, and the center point of image frame 2005 is at the same position as the center point of the application icon, i.e., both are at position 2001. The center point of image frame 2005 does not coincide with the center point 2002 of the display screen of electronic device 100. The dimensions of image frame 2005 are width c and height d. c is greater than a, and d is greater than b.

[0062] like Figure 2D As shown, during the startup animation, the size of image frame 2005 gradually increases to image frame 2006, and the center point 2007 of image frame 2006 is no longer in the same position as the center point 2001 of the application icon, nor is it in the same position as the center point 2002 of image frame 2003. The dimensions of image frame 2006 are width e and height f. f is greater than d.

[0063] like Figure 2E As shown, during the startup animation, the size of image frame 2006 gradually increases to image frame 2008. Any border of image frame 2008 (e.g., the bottom border) coincides with the border (e.g., the bottom border) of image frame 2003. Furthermore, the center point 2009 of image frame 2008 is no longer in the same position as the center point 2001 of the application icon, nor is it in the same position as the center point 2007 of image frame 2006, nor is it in the same position as the center point 2002 of image frame 2003. The dimensions of image frame 2008 are width g and height h. g is greater than e, and h is greater than f.

[0064] like Figure 2F As shown, during the startup animation, the size of image frame 2008 gradually increases to image frame 2010. Any border of image frame 2010 (e.g., the bottom border) coincides with the border of image frame 2003 (e.g., the bottom border). Simultaneously, any other border of image frame 2010 (e.g., the left border) coincides with another border of image frame 2003 (e.g., the left border). Furthermore, the center point 2011 of image frame 2010 is no longer in the same position as the center point 2001 of the application icon, nor is it in the same position as the center point 2007 of image frame 2006, nor as the center point 2009 of image frame 2008, nor as the center point 2002 of image frame 2003. The dimensions of image frame 2010 are width i and height j. i is greater than g, and j is greater than h.

[0065] like Figure 2G As shown, during the startup animation, the size of image frame 2010 gradually increases to image frame 2012, and all borders of image frame 2012 coincide with all borders of image frame 2003. Furthermore, the center point 2013 of image frame 2012 is not located at the same position as the center point 2001 of the application icon, nor at the same position as the center point 2007 of image frame 2006, nor at the same position as the center point 2009 of image frame 2008, nor at the same position as the center point 2011 of image frame 2010, but rather at the same position as the center point 2002 of image frame 2003. The dimensions of image frame 2012 are width k and height l. k is greater than i, l is greater than j. k equals A, j equals B.

[0066] When an application starts, the electronic device 100 can play a startup animation during the application's startup phase. The startup animation includes multiple image frames, each of which can have a different display position and size. The electronic device 100 displays the multiple image frames sequentially.

[0067] For example, such as Figure 1G As shown, Figure 1G An exemplary user interface 10 of an electronic device 100 is shown. The user interface 10 may include icons for several applications. For example, icons for file management 1009, email 1010, music 1011, fitness and health 1012, Huawei video 1013, weather 1014, camera 1015, contacts 1016, phone 1017, and messages 1018. In some embodiments, the user interface 10 may include more or fewer application icons. In some embodiments, the user interface 10 may include some icons related to… Figure 1G The icons shown are for different applications, and no specific application is specified here.

[0068] The electronic device 100 can receive and respond to user actions (such as clicking) on ​​the Huawei Video icon 1013 on the user interface 10, and the Huawei Video application will be launched.

[0069] like Figure 2H As shown, the image content of the first image frame 2004 is the same as the image content of the Huawei Video application icon. The size of the first image frame 2004 is the same as the size of the Huawei Video application icon, and the center point 2001 of the first image frame 2004 is at the same position as the center point of the Huawei Video application icon.

[0070] like Figure 2I As shown, the first image frame 2004 gradually increases in size from the preset minimum size to image frame 2005. The image content of image frame 2005 is the same as the image content of the Huawei video application icon, and the center point of image frame 2005 is in the same position as the center point 2001 of the Huawei video application icon, but not in the same position as the center point 2002 of the display screen of electronic device 100.

[0071] like Figure 2J As shown, the size of image frame 2005 gradually increases to image frame 2006. The image content of image frame 2006 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Furthermore, the center point 2007 of image frame 2006 is no longer in the same position as the center point 2001 of the Huawei video application icon, nor is it in the same position as the center point 2002 of the display screen of electronic device 100.

[0072] like Figure 2K As shown, the size of image frame 2006 gradually increases to image frame 2008. One border (e.g., the bottom border) of image frame 2008 coincides with the border (e.g., the bottom border) of the display screen of electronic device 100. The image content of image frame 2008 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Furthermore, the center point 2009 of image frame 2008 is no longer in the same position as the center point 2001 of the Huawei video application icon, nor is it in the same position as the center point 2007 of image frame 2006, nor is it in the same position as the center point 2002 of the display screen of electronic device 100.

[0073] like Figure 2L As shown, the size of image frame 2008 gradually increases to image frame 2010. The other border (e.g., the left border) of image frame 2010 coincides with the other border (e.g., the left border) of the display screen of electronic device 100. The image content of image frame 2008 may display no elements or display one or more elements; this application does not impose any limitations on this. Furthermore, the center point 2011 of image frame 2010 is no longer in the same position as the center point 2001 of the Huawei video application icon, nor is it in the same position as the center point 2007 of image frame 2006, nor is it in the same position as the center point 2009 of image frame 2008, and nor is it in the same position as the center point 2002 of the display screen of electronic device 100.

[0074] like Figure 2M As shown, the size of image frame 2010 gradually increases to image frame 2012. All borders of image frame 2012 coincide with all borders of the display screen of electronic device 100. The image content of image frame 2012 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Figure 2M As shown, the image content of image frame 2012 includes the Huawei Video icon and the text "Huawei Video" and "See the World". Furthermore, the center point 2013 of image frame 2012 is no longer in the same position as the center point 2001 of the Huawei Video application icon, nor is it in the same position as the center point 2007 of image frame 2006, nor is it in the same position as the center point 2009 of image frame 2008, nor is it in the same position as the center point 2011 of image frame 2010. Instead, it is in the same position as the center point 2002 of the display screen of electronic device 100.

[0075] like Figures 3A-3E In some embodiments, during the startup animation, the size of each image frame is fixed, and the center point of each image frame moves according to a preset trajectory. The shape of each image frame can be circular or rectangular; this application does not limit this.

[0076] Electronic device 100 receives and responds to the user's click on the application icon. The size of the application icon gradually increases. Once the application icon reaches a preset size, its size stops changing. An image frame is then displayed floating on the user interface of electronic device 100, and this image frame can move according to a preset trajectory. For a detailed UI diagram illustrating the application icon's changes, please refer to [link / reference]. Figure 1G-Figure 1I The embodiments described herein will not be repeated here. For a UI diagram showing image frames moving according to a preset trajectory, please refer to the following. Figures 3A-3E Examples of implementations.

[0077] For example, such as Figure 3A As shown, the center point 3001 of image frame 3004 can move left and right along a straight trajectory between positions 3002 and 3003. When the center point 3001 of image frame 3004 is at position 3002, the left border of image frame 3004 can coincide with the left border of the display screen of electronic device 100. When the center point 3001 of image frame 3004 is at position 3003, the right border of image frame 3004 can coincide with the right border of the display screen of electronic device 100. The image content of image frame 3004 may include one or more elements, or may not include any elements; this application does not impose any limitations on this.

[0078] For example, such as Figure 3B As shown, the center point 3001 of image frame 3004 can move up and down along a straight line between positions 3005 and 3006. When the center point 3001 of image frame 3004 is at position 3005, the upper border of image frame 3004 can coincide with the upper border of the display screen of electronic device 100. When the center point 3001 of image frame 3004 is at position 3006, the lower border of image frame 3004 can coincide with the lower border of the display screen of electronic device 100. The image content of image frame 3004 may include one or more elements, or may not include any elements; this application does not impose any limitations on this.

[0079] For example, such as Figure 3C As shown, the center point 3001 of image frame 3004 can move to the upper right and lower left along a straight trajectory between positions 3007 and 3008. When the center point 3001 of image frame 3004 is at position 3007, the upper border of image frame 3004 can coincide with the upper border of the display screen of electronic device 100, and the right border of image frame 3004 can coincide with the right border of the display screen of electronic device 100. When the center point 3001 of image frame 3004 is at position 3008, the lower border of image frame 3004 can coincide with the lower border of the display screen of electronic device 100, and the left border of image frame 3004 can coincide with the left border of the display screen of electronic device 100. The image content of image frame 3004 may include one or more elements, or may not include any elements; this application does not impose any limitations on this.

[0080] For example, such as Figure 3D As shown, the center point 3001 of image frame 3004 can move to the upper left and lower right along a straight trajectory between positions 3009 and 3010. When the center point 3001 of image frame 3004 is at position 3009, the upper border of image frame 3004 can coincide with the upper border of the display screen of electronic device 100, and the left border of image frame 3004 can coincide with the left border of the display screen of electronic device 100. When the center point 3001 of image frame 3004 is at position 3010, the lower border of image frame 3004 can coincide with the lower border of the display screen of electronic device 100, and the right border of image frame 3004 can coincide with the right border of the display screen of electronic device 100. The image content of image frame 3004 may include one or more elements, or may not include any elements; this application does not impose any limitations on this.

[0081] like Figure 3E As shown, the motion trajectory 961 of the center point 3001 of the image frame 3004 can be a heart shape, wherein the image frame 3004 can move clockwise or counterclockwise on the motion trajectory 3011.

[0082] It should be noted that the motion trajectory of the center point 3001 of the above image frame 3004 in the electronic device 100 is not limited to the above-mentioned pattern, but may also include other patterns, such as circles, horizontal "8" curves, Bezier curves, arc curves, etc. This application does not limit them here.

[0083] (2) Exit special effects After receiving the user's command to launch the application, the electronic device 100 then receives the user's command to exit the application. This process, from the time the electronic device 100 displays the main interface, is called the application exit phase, and the time spent in this phase is called the exit time. Because the application exit time is relatively long, to provide a better user experience, the electronic device 100 will play an exit animation during the application exit phase. This exit animation can consist of N image frames displayed in a predetermined order, with preset window size, preset display time, preset display position, preset transparency, and preset display elements, floating on the user interface of the electronic device 100.

[0084] In some embodiments, when the application has already displayed its main interface, the electronic device 100 receives a user's request to exit the application. At this time, in the exit animation, the size of each image frame gradually decreases from a preset maximum size to a preset minimum size. The preset maximum size can be the same as the size of the electronic device 100's display screen, and the preset minimum size can be the same as the size of the application's icon.

[0085] Specifically, in one possible implementation, the display order of image frames in the exit animation could be according to... Figure 1L , Figure 1K , Figure 1J , Figure 1I , Figure 1H The items are displayed in sequence.

[0086] In another possible approach, the exit animation could display image frames in the following order: Figure 2M , Figure 2L , Figure 2K , Figure 2J , Figure 2I , Figure 2H The items are displayed in sequence.

[0087] During the exit effect, image frames can also be displayed sequentially according to other rules, which are not limited in this application.

[0088] In other embodiments, when the application has been launched, before displaying the application's main interface, the electronic device 100 receives a user's request to exit the application. Assume the application's launch animation includes M image frames, and the exit animation also includes M image frames. When the launch animation plays to the Nth frame, where N is less than M, the electronic device 100 can implement the exit animation in the following two ways.

[0089] Method 1: When the startup animation plays to frame N, where N is less than M, the electronic device 100 receives the user's command to exit the application. The electronic device 100 then starts the exit animation and stops playing the image frames in the startup animation. The electronic device 100 then starts playing from frame M of the exit animation and continues playing until frame 1 of the exit animation.

[0090] It should be noted that the startup animation consists of M frames, and the playback order of the startup animation is: frame 1, frame 2, ..., frame N, ..., frame M.

[0091] The exit animation consists of M frames, and the playback order of the exit animation is: M-th frame, M-1-th frame, ..., N-th frame, ..., 1-th frame.

[0092] For example, if an application's startup animation includes 30 image frames, its exit animation also includes 30 image frames. After the application starts, the application's startup animation plays up to frame 8, and the image frames played by the electronic device 100 are from frame 1 to frame 8. Frames 1 to 8 can be... Figures 1H to 1K The UI diagram shown. It is understandable that... Figures 1H to 1K Some of the accompanying drawings have been omitted.

[0093] For example, such as Figure 4A As shown, Figure 4A An exemplary diagram illustrates the motion trajectory of the center point of each image frame as the startup animation plays from frame 1 to frame 8.

[0094] When the startup animation reaches frame 8, the electronic device 100 receives a user's request to exit the application. The electronic device 100 then initiates the exit animation, and begins playing from frame 8 of the exit animation until frame 1. The frame from frame 8 to frame 1 can be... Figures 1K to 1H The UI diagram shown. It is understandable that... Figures 1K to 1H Some of the accompanying drawings have been omitted.

[0095] It should be noted that the image information of each frame in the exit animation can be the same as or different from the image information of each frame in the startup animation. This application does not impose any restrictions on this. The image information is not limited to: the size of the image frame, the display elements of the image frame, the transparency of the image frame, the display time of the image frame, the rounded corner information of the image frame, etc.

[0096] like Figure 4A As shown, a rectangular coordinate system is established with the bottom edge of the page display area of ​​the electronic device 100 pointing to the right as the positive direction of the X-axis, the left edge of the page display area of ​​the electronic device 100 pointing upward as the positive direction of the Y-axis, and the intersection of the X-axis and the Y-axis as the origin.

[0097] First, the initial position is the center point of the first image frame in the startup animation. The center point of the first image frame is the initial position of the motion trajectory of the center point of each image frame in the startup animation. Then, the center point of each image frame in the startup animation moves sequentially in the direction of motion trajectory 4001. When the center point of the eighth image frame in the startup animation moves to the final position of the motion trajectory, the electronic device 100 receives the user's operation to exit the application, and the electronic device 100 executes the exit animation.

[0098] like Figure 4B As shown, the initial position is the center point of the 8th frame in the startup animation. The electronic device 100 will then start the exit animation and sequentially play the 8th to 1st frames in the exit animation. It can be understood that the center point of the 8th frame in the exit animation coincides with the center point of the 8th frame in the startup animation. The center point of the 8th frame in the exit animation is the initial position of the motion trajectory of the center point of each frame in the exit animation. Afterwards, the center point of each frame in the exit animation moves sequentially according to the direction of motion trajectory 4002. When the center point of the 1st frame in the startup animation reaches the final position of the motion trajectory, the electronic device 100 exits the application and displays the main interface.

[0099] It should be noted that motion trajectory 4001 and motion trajectory 4002 may be the same or different, and this application does not impose any restrictions on them.

[0100] Method 2: When the startup animation reaches frame N, where N is less than M, the electronic device 100 receives a user's request to exit the application. The electronic device 100 then initiates the exit animation. However, the electronic device 100 does not stop playing the image frames from the startup animation. Instead, it superimposes frames N+1 to M from the startup animation with frames 1 to MN from the exit animation, resulting in a new set of MN frames. The electronic device 100 then plays the new MN frames along with frames M-N+1 to M from the exit animation.

[0101] For example, if an application's startup animation includes 30 image frames, its exit animation also includes 30 image frames. After the application starts, the application's startup animation plays up to frame 8, and the image frames played by the electronic device 100 are from frame 1 to frame 8. Frames 1 to 8 can be... Figures 1H to 1K The UI diagram shown. It is understandable that... Figures 1H to 1K Some of the accompanying drawings have been omitted.

[0102] Then, the electronic device 100 superimposes the 9th to 30th frames of the start animation with the 1st and 22nd frames of the exit animation to obtain a new 21-frame image. The electronic device 100 then plays the new 21-frame image and the 23rd to 30th frames of the exit animation in sequence.

[0103] 2. Motion effect calculation Animation calculation includes starting animation calculation and exiting animation calculation.

[0104] When playing the startup animation, the electronic device 100 needs to calculate parameters such as window size, display time, display position, transparency, and display elements for each image frame in the startup animation, and then synthesize an image frame based on these parameters. Here, the window size, display time, display position, transparency, and display elements for each image frame in the startup animation are referred to as the image frame's parameter information. The image frame's parameter information may also include other information, which is not limited herein.

[0105] At the same time, when playing the exit animation, the electronic device 100 also needs to calculate information such as window size, display time, display position, transparency and display elements of each image frame in the exit animation, and synthesize the image frame according to the parameter information of each image frame.

[0106] It is understood that the window size of each image frame is the length and width of the image frame; the display time of each image frame is the time the image frame is hovered on the user interface of the electronic device 100; the display position of each image frame is the position coordinate of the center point of the image frame on the display screen of the electronic device 100; the transparency of each image frame is the depth of the image frame color, and the darker the color of the image frame, the smaller the transparency of the image frame; the display elements of each image frame are the text information and / or image information displayed in the image frame, etc.

[0107] How the electronic device 100 performs motion effect calculations will be described in detail in subsequent embodiments, and will not be repeated here.

[0108] 3. UI Thread: By default, an Android application has only one process, but a process can have multiple threads. One of these threads is the UI thread, also known as the main UI thread. The UI thread is created when the application runs and is primarily responsible for controlling the display, updating, and interaction of the UI interface. All application components—including activities, services, and broadcast receivers—run on the application's main thread. Therefore, time-consuming operations in any component can potentially block all other components, including services and visible activities.

[0109] 4. Surface Flinger (SF) Module: The role of surface compositing is to receive graphics display data from multiple sources, composite them, and then send them to the display device for display. For example, when opening an application, there are typically three layers: the status bar at the top, the navigation bar at the bottom or side, and the application interface. Each layer is updated and rendered independently. These interfaces are composited into a frame buffer by surface compositing. The electronic device's display can read data from the frame buffer and display the corresponding page. A buffer queue is used in the display process. Surface compositing acts as the compositing party; for example, the layers managed by the window act as the producer, generating pages through the GPU, which are then composited by surface compositing.

[0110] like Figure 5 As shown, Figure 5 An exemplary diagram is shown of an electronic device 100 playing a startup animation and a playback exit animation.

[0111] Figure 5 The flowchart shown includes a first application, an AMS (Activity Management Service) module, a WMS (Window Management Service) module, and an SF (Layer Composition) module.

[0112] In some embodiments, the layer compositing module may be omitted, and this application does not limit this.

[0113] AMS is used for the management of the lifecycle of all activities in electronic device 100.

[0114] WMS is used to manage the display order, size, position, window animations, and so on of windows.

[0115] First, the electronic device 100 receives the user's command to launch the first application. In response, the electronic device 100 creates a first animation Leash object through the AMS module and the WMS module. Then, the WMS module sends the identifier of the first animation Leash object to the first application. After receiving the identifier of the first animation Leash object, the first application begins to perform the startup animation.

[0116] Specifically, S501-S508 describe the method flow for the AMS module and WMS module to create the first animation Leash object. It should be noted that the method flow for the AMS module and WMS module to create the first animation Leash object may include more or fewer steps than S501-S508, and this application does not impose any limitations on this. Furthermore, this application does not impose any limitations on the execution order of each step in S501-S508.

[0117] S501, First application starts.

[0118] Electronic device 100 receives a user's command to launch a first application, and the first application is launched.

[0119] For example, the first application could be the Huawei Video application. The operation to launch the first application could be as follows: Figure 1G The action shown is clicking the Huawei Video application icon.

[0120] S502, the first application launches the activity.

[0121] The Activity is the core component of the first application. After the electronic device 100 receives the user's command to launch the first application, the first application starts, and the first application launches its Activity.

[0122] S503, The first application sends a binder command to the AMS (activity manager service) module.

[0123] The AMS module is a service responsible for managing the lifecycle of an activity.

[0124] The AMS module resides in the application framework layer of the first application. In the application framework layer, AMS is a very important interface, responsible not only for starting activities and services, but also for managing activities and services.

[0125] After the first application launches the activity, it enters the system's AMS process through inter-process communication via the binder command and calls the AMS.start activity interface.

[0126] S504, AMS module sets the activity to be visible.

[0127] The S505 and AMS modules set the lifecycle of an activity.

[0128] S506, the AMS module sends a notification to the window manager service (WMS) module to prepare to start the startup animation.

[0129] S507: The WMS module receives and responds to the notification sent by the AMS module to prepare to start the startup animation. The WMS module prepares to start the animation and creates the first animation leash object.

[0130] Specifically, the WMS module calls the `apply animation locked` function to prepare for the animation to begin. The WMS module obtains the parent Task object corresponding to the app window token and uses the Task's surface animator to perform the animation. Here, the app window token corresponds to an activity, which is the actual object of the activity in the system, used by the AMS and WMS modules to operate on the activity. The surface animator is responsible for animates the window and managing the lifecycle of the window animation.

[0131] The WMS module creates the first animation leash object through the surface animator. The first animation leash object is a temporary object created by the surface animator, which can control which windows should be animated, and the first application can use the first animation leash object to control the parameter information of each frame of the animation.

[0132] The S508 and WMS modules send the first animation leash object to the first application.

[0133] After receiving the identifier of the first animation leash object, the first application begins creating the startup animation. The first application determines the parameter information for each image frame in the startup animation. Then, based on the parameter information of each image frame, the first application changes the properties of the window drawn by the first animation leash object. The first application then sends the parameter information of each image frame to the SF module, which composites the image frames. Finally, the SF module displays the composite image frames in the window drawn by the first animation leash object.

[0134] Alternatively, after receiving the identifier of the first animation leash object, the first application instructs the SF module to start the launch animation. The first application determines the initial parameter information of the image frames in the launch animation, and then sends this initial parameter information to the SF module. The SF module determines the parameter information of each image frame in the launch animation based on the initial parameter information, and synthesizes the image frames based on the parameter information of each image frame. The SF module also changes the properties of the window drawn by the first animation leash object based on the parameter information of each image frame in the launch animation, and displays the synthesized image frames in the window drawn by the first animation leash object.

[0135] Specifically, S509-S512 describes the method flow of how the first application plays the startup animation. It should be noted that the method flow of how the first application plays the startup animation may include more or fewer steps than S509-S512, and this application does not impose any limitations on this. Furthermore, this application does not impose any limitations on the execution order of each step in S508-S510.

[0136] S509. The first application obtains the initial parameter information of the image frame in the startup animation.

[0137] The initial parameter information of the image frame in the startup animation includes the window size, display time, display position, transparency, and display elements of the first image frame in the startup animation. The initial parameter information of the image frame may also include other information, which is not limited here.

[0138] In some embodiments, the parameter information of the first image frame can be consistent with the parameter information of the icon of the first application. That is, the window size of the first image frame is the same as the size of the icon of the first application, the display position of the first image frame is the same as the display position of the icon of the first application, and the display elements of the first image frame are the same as the display elements of the icon of the first application.

[0139] In other embodiments, the parameter information of the first image frame may not be consistent with the parameter information of the icon of the first application, which is not limited here.

[0140] S510, The first application sends the initial parameter information of the image frame in the startup animation to the layer composition module.

[0141] S511, The layer composition module obtains the target parameter information of the next image frame based on the initial parameter information of the image frame in the startup animation, and changes the property value of the first animation leash object according to the target parameter information of the next image frame.

[0142] Using S510 and S511, the first application sends the motion effect calculation task to the layer composition module, which then performs the motion effect calculation. This greatly improves the frame dropping problem that currently occurs when the UI thread handles motion effect calculations.

[0143] Specifically, the layer compositing module adds a new motion effects processing thread to the existing thread. This thread is tasked with calculating the motion effects processed by all UI threads in the electronic device 100. This solves the problem of image frame loss due to untimely processing by the application's UI thread.

[0144] like Figure 5A As shown, Figure 5A An example diagram illustrates a multilinear operation of layer compositing.

[0145] Layer compositing involves receiving graphic display data from multiple sources, combining them, and then sending the composite to the display device. For example, when opening an application, there are typically three layers: the status bar at the top, the navigation bar at the bottom or side, and the application's interface. Each layer is updated and rendered independently.

[0146] For example, layer compositing involves three types of threads during startup: thread 1 (e.g., the Binder thread), thread 2 (e.g., the UI rendering thread), and thread 3 (e.g., the console event monitoring thread). The Binder thread allows other processes, such as application processes, to communicate with layer compositing. Part of this communication involves the UI rendering thread updating the system's UI. The console event monitoring thread monitors the sleep / wake-up state transitions of the hardware framebuffer. Whenever the hardware framebuffer needs to enter a sleep or wake-up state, the console event monitoring thread notifies the UI rendering thread so that the UI rendering thread can perform the operation of turning the display on or off.

[0147] It is understandable that the multiple threads in layer compositing run in parallel.

[0148] like Figure 5A As shown, the layer compositing side currently has threads 1, 2, and 3. To address the issue of frame drops caused by the electronic device 100 placing motion effect calculation tasks in the UI threads of various applications, resulting in delayed application processing, the electronic device 100 creates a new thread (motion effect processing thread) on the layer compositing side. The function of this motion effect processing thread is to couple the motion effect calculation tasks of all applications' UI threads in the electronic device 100 to the motion effect processing thread on the layer compositing side, allowing the motion effect calculation tasks of all applications in the electronic device 100 to be processed.

[0149] It is understandable that the motion effect processing thread, thread 1, thread 2, and thread 3 run in parallel, and the motion effect processing thread is only used for motion effect calculation. The frame drop problem caused by the first application's untimely processing is a consequence of this. On the one hand, this greatly improves the frame drop problem that occurs when the UI thread processes motion effect calculations; on the other hand, electronic devices will not experience stuttering when playing startup or exit animations, thus improving the user experience.

[0150] Specifically, the layer compositing module receives the initial parameter information of the image frame in the startup animation sent by the first application, and calculates the target parameter information of the next image frame based on the initial parameter information of the image frame in the startup animation. The layer compositing module sends the target parameter information of the next image frame to the WMS module, and the WMS module changes the attribute values ​​of the first animation leash object according to the target parameter information of the next image frame. For example, if the target parameter information of the next image frame includes information such as the window size, display time, display position, transparency, and display elements of the next image frame, then the attribute values ​​of the first animation leash object will also include information such as window size, display time, display position, transparency, and display elements.

[0151] Understandably, the first animation leash object can be a window that floats above the user interface of the electronic device 100. Then, the layer composition module sets the properties of this "window" based on the initial parameter information of the image frames in the startup animation, so that the window can display images according to the preset display order and display state of the image frames in the startup animation.

[0152] S512, the layer composition module sends the startup animation to the display for playback.

[0153] For instructions on how the first application plays its startup animation, please refer to [link / reference]. Figures 1A-1L , Figures 2A-2M , Figures 3A-3E The embodiments shown are not described in detail here.

[0154] In some embodiments, S510, S511, and S512 may also be replaced by the following S510 and S511: S510. The first application obtains the target parameter information of the next image frame based on the initial parameter information of the image frame in the startup animation, and changes the attribute value of the first animation leash object based on the target parameter information of the next image frame.

[0155] In some embodiments, the task of motion calculation can also be performed by the first application.

[0156] The first application obtains the initial parameter information of the image frame in the startup animation and calculates the target parameter information of the next image frame based on this information. The first application then changes the property values ​​of the first animation leash object according to the target parameter information of the next image frame. The property values ​​of the first animation leash object are identical to the target parameter information of the next image frame. For example, if the target parameter information of the next image frame includes information such as the window size, display time, display position, transparency, and displayed elements, then the property values ​​of the first animation leash object will also include information such as window size, display time, display position, transparency, and displayed elements.

[0157] Understandably, the first animation leash object can be a window that floats above the user interface of the electronic device 100. Then, the layer composition module sets the properties of this "window" based on the initial parameter information of the image frames in the startup animation, so that the window can display images according to the preset display order and display state of the image frames in the startup animation.

[0158] S511, The first application sends the startup animation to the display for playback.

[0159] For instructions on how electronic devices (e.g., 100) should play startup animations, please refer to [the relevant documentation / reference]. Figures 1A-1L , Figures 2A-2M , Figures 3A-3E The embodiments shown are not described in detail here.

[0160] The electronic device 100 receives a user's command to exit the first application. The electronic device 100 can receive this command either during or after the startup animation; this application does not limit the scope of the command. In response to the user's command to exit the first application, the electronic device 100 creates a second animation Leash object through the AMS and WMS modules. Then, the WMS module sends the identifier of the second animation Leash object to the first application. Upon receiving the identifier of the second animation Leash object, the first application begins performing the exit animation.

[0161] Specifically, S513-S516 describe the method flow for the AMS module and WMS module to create the second animation Leash object. It should be noted that the method flow for the AMS module and WMS module to create the second animation Leash object may include more or fewer steps than S513-S516, and this application does not impose any limitations on this. Furthermore, this application does not impose any limitations on the execution order of each step in S513-S516.

[0162] S513, First application exits.

[0163] After the first application is launched, the electronic device 100 starts playing a startup animation. At this time, the electronic device 100 can receive and respond to the user's operation to exit the first application, and the first application exits.

[0164] When the first application exits, the electronic device 100 will play an exit animation.

[0165] S514, The first application sends a binder command to the WMS module.

[0166] When the first application exits, it sends a binder instruction to the WMS module, which instructs the WMS module to start the exit animation.

[0167] The S515 and WMS modules receive and respond to binder commands, creating a second animation leash object.

[0168] Similarly, the WMS module creates a second animation leash object through the surface animator. The second animation leash object is a temporary object created by the surface animator, which can control which windows should be animated, and the first application can use the second animation leash object to control the parameter information of each frame of the exit animation.

[0169] The S516 and WMS modules send the second animation leash object to the first application.

[0170] After receiving the identifier of the second animation leash object, the first application begins creating the exit animation. The first application determines the parameter information for each image frame in the exit animation. Then, based on the parameter information of each image frame in the exit animation, the first application changes the properties of the window drawn by the second animation leash object. The first application sends the parameter information of each image frame in the exit animation to the SF module, which then composites the image frames. Finally, the SF module displays the composite image frames in the window drawn by the second animation leash object.

[0171] Alternatively, after receiving the identifier of the second animation leash object, the first application instructs the SF module to start the exit animation. The first application determines the initial parameter information of the image frames in the exit animation, and then sends the initial parameter information of the image frames in the exit animation to the SF module. The SF module determines the parameter information of each image frame in the exit animation based on the initial parameter information, and synthesizes the image frames based on the parameter information of each image frame in the exit animation. The SF module changes the properties of the window drawn by the first animation leash object based on the parameter information of each image frame in the exit animation, and displays the synthesized image frames in the window drawn by the first animation leash object.

[0172] Specifically, S517-S520 describe the method flow for the AMS module and WMS module to create the second animation Leash object. It should be noted that the method flow for the AMS module and WMS module to create the second animation Leash object may include more or fewer steps than S517-S520, and this application does not impose any limitations on this. Furthermore, this application does not impose any limitations on the execution order of each step in S517-S520.

[0173] S517. The first application obtains the initial parameter information of the image frame in the exit animation.

[0174] S518, The first application sends the initial parameter information of the image frame in the exit animation to the layer composition module.

[0175] S519. The layer composition module obtains the target parameter information of the next image frame based on the initial parameter information of the image frame in the exit animation, and changes the property value of the second animation leash object based on the target parameter information of the next image frame.

[0176] Using S518 and S519, the first application sends the motion effect calculation task to the layer composition module, which then performs the motion effect calculation. This greatly improves the frame dropping problem that currently occurs when the UI thread processes motion effect calculations.

[0177] Specifically, the layer compositing module has created a new motion effect processing thread on the basis of the original thread. The task of this thread is to calculate the motion effect calculation tasks of all UI threads in the electronic device 100.

[0178] Specifically, the layer compositing module receives the initial parameter information of the image frame in the exit animation sent by the first application, and calculates the target parameter information of the next image frame based on the initial parameter information of the exit animation image frame. The layer compositing module changes the attribute values ​​of the second animation leash object according to the target parameter information of the next image frame. The attribute values ​​of the second animation leash object are the same as the target parameter information of the next image frame. For example, if the target parameter information of the next image frame includes information such as the window size, display time, display position, transparency, and display elements of the next image frame, then the attribute values ​​of the second animation leash object will also include information such as window size, display time, display position, transparency, and display elements.

[0179] Understandably, the second animation leash object can be a window that floats above the user interface of the electronic device 100. Then, the layer composition module sets the properties of this "window" based on the initial parameter information of the image frames in the startup animation, so that the window can display images according to the preset display order and display state of the image frames in the startup animation.

[0180] S520, the layer composition module will send the exit animation to the monitor for playback.

[0181] The method by which the electronic device 100 plays the exit animation has been explained in the foregoing explanation of technical terms. Please refer to the foregoing embodiments. This application will not repeat it here.

[0182] In some embodiments, S518, S519, and S520 may also be replaced by the following S518 and S519: S518. The first application changes the target parameter information of the next image frame according to the initial parameter information of the image frame in the exit animation, and changes the attribute value of the second animation leash object according to the target parameter information of the next image frame.

[0183] In some embodiments, the task of motion calculation can also be performed by the first application.

[0184] The first application obtains the initial parameter information of the image frame in the exit animation and calculates the target parameter information of the next image frame based on this information. The first application then changes the property values ​​of the second animation leash object according to the target parameter information of the next image frame. The property values ​​of the second animation leash object are identical to the target parameter information of the next image frame. For example, if the target parameter information of the next image frame includes information such as window size, display time, display position, transparency, and displayed elements, then the property values ​​of the second animation leash object will also include information such as window size, display time, display position, transparency, and displayed elements.

[0185] Understandably, the second animation leash object can be a window that floats above the user interface of the electronic device 100. Then, the layer composition module sets the properties of this "window" based on the initial parameter information of the image frames in the startup animation, so that the window can display images according to the preset display order and display state of the image frames in the startup animation.

[0186] S519, The first application sends the exit animation to the display for playback.

[0187] The method by which the electronic device 100 plays the exit animation has been explained in the foregoing explanation of technical terms. Please refer to the foregoing embodiments. This application will not repeat it here.

[0188] like Figure 5 Analysis reveals that when electronic device 100 plays the startup animation of the first application, it creates a first animation leash object. Electronic device 100 then uses this first animation leash object to perform the startup animation. Before the startup animation of the first application has finished playing, electronic device 100 receives a user's request to exit the first application. Electronic device 100 then closes the startup animation, creates a second animation leash object to perform the exit animation, and then begins playing the exit animation. Because the startup and exit animations are two separate animations, the user experiences a sudden change in visuals when switching between them, resulting in a poor user experience.

[0189] Currently, there are two ways to play the exit animation. These two methods have already been mentioned in the terminology explanation; please refer to the aforementioned examples.

[0190] Method 1 has the following drawbacks: When the electronic device 100 plays the startup animation of the first application, before the startup animation finishes playing, the electronic device 100 receives a user's command to exit the first application. The electronic device 100 will then stop playing the startup animation and begin playing the exit animation. Here, the startup and exit animations are two separate animations. When switching between the two animations, the user experiences a sudden change in the screen, resulting in a poor user experience.

[0191] Method 2 has the following drawbacks: Before the startup animation finishes playing, the electronic device 100 creates an exit animation. The electronic device 100 needs to overlay the overlapping animations of the startup and exit animations, displaying the overlaid portion. After the overlaid animation finishes playing, the electronic device 100 begins playing the exit animation. In this method, the electronic device 100 needs to perform the overlay calculation of the overlapping animations of the startup and exit animations, which can be quite complex in complex scenarios. Furthermore, after the startup animation stops, the electronic device 100 will perform three parts of calculation: calculation of the unplayed startup animation within the startup animation, calculation of the exit animation overlapping with the unplayed startup animation within the startup animation, and the overlay calculation of the unplayed startup animation within the startup animation and the overlapping exit animation within the startup animation within the startup animation. This undoubtedly increases the computational load on the electronic device 100.

[0192] Therefore, this application provides a method for dynamically connecting applications. The method includes: an electronic device 100 receiving an operation from a user to launch a first application; the electronic device 100 creating a first animation leash object to perform a startup animation; during the startup of the first application, the electronic device 100 receiving an operation from the user to exit the first application; and the electronic device 100 reusing the first animation leash object to perform an exit animation. In this way, the startup and exit animations of the first application are both based on the first animation leash object during the switching process. Therefore, the startup and exit animations are the same animation, avoiding the problem of unnatural transitions when switching between two separate animations.

[0193] Next, the hardware architecture of the electronic device 100 mentioned in the embodiments of this application will be described.

[0194] Figure 6 A schematic diagram of the structure of the electronic device 100 is shown.

[0195] The following describes the embodiment using electronic device 100 as an example. The device type of electronic device 100 may include mobile phones, tablets, smart screens, desktop computers, laptops, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, etc. This application embodiment does not impose any special limitations on the device type of electronic device 100.

[0196] It should be understood that, Figure 6 The electronic device 100 shown is merely an example, and the electronic device 100 may have more than Figure 6 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0197] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

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

[0199] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0200] In some embodiments, the processor 110 may include a softAP network configuration module. This softAP network configuration module may be integrated into an AP, NPU, or other chip. When NAN network configuration failure is confirmed, the electronic device 100 can wake up the softAP network configuration module and use the softAP network configuration method to configure the network for the electronic device 100. In other embodiments, the processor 110 may include a Bluetooth network configuration module, an acoustic network configuration module, etc. This application embodiment does not limit the chip integrating the above-mentioned different types of network configuration modules. The above-mentioned different types of network configuration modules can be woken up after the electronic device 100 confirms NAN network configuration failure. The electronic device 100 can use the above-mentioned different types of network configuration modules to provide corresponding network configuration services for the electronic device 100.

[0201] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0202] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0203] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0204] The charging management module 140 is used to receive charging input from the charger.

[0205] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.

[0206] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0207] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization.

[0208] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1.

[0209] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0210] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0211] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0212] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0213] The ISP is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. In some embodiments, the ISP may be located within the camera 193.

[0214] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0215] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0216] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0217] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs can enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0218] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0219] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121.

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

[0221] Audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 170 can also be used for encoding and decoding audio signals.

[0222] The loudspeaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals.

[0223] The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals.

[0224] The microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.

[0225] The 170D headphone jack is used to connect wired headphones.

[0226] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals.

[0227] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B.

[0228] The 180C barometric pressure sensor is used to measure barometric pressure.

[0229] The magnetic sensor 180D includes a Hall sensor.

[0230] The accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic device 100, and can be applied to applications such as screen orientation switching and pedometers.

[0231] Distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser.

[0232] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from a nearby object. When sufficient reflected light is detected, it can be determined that an object is near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that no object is near the electronic device 100.

[0233] The 180L ambient light sensor is used to detect ambient light intensity.

[0234] The fingerprint sensor 180H is used to collect fingerprints.

[0235] The 180J temperature sensor is used to detect temperature.

[0236] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can then transmit the detected touch operation to the application processor to determine the type of touch event.

[0237] The bone conduction sensor 180M can acquire vibration signals.

[0238] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0239] Motor 191 can generate vibration alerts.

[0240] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0241] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and detach from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from it.

[0242] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.

[0243] Figure 7 This is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0244] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0245] The application layer can include a series of application packages.

[0246] like Figure 7 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0247] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0248] like Figure 7 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0249] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0250] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0251] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0252] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0253] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0254] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0255] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0256] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0257] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0258] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0259] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0260] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0261] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0262] A 2D graphics engine is a graphics engine for 2D drawing.

[0263] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0264] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 100.

[0265] When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a touch click as an example, where the corresponding control is the camera application icon, the camera application calls the application framework layer's interface to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.

[0266] The following section describes a method for application animation transitions provided in the application embodiments, using an application scenario as an example.

[0267] First, the electronic device 100 receives and responds to the user's operation of opening the first application, and the electronic device 100 plays the startup animation of the first application.

[0268] For example, if the startup animation of the first application consists of N frames (e.g., 10 frames), when the electronic device 100 receives a message from the user exiting the first application, the electronic device 100 has already played the Mth frame (e.g., 4th frame) of the startup animation.

[0269] For example, the first four frames of the startup animation played by the electronic device 100 can be as follows: Figures 1H-1K The UI diagram shown is not repeated here.

[0270] The fourth frame of the startup animation displayed on the electronic device 100 (e.g.) Figure 1K When the user exits the first application (as shown in the UI diagram), the electronic device 100 will activate the exit animation.

[0271] Exiting the first application can be a swipe operation applied to the edge of the screen of the electronic device 100 (e.g., the bottom edge) towards the top of the screen, or a click operation applied to the "return to home screen" button among the three buttons. It should be noted that the "return to home screen" button among the three buttons can be a physical button or a virtual button; this application does not limit this. Exiting the first application can also be other operations; this application does not limit this as well.

[0272] This application embodiment uses the example of exiting the first application as an example of a swipe operation from the bottom edge of the screen to the top of the screen on the electronic device 100.

[0273] It should be noted that the direction of the sliding operation from the bottom edge of the screen of the electronic device 100 to the top of the screen will affect the playback effect of the exit animation.

[0274] Specifically, when the operation to exit the first application is a sliding operation that is perpendicular to the bottom edge of the screen of the electronic device 100 and moves upwards on the screen, this operation has no effect on the exit animation played by the electronic device 100.

[0275] When the operation to exit the first application is a swipe operation performed on the bottom edge of the screen of the electronic device 100 towards the upper right of the screen, the exit animation played by the electronic device 100 will shift to the right.

[0276] When the operation to exit the first application is a swipe operation performed on the bottom edge of the screen of the electronic device 100 towards the upper left, the exit animation played by the electronic device 100 will shift to the left.

[0277] First, let's introduce the application scenarios corresponding to the operation of exiting the first application, which is a swipe operation that is perpendicular to the bottom edge of the screen of the electronic device 100 and moves upwards on the screen.

[0278] Figures 8A-8H An exemplary UI diagram is shown for an application scenario where the operation to exit the first application is a swipe operation that is perpendicular to the bottom edge of the screen of the electronic device 100 and moves upwards onto the screen.

[0279] For example, such as Figure 8A As shown, Figure 8A The last frame of the startup animation of the first application played by the electronic device 100 is image frame 8001. When the electronic device 100 receives and responds to a user action and a swipe operation perpendicular to the bottom edge of the screen of the electronic device 100 and moves upwards on the screen, the electronic device 100 will play the exit animation of the first application.

[0280] Furthermore, the electronic device 100 displays image frames 8001 and 8002 in a window drawn based on the same animation leash object. Image frame 8001 is the last frame in the startup animation, and image frame 8002 is the first frame in the exit animation. Therefore, the transition between the startup and exit animations on the electronic device 100 is natural.

[0281] Electronic device 100 displays such as Figure 8B The image frame 8002 shown can be the first image frame in the exit animation. The image content of image frame 8002 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0282] The size of image frame 8002 gradually decreases, and the electronic device 100 displays it as follows: Figure 8C The image frame 8003 shown can be the second image frame in the exit animation. The image content of image frame 8003 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0283] The size of image frame 8003 gradually decreases, and the electronic device 100 displays it as follows: Figure 8D The image frame 8004 shown can be the third image frame in the exit animation. The image content of image frame 8004 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0284] The size of image frame 8004 gradually decreases, and the electronic device 100 displays it as follows: Figure 8E Image frame 8005 shown can be the 4th image frame in the exit animation. The image content of image frame 8005 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0285] The size of image frame 8005 gradually decreases, and the electronic device 100 displays it as follows: Figure 8F Image frame 8006 shown can be the 5th image frame in the exit animation. The size of image frame 8006 is larger than the size of the Huawei video icon, and the image content of image frame 8006 displays the image content of the Huawei video icon. The image content of image frame 8006 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0286] The size of image frame 8006 gradually decreases, and the electronic device 100 displays it as follows: Figure 8G Image frame 8007 shown can be the 6th image frame in the exit animation. The size of image frame 8007 is the same as the size of the Huawei Video icon, and the image content of image frame 8007 displays the image content of the Huawei Video icon. The image content of image frame 8007 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0287] Understandable, Figures 8A-8G This only shows a portion of the images shown in the exit animation; more images could be included. Figures 8A-8G Some of the accompanying drawings have been omitted, but this application does not limit the scope of the application.

[0288] Figure 8H An example is shown in the above exit animation. Figures 8A-8G The image frame shown is a diagram of the movement trajectory of the center point.

[0289] The initial position is Figure 8A The location of the center point of the image frame shown, and then... Figures 8A-8G The center point of the image frame shown gradually moves from its initial position to its final position along motion trajectory 8008. The final position is... Figure 8F and Figure 8G The location of the center point of the image frame shown.

[0290] Figures 9A-9F An example UI diagram is shown for an application scenario where the operation to exit the first application is a swipe operation from the bottom edge of the screen of the electronic device 100 to the upper right.

[0291] For example, such as Figure 9A As shown, Figure 9A Image frame 9001 is the last frame in the startup animation of the first application played by the electronic device 100. The electronic device 100 receives and responds to the user's swipe operation from the bottom edge of the screen to the upper right of the screen, and the electronic device 100 will play the exit animation of the first application.

[0292] Electronic device 100 displays such as Figure 9B Image frame 9002 shown can be the first image frame in the exit animation. The image content of image frame 9002 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Figure 9B As shown, compared with image frame 8002, image frame 9002 is offset to the right side of the screen of electronic device 100.

[0293] Furthermore, the electronic device 100 displays image frames 9001 and 9002 in a window drawn based on the same animation leash object. Image frame 9001 is the last frame in the startup animation, and image frame 9002 is the first frame in the exit animation. Therefore, the transition between the startup and exit animations on the electronic device 100 is natural.

[0294] It should be noted that the portion of the image frame 9002 that extends beyond the right edge of the electronic device 100 will not be displayed by the electronic device 100; the electronic device 100 will only display the portion of the image frame 9002 that extends beyond the right edge of the electronic device 100.

[0295] In some embodiments, image frame 9002 is offset to the right side of the screen of electronic device 100, with the maximum offset being such that the right edge of image frame 9002 coincides with the right side of the screen of electronic device 100. This application does not limit the amount of offset of image frame 9002 to the right side of the screen of electronic device 100.

[0296] The size of image frame 9002 gradually decreases, and the electronic device 100 displays it as follows: Figure 9C Image frame 9003 shown can be the second image frame in the exit animation. The image content of image frame 9003 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Figure 9C As shown, compared with image frame 8003, image frame 9003 is offset to the right side of the screen of electronic device 100.

[0297] The size of image frame 9003 gradually decreases, and the electronic device 100 displays it as follows: Figure 9D Image frame 9004 shown can be the third image frame in the exit animation. The image content of image frame 9004 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Figure 9D As shown, compared with image frame 8004, image frame 9004 is offset to the right side of the screen of electronic device 100.

[0298] The size of image frame 9004 gradually decreases, and the electronic device 100 displays it as follows: Figure 9E Image frame 9005 shown can be the fourth image frame in the exit animation. The image content of image frame 9005 may or may not display any elements; this application does not impose any limitations on this. Figure 9E As shown, compared with image frame 8005, image frame 9005 is offset to the right side of the screen of electronic device 100.

[0299] The size of image frame 9005 gradually decreases, and the electronic device 100 displays it as follows: Figure 8F Image frame 8006 shown can be the 5th image frame in the exit animation. The size of image frame 8006 is larger than the size of the Huawei video icon, and the image content of image frame 8006 displays the image content of the Huawei video icon. The image content of image frame 8006 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0300] The size of image frame 8006 gradually decreases, and the electronic device 100 displays it as follows: Figure 8G Image frame 8007 shown can be the 6th image frame in the exit animation. The size of image frame 8007 is the same as the size of the Huawei Video icon, and the image content of image frame 8007 displays the image content of the Huawei Video icon. The image content of image frame 8007 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0301] Understandable, Figures 9A-9E , Figures 8F-8G This only shows a portion of the images shown in the exit animation; more images could be included. Figures 9A-9E , Figures 8F-8G Some of the accompanying drawings have been omitted, but this application does not limit the scope of the application.

[0302] Figure 9F An example is shown in the above exit animation. Figures 9A-9E , Figures 8F-8G The image frame shown is a diagram of the movement trajectory of the center point.

[0303] The initial position is Figure 9A The location of the center point of the image frame shown, and then... Figures 9A-9E , Figures 8F-8G The center point of the image frame shown gradually moves from its initial position to its final position along the motion trajectory 9006. The final position is... Figure 8F and Figure 8G The location of the center point of the image frame shown.

[0304] like Figure 9F As shown, when the operation to exit the first application is a sliding operation applied to the bottom edge of the screen of electronic device 100 towards the upper right of the screen, the trajectory of the center point of the image frame in the exit animation is trajectory 9006. When the operation to exit the first application is a sliding operation applied to the bottom edge of the screen of electronic device 100 and perpendicular to the bottom edge of the screen towards the upper right of the screen, the trajectory of the center point of the image frame in the exit animation is trajectory 8008. It can be seen that, compared with trajectory 8008, trajectory 9006 is shifted to the right side of the screen of electronic device 100.

[0305] Figures 10A-10F An example UI diagram is shown for an application scenario where the operation to exit the first application is a swipe operation from the bottom edge of the screen of the electronic device 100 to the upper left.

[0306] For example, such as Figure 10A As shown, Figure 10A Image frame 10001 is the last frame in the startup animation of the first application played by the electronic device 100. The electronic device 100 receives and responds to the user's swipe operation from the bottom edge of the screen to the upper left of the screen, and the electronic device 100 will play the exit animation of the first application.

[0307] Electronic device 100 displays such as Figure 10B Image frame 10002 shown can be the first image frame in the exit animation. The image content of image frame 10002 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Figure 10B As shown, compared with image frame 8002, image frame 10002 is offset to the left side of the screen of electronic device 100.

[0308] Furthermore, the electronic device 100 displays image frames 10001 and 10002 in a window drawn based on the same animation leash object. Image frame 10001 is the last frame in the startup animation. Image frame 10002 is the first frame in the exit animation. Therefore, the transition between the startup and exit animations on the electronic device 100 is natural.

[0309] It should be noted that the portion of the image frame 10002 whose left edge extends beyond the right edge of the electronic device 100 will not be displayed by the electronic device 100. The electronic device 100 will only display the image between the right edge of the image frame 9002 and the left edge of the electronic device 100.

[0310] In some embodiments, image frame 9002 is offset to the left side of the screen of electronic device 100, with the maximum offset being such that the left edge of image frame 9002 coincides with the left side of the screen of electronic device 100. This application does not limit the amount of offset of image frame 9002 to the left side of the screen of electronic device 100.

[0311] The size of image frame 10002 gradually decreases, and the electronic device 100 displays as follows: Figure 10C Image frame 10003 shown here, image frame 10002 can be the second image frame in the exit animation. The image content of image frame 10003 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Figure 10C As shown, compared with image frame 8003, image frame 10003 is offset to the left side of the screen of electronic device 100.

[0312] The size of image frame 10003 gradually decreases, and the electronic device 100 displays it as follows: Figure 10D Image frame 10004 shown can be the third image frame in the exit animation. The image content of image frame 10004 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this. Figure 10D As shown, compared with image frame 8004, image frame 10004 is offset to the left side of the screen of electronic device 100.

[0313] The size of image frame 10004 gradually decreases, and the electronic device 100 displays it as follows: Figure 10E Image frame 10005 shown can be the 4th image frame in the exit animation. The image content of image frame 10005 may or may not display any elements; this application does not impose any limitations on this. Figure 10E As shown, compared with image frame 8005, image frame 10005 is offset to the left side of the screen of electronic device 100.

[0314] The size of image frame 10005 gradually decreases, and the electronic device 100 displays it as follows: Figure 8F Image frame 8006 shown can be the 5th image frame in the exit animation. The size of image frame 8006 is larger than the size of the Huawei video icon, and the image content of image frame 8006 displays the image content of the Huawei video icon. The image content of image frame 8006 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0315] The size of image frame 8006 gradually decreases, and the electronic device 100 displays it as follows: Figure 8G Image frame 8007 shown can be the 6th image frame in the exit animation. The size of image frame 8007 is the same as the size of the Huawei Video icon, and the image content of image frame 8007 displays the image content of the Huawei Video icon. The image content of image frame 8007 may not display any elements, or it may display one or more elements; this application does not impose any limitations on this.

[0316] Understandable, Figures 10A-10E , Figures 8F-8G This only shows a portion of the images shown in the exit animation; more images could be included. Figures 10A-10E , Figures 8F-8G Some of the accompanying drawings have been omitted, but this application does not limit the scope of the application.

[0317] Figure 10F An example is shown in the above exit animation. Figures 10A-10E , Figures 8F-8G The image frame shown is a diagram of the movement trajectory of the center point.

[0318] The initial position is Figure 10A The location of the center point of the image frame shown, and then... Figures 10A-10E , Figures 8F-8G The center point of the image frame shown gradually moves from its initial position along the motion trajectory 10006 towards its final position. The final position is... Figure 8F and Figure 8G The location of the center point of the image frame shown.

[0319] like Figure 10F As shown, when the operation to exit the first application is a sliding operation applied to the bottom edge of the screen of the electronic device 100 towards the upper left of the screen, the trajectory of the center point of the image frame in the exit animation is trajectory 10006. When the operation to exit the first application is a sliding operation applied to the bottom edge of the screen of the electronic device 100 and perpendicular to the bottom edge of the screen towards the upper right of the screen, the trajectory of the center point of the image frame in the exit animation is trajectory 8008. It can be seen that, compared with trajectory 8008, trajectory 10006 is shifted to the left side of the screen of the electronic device 100.

[0320] Next, we will explain how electronic device 100 performs motion effect calculations.

[0321] As mentioned in the foregoing terminology explanation, motion effect calculation refers to calculating the parameter information of each image frame in the start or end of a motion effect. In this embodiment, the parameter information of the next image frame is calculated using an interpolation algorithm based on the initial parameter information of the image frames in the start or end of the motion effect.

[0322] First, let's introduce how electronic device 100 calculates the parameter information of the next frame of the startup animation based on the initial parameter information of the image frame in the startup animation using an interpolation algorithm.

[0323] Assuming the application's startup animation includes M image frames, and the initial parameter information of the image frames in the startup animation is preset, for example, the initial parameter information of the image frames in the startup animation includes the window size, display time, display position, transparency, and display elements of the first image frame in the startup animation. The initial parameter information of the image frames may also include other information, which is not limited here.

[0324] In some embodiments, the parameter information of the first image frame can be consistent with the parameter information of the icon of the first application. That is, the window size of the first image frame is the same as the size of the icon of the first application, the display position of the first image frame is the same as the display position of the icon of the first application, and the display elements of the first image frame are the same as the display elements of the icon of the first application.

[0325] In other embodiments, the parameter information of the first image frame may not be consistent with the parameter information of the icon of the first application, which is not limited here.

[0326] The electronic device 100 receives a user's command to launch the first application, and then begins playing the application's launch animation. The electronic device 100 can use an interpolation algorithm to obtain the parameter information of the next image frame based on the parameter information of the current image frame.

[0327] Specifically, the electronic device 100 obtains the initial parameter information of the image frame of the startup animation. This initial parameter information can be the parameter information of the first image frame in the startup animation. The electronic device 100 can use an interpolation algorithm to obtain the parameter information of the second image frame in the startup animation based on the parameter information of the first image frame, and so on. The electronic device 100 can use an interpolation algorithm to obtain the parameter information of the third image frame in the startup animation based on the parameter information of the second image frame, and so on, until the electronic device 100 uses an interpolation algorithm to obtain the parameter information of the Mth image frame in the startup animation based on the parameter information of the (N-1)th image frame, and so on, until the electronic device 100 uses an interpolation algorithm to obtain the parameter information of the Mth image frame in the startup animation based on the parameter information of the (M-1)th image frame.

[0328] Next, we will introduce how electronic device 100 calculates the parameter information of the next frame of the starting animation based on the initial parameter information of the image frame in the exit animation using an interpolation algorithm.

[0329] Assuming the application's exit animation consists of M image frames, if the electronic device 100 receives the user's exit command after the startup animation has finished playing, the initial parameter information of the image frames in the exit animation is the parameter information of the Mth image frame in the startup animation that the electronic device 100 has already calculated. If the electronic device 100 receives the user's exit command before the startup animation has finished playing (for example, when the startup animation has played the Nth image frame, where N is less than M), the initial parameter information of the image frames in the exit animation is the parameter information of the Nth image frame in the startup animation currently displayed by the electronic device 100.

[0330] If the electronic device 100 receives a user's request to exit the first application before the startup animation finishes playing (for example, when the startup animation has reached the Nth frame), the electronic device 100 will begin playing the exit animation of the first application. The electronic device 100 can obtain the parameter information of the next frame based on the parameter information of the current frame using an interpolation algorithm.

[0331] Specifically, the electronic device 100 obtains the initial parameter information of the image frame exiting the animation. This initial parameter information can be the parameter information of the first image frame in the exiting animation, or it can be the parameter information of the Nth image frame in the starting animation. The electronic device 100 can use a difference algorithm to obtain the second image frame information of the image frame exiting the animation based on the initial parameter information, and so on. The electronic device 100 can use a difference algorithm to obtain the third image frame information of the image frame exiting the animation based on the second image frame information, and so on, until the electronic device 100 can use a difference algorithm to obtain the Nth image frame information of the image frame exiting the animation based on the (N-1)th image frame information.

[0332] The following section will introduce the principle of the interpolation algorithm, specifically how electronic device 100 uses the interpolation algorithm to obtain the parameter information of the next image frame based on the parameter information of the current image frame in the animation.

[0333] Because the parameter values ​​in the interpolation algorithm differ, the electronic device 100 will obtain different parameter values ​​for the next image frame based on the parameter information of the current image frame in the animation. Therefore, the animation curve obtained by the electronic device 100 will also be different. For example, such as Figure 11 As shown, Figure 11 Examples of the effects of several interpolation algorithms on the animation curves are shown.

[0334] like Figure 11 As shown in (a) in the figure, Figure 11 Example (a) illustrates the first type of uniform motion effect curve. That is, the switching time between any two adjacent image frames in the start or exit motion effect played by the electronic device 100 is equal.

[0335] like Figure 11 As shown in (b) in the figure, Figure 11 (b) in the example illustrates the second type of deceleration motion effect curve. That is, in the start or exit motion effect played by the electronic device 100, the switching time between two adjacent image frames decreases sequentially from front to back.

[0336] like Figure 11 As shown in (c), Figure 11 (c) in the figure exemplifies the third type of accelerated motion effect curve. That is, in the start or exit motion effect played by the electronic device 100, the switching time between two adjacent image frames increases sequentially from front to back.

[0337] Motion curves can also include other types, such as fade-in and fade-out motion curves, which will not be listed here.

[0338] The interpolation algorithm can obtain the parameter information of the next image frame based on the parameter information of the current image frame in the animation using the following formula: Formula (1) a=k*x / m Formula (2) V = v + a*t Formula (3) P=p+V*t As shown in formulas (1), (2), and (3), the interpolation algorithm can obtain the parameter information of the next image frame based on the parameter information of the current image frame using formulas (1), (2), and (3). In formulas (1), (2), and (3), a represents acceleration, k represents rigidity, and according to Hooke's theorem for springs, k = -F / x, where x represents the length of the spring deformation, and F represents the force received when the spring deforms to a length of x. According to Newton's law of motion, F can be expressed as F = m * a, where m is the force of the object. Based on formulas k = -F / x and F = m * a, the acceleration a = -k * x / m can be obtained.

[0339] v represents the initial velocity of the object, V represents the velocity of the object at the next moment, p represents the initial position of the object, P represents the position of the object at the next moment, and t represents the parameter information of which frame of the image is being calculated by the electronic device 100 to start or exit the animation effect.

[0340] It should be noted that when the electronic device 100 calculates the parameter information of the image frame in the start animation, v in formula (3) is a positive number; when the electronic device 100 calculates the parameter information of the image frame in the exit animation, v in formula (3) is a negative number.

[0341] In this way, the difference algorithm can obtain the parameter information of the next image frame by taking the parameter information of the current image frame as the input p of formula (3) and outputting P through formula (3).

[0342] For example, electronic device 100 is displaying the first image frame in the startup animation. Electronic device 100 needs to obtain the parameter information of the second image frame based on the parameter information of the first image frame within a fixed time. Electronic device 100 synthesizes the second image frame based on the parameter information of the second image frame.

[0343] If the preset position information of the first image frame is (x, y), where x is the length of the first image frame and y is the width of the first image frame, the electronic device 100 inputs the position information (x, y) of the first image frame into the above formula (3), and the above formula (3) outputs the position information (x1, y1) of the second image frame, where x1=x+v+k*x / m and y1=y+v+k*x / m. Where v is a positive number.

[0344] For example, when electronic device 100 is displaying the Nth frame of the startup animation, electronic device 100 receives an operation from the user to exit the first application. Electronic device 100 needs to obtain the parameter information of the first frame of the exit animation based on the parameter information of the Nth frame of the startup animation within a fixed time. Electronic device 100 synthesizes and displays the first frame of the exit animation based on the parameter information of the first frame of the exit animation.

[0345] If the preset position information of the Nth frame in the startup animation is (x, y), where x is the length of the Nth frame in the startup animation and y is the width of the Nth frame in the startup animation, the electronic device 100 inputs the position information (x, y) of the Nth frame in the startup animation into the above formula (3), and the above formula (3) outputs the position information (x1, y1) of the 2nd frame in the exit animation, where x1=x+v+k*x / m and y1=y+v+k*x / m. Where v is a negative number.

[0346] To facilitate understanding of this application, embodiments of this application use a uniform motion curve to illustrate the execution effect of the interpolation algorithm.

[0347] When the motion effect curve is a uniform motion effect curve, a=0 in formulas (1), (2) and (3), and v is a fixed value. When the electronic device 100 calculates the parameter information of the image frame in the start motion effect, v is a positive number; when the electronic device 100 calculates the parameter information of the image frame in the exit motion effect, v is a negative number.

[0348] The interpolation algorithm can obtain the parameter information of the next image frame based on the parameter information of the current image frame using the following formula: Formula (4) P=p+v*t As shown in formula (4), P represents the initial position of the object, p represents the position of the object at the next moment, and t represents time. In this way, the physics engine can obtain the parameter information of the next image frame by taking the parameter information of the current image frame as the input p of formula (3) and outputting P through formula (3).

[0349] For example, electronic device 100 is displaying the first image frame in the startup animation. Electronic device 100 needs to obtain the parameter information of the second image frame based on the parameter information of the first image frame within a fixed time. Electronic device 100 synthesizes the second image frame based on the parameter information of the second image frame.

[0350] If the position information of the first image frame is (x, y), where x is the preset length of the first image frame and y is the preset width of the first image frame, the layer compositing module inputs the position information (x, y) of the second image frame into the above formula (3), and the above formula (3) outputs the target position information (x1, y1) of the second image frame, where x1=x+v and y1=y+v.

[0351] For example, electronic device 100 is displaying the Nth frame of the startup animation, and the position information of the Nth frame of the startup animation is (x+Nv, y+Nv). At this time, electronic device 100 receives the user's operation to exit the first application. Electronic device 100 needs to obtain the parameter information of the first frame of the exit animation based on the parameter information of the Nth frame of the startup animation within a fixed time. Electronic device 100 synthesizes and displays the first frame of the exit animation based on the parameter information of the first frame of the exit animation.

[0352] If the preset position information of the Nth frame in the startup animation is (x + N*v, y + N*v), where x + N*v is the length of the Nth frame in the startup animation and y + N*v is the width of the Nth frame in the startup animation, the electronic device 100 inputs the position information (x + Nv, y + Nv) of the Nth frame in the startup animation into the above formula (3), and the above formula (3) outputs the position information (x1, y1) of the 1st frame in the exit animation, where x1 = x + N*v - v and y1 = y + N*v - v.

[0353] In this way, the electronic device 100 can calculate the parameter information of the next image frame based on the parameter information of the currently displayed image frame in the startup or exit animation effect using an interpolation algorithm. The electronic device 100 then synthesizes the next image frame based on the parameter information of the next image frame and displays it on the monitor. This way, the electronic device 100 reuses the animationleash object from the startup process for the exit animation effect, preventing abrupt changes when switching between startup and exit animation effects, resulting in a more natural animation effect playback.

[0354] like Figure 12 As shown, Figure 12 An exemplary diagram is shown of another electronic device 100 playing startup animation and playback exit animation.

[0355] Figure 12 The flowchart shown includes a first application, an AMS (Activity Management Service) module, a WMS (Window Management Service) module, and an SF (Surface Flinger) module.

[0356] In some embodiments, Figure 12 The flowchart shown may also exclude the layer composition module, and this application does not limit this.

[0357] First, the electronic device 100 receives the user's command to launch the first application. In response, the electronic device 100 creates a first animation Leash object through the AMS module and the WMS module. Then, the WMS module sends the identifier of the first animation Leash object to the first application. After receiving the identifier of the first animation Leash object, the first application begins to perform the startup animation.

[0358] Specifically, S1001-S1008 describe the method flow for the AMS module and WMS module to create the first animation Leash object. It should be noted that the method flow for the AMS module and WMS module to create the first animation Leash object may include more or fewer steps than S1001-S1008, and this application does not impose any limitations on this. Furthermore, this application does not impose any limitations on the execution order of each step in S1001-S1008.

[0359] S1201, First application starts.

[0360] S1202, The first application launches the activity.

[0361] S1203, The first application sends a binder command to the AMS (activity manager service) module.

[0362] S1204, AMS module sets the activity to be visible.

[0363] S1205, AMS module sets the lifecycle of an activity.

[0364] S1206, the AMS module sends a notification to the window manager service (WMS) module to prepare to start the startup animation.

[0365] S1207. The WMS module receives and responds to the notification sent by the AMS module to prepare to start the startup animation. The WMS module prepares to start the animation and creates the first animation leash object.

[0366] S1208, the WMS module sends the first animation leash object to the first application.

[0367] After receiving the identifier of the first animation leash object, the first application begins creating the startup animation. The first application determines the parameter information for each image frame in the startup animation. Then, based on the parameter information of each image frame, the first application changes the properties of the window drawn by the first animation leash object. The first application then sends the parameter information of each image frame to the SF module, which composites the image frames. Finally, the SF module displays the composite image frames in the window drawn by the first animation leash object.

[0368] Alternatively, after receiving the identifier of the first animation leash object, the first application instructs the SF module to start the launch animation. The first application determines the initial parameter information of the image frames in the launch animation, and then sends this initial parameter information to the SF module. The SF module determines the parameter information of each image frame in the launch animation based on the initial parameter information, and synthesizes the image frames based on the parameter information of each image frame. The SF module also changes the properties of the window drawn by the first animation leash object based on the parameter information of each image frame in the launch animation, and displays the synthesized image frames in the window drawn by the first animation leash object.

[0369] Specifically, S1009-S1012 describe the method flow of how the first application plays the startup animation. It should be noted that the method flow of how the first application plays the startup animation may include more or fewer steps than S1009-S1012, and this application does not impose any limitations on this. Furthermore, this application does not impose any limitations on the execution order of each step in S1009-S1012.

[0370] S1209. The first application obtains the initial parameter information of the frame image in the startup animation.

[0371] S1210, The first application sends the initial parameter information of the frame image in the startup animation to the layer composition module.

[0372] S1211 The layer composition module obtains the target parameter information of the next image frame based on the initial parameter information of the image frame in the startup animation, and changes the property value of the first animation leash object based on the target parameter information of the next image frame.

[0373] S1212, The layer composition module sends the startup animation to the monitor for playback.

[0374] The electronic device 100 receives a user's command to exit the first application. The electronic device 100 can receive this command either during or after the startup animation; this application does not limit the timing. In response to the user's command to exit the first application, the electronic device 100 reuses the first animation Leash object through the AMS and WMS modules. Then, the WMS module sends the identifier of the first animation Leash object to the first application. Upon receiving the identifier of the first animation Leash object, the first application begins performing the exit animation.

[0375] Specifically, S1213-S1216 describe the method flow for the AMS module and WMS module to create the second animation Leash object. It should be noted that the method flow for the AMS module and WMS module to create the second animation Leash object may include more or fewer steps than S1213-S1216, and this application does not impose any limitations on this. Furthermore, this application does not impose any limitations on the execution order of each step in S1213-S1216.

[0376] S1213, First application exits.

[0377] S1214. The first application sends a binder command to the WMS module.

[0378] For a detailed explanation of S1201-S1214, please refer to the embodiments in S501 and S514, which will not be repeated here.

[0379] S1215, the WMS module receives and responds to the binder command, reusing the first animation leash object.

[0380] The first animation leash object is created by the electronic device 100 when playing the startup animation. The electronic device 100 continues to use the first animation leash object when playing the exit animation. In this way, the startup animation and the exit animation are a complete animation, and there will be no problem of unnatural transition when switching between the startup animation and the exit animation.

[0381] S1216, the WMS module sends the first animation leash object to the first application.

[0382] After receiving the identifier of the first animation leash object, the first application begins creating the exit animation. The first application determines the parameter information for each image frame in the exit animation. Then, based on the parameter information of each image frame in the exit animation, the first application changes the properties of the window drawn by the first animation leash object. The first application sends the parameter information of each image frame in the exit animation to the SF module, which then synthesizes the image frames. Finally, the SF module displays the synthesized image frames in the window drawn by the first animation leash object.

[0383] Alternatively, after receiving the identifier of the first animation leash object, the first application instructs the SF module to start the exit animation. The first application determines the initial parameter information of the image frames in the exit animation, and then sends the initial parameter information of the image frames in the exit animation to the SF module. The SF module determines the parameter information of each image frame in the exit animation based on the initial parameter information, and synthesizes the image frames based on the parameter information of each image frame in the exit animation. The SF module changes the properties of the window drawn by the first animation leash object based on the parameter information of each image frame in the exit animation, and displays the synthesized image frames in the window drawn by the first animation leash object.

[0384] Specifically, S1217-S1220 describe the method flow for the AMS module and WMS module to reuse the first animation Leash object. It should be noted that the method flow for the AMS module and WMS module to create the first animation Leash object may include more or fewer steps than S1217-S1220, and this application does not impose any limitations on this. Furthermore, this application does not impose any limitations on the execution order of each step in S1217-S1220.

[0385] S1217. The first application obtains the initial parameter information of the image frame in the exit animation.

[0386] First, the first application obtains the initial parameter information of the image frames in the exit animation. This initial parameter information is the parameter information of the first image frame in the exit animation. The first application can then use an interpolation algorithm to obtain the parameter information of the second image frame in the exit animation based on the parameter information of the first image frame, and so on. The first application can use the interpolation algorithm to obtain the parameter information of the third image frame in the exit animation based on the parameter information of the second image frame, and so on, until the electronic device 100 uses an interpolation algorithm to obtain the parameter information of the Mth image frame in the exit animation based on the parameter information of the (N-1)th image frame. The exit animation includes M image frames. In other words, the first application obtains the parameter information of the next image frame based on the parameter information of the currently displayed image frame using an interpolation algorithm.

[0387] In some embodiments, during the playback of the startup animation, for example, when the electronic device 100 is currently displaying the Nth frame of the startup animation, the electronic device 100 receives a second operation to exit the first application. At this time, the first application obtains the initial parameter information of the exit animation as the parameter information of the Nth frame of the startup animation.

[0388] For details, please refer to the following. Figure 13 The embodiments described herein will not be repeated here.

[0389] S1218. The first application sends the initial parameter information of the image frame in the exit animation to the layer composition module.

[0390] S1219. The layer composition module obtains the target parameter information of the next image frame based on the initial parameter information of the image frame in the exit animation, and changes the property value of the first animation leash object based on the target parameter information of the next image frame.

[0391] Using S518 and S519, the first application sends the motion effect calculation task to the layer composition module, which then performs the motion effect calculation. This greatly improves the frame dropping problem that currently occurs when the UI thread processes motion effect calculations.

[0392] Specifically, the layer compositing module has created a new motion effect processing thread on the basis of the original thread. The task of this thread is to calculate the motion effect calculation tasks of all UI threads in the electronic device 100.

[0393] Specifically, the layer compositing module receives the initial parameter information of the image frame in the exit animation sent by the first application, and calculates the target parameter information of the next image frame based on the initial parameter information of the image frame in the exit animation. The layer compositing module sends the target parameter information of the next image frame to the WMS module. The WMS module changes the attribute values ​​of the first animation leash object according to the target parameter information of the next image frame, and draws the second window according to the attribute values ​​of the first animation leash object. For example, if the target parameter information of the next image frame includes information such as the window size, display time, display position, transparency, and display elements of the next image frame, then the attribute values ​​of the first animation leash object will also include information such as window size, display time, display position, transparency, and display elements.

[0394] Understandably, the first animation leash object can be a window that floats above the user interface of the electronic device 100. Then, the layer composition module sets the properties of this "window" based on the initial parameter information of the image frames in the startup animation, so that the window can display images according to the preset display order and display state of the image frames in the startup animation.

[0395] S1220, The layer composition module will send the exit animation to the monitor for playback.

[0396] After the layer compositing module composes an image frame based on the updated parameter information of the image frame, it sends the compositing image frame to the display for display.

[0397] The method by which the electronic device 100 plays the exit animation has been explained in the foregoing explanation of technical terms. Please refer to the foregoing embodiments. This application will not repeat it here.

[0398] In some embodiments, S1218, S1219, and S1920 may also be replaced by the following S1218 and S1219: S1218. The first application obtains the target parameter information of the next image frame based on the initial parameter information of the image frame in the exit animation, and changes the attribute value of the first animation leash object based on the target parameter information of the next image frame.

[0399] Specifically, the first application calculates the target parameter information for the next image frame based on the initial parameter information of the image frame in the exit animation. The first application sends the target parameter information of the next image frame to the WMS module. The WMS module changes the attribute values ​​of the first animation leash object based on the target parameter information of the next image frame, and then draws the second window based on the attribute values ​​of the first animation leash object. For example, if the target parameter information of the next image frame includes information such as the window size, display time, display position, transparency, and displayed elements, then the attribute values ​​of the first animation leash object will also include information such as window size, display time, display position, transparency, and displayed elements.

[0400] Understandably, the first animation leash object can be a window that floats above the user interface of the electronic device 100. Then, the layer composition module sets the properties of this "window" based on the initial parameter information of the image frames in the startup animation, so that the window can display images according to the preset display order and display state of the image frames in the startup animation.

[0401] S1219, The first application sends the exit animation to the display for playback.

[0402] After the first application synthesizes an image frame based on the parameter information of the updated image frame, it sends the synthesized image frame to the display for display.

[0403] The method by which the electronic device 100 plays the exit animation has been explained in the foregoing explanation of technical terms. Please refer to the foregoing embodiments. This application will not repeat it here.

[0404] like Figure 13 As shown, Figure 13 An exemplary flowchart of a method for application animation transitions provided in an embodiment of this application is shown.

[0405] S1301, Electronic device 100 receives the user's first operation to start the task of playing the startup animation (first animation) of the first application.

[0406] The first operation is the operation of opening the first application. The first operation could be the operation of clicking the icon of the first application. For example, the first operation could be... Figure 1G The image shows the action of clicking the icon of the Huawei Video application 1013.

[0407] The first action to open the first application can also be other actions, which are not limited here.

[0408] S1302, Electronic device 100 creates the first animation leash object.

[0409] When electronic device 100 receives the user's first operation, it starts playing a startup animation. Before playing the startup animation, electronic device 100 needs to create an animation leash object (e.g., the first animation leash object). Electronic device 100 then performs the startup animation based on the first animation leash object.

[0410] Understandably, the first animation leash object can be a "window" that floats above the user interface of the electronic device 100. The properties of this "window" are preset. Since the parameter information of each image frame in the startup animation can be different, after obtaining the parameter information of each image frame, the electronic device 100 changes the properties of the "window" so that the "window" can display the image frame on the user interface of the electronic device 100 according to the parameter information of each image frame.

[0411] S1303, Electronic device 100 performs startup animation based on the first animation leash object.

[0412] Specifically, the electronic device 100 first needs to obtain the parameter information of the image frame in the startup animation. Then, the electronic device 100 draws the first window according to the first animation leash object. The electronic device 100 changes the properties of the first window according to the parameter information of the image frame in the startup animation. The electronic device 100 synthesizes the image frame according to the parameter information of the image frame. The electronic device 100 displays the image frame in the first window.

[0413] Before the electronic device 100 performs the startup animation based on the first animation leash object, in order to make the animation effect displayed on the screen smoother, the electronic device 100 needs to determine the parameter information of the interpolation algorithm. The parameter information of the interpolation algorithm includes: animation type, elasticity, etc. The animation type can be, for example, a uniform motion effect, a fade-in / fade-out motion effect, an accelerated motion effect, etc. The elasticity coefficient is... Figure 11 The stiffness k described herein. The parameter information of the interpolation algorithm may also include other parameter information, such as the damping coefficient, etc., which are not limited here.

[0414] It is understood that the parameter information of the interpolation algorithm in different applications may be the same or different, and this application does not limit this.

[0415] Specifically, the electronic device 100 first needs to obtain the parameter information of the image frame in the startup animation. Then, the electronic device 100 synthesizes the image frame based on the parameter information of the first animation leash object and the image frame, and sends the image frame to the display for display.

[0416] Electronic device 100 obtains the parameter information of the image frame in the startup animation based on the interpolation algorithm.

[0417] First, the electronic device 100 obtains the initial parameter information of the image frames in the startup animation. This initial parameter information can be understood as the parameter information of the first image frame in the startup animation. The electronic device 100 can then use an interpolation algorithm to obtain the parameter information of the second image frame in the startup animation based on the parameter information of the first image frame, and so on. The electronic device 100 can use the interpolation algorithm to obtain the parameter information of the third image frame in the startup animation based on the parameter information of the second image frame, and so on, until the electronic device 100 uses an interpolation algorithm to obtain the parameter information of the Mth image frame in the startup animation based on the parameter information of the (N-1)th image frame. The startup animation includes M image frames. In other words, the electronic device 100 obtains the parameter information of the next image frame based on the parameter information of the currently displayed image frame using an interpolation algorithm.

[0418] This part has been described in detail in the foregoing embodiments, please refer to the description of the foregoing embodiments, and will not be repeated here.

[0419] After obtaining the parameter information of the image frame in the startup animation, the electronic device 100 synthesizes the image frame based on the first animation leash object and the parameter information of the image frame, and then sends the image frame to the display for display. For details, please refer to... Figures 1A-1M , Figures 2A-2M , Figures 3A-3E The embodiments shown are not described in detail here.

[0420] S1304, the electronic device 100 receives a second operation from the user, the second operation being used to instruct the electronic device 100 to play the exit animation (second animation) of the first application.

[0421] The second operation is to exit the first application. The second operation can be a swipe from the bottom edge of the screen of the electronic device 100 upwards. For example, the second operation could be... Figure 8A The operation shown is a sliding motion perpendicular to the bottom edge of the screen of the electronic device 100 towards the top of the screen. The second operation can be... Figure 9A The operation shown is a sliding motion perpendicular to the bottom edge of the screen of the electronic device 100 towards the upper right of the screen. The second operation can be... Figure 10A The operation shown is a swipe operation perpendicular to the bottom edge of the screen of the electronic device 100 towards the upper left of the screen. The second operation can also be a click operation on the "return to home screen" button among the three buttons. It should be noted that the "return to home screen" button among the three buttons can be a physical button or a virtual button, and this application does not limit it here. The second operation to exit the first application can also be other operations, and this application does not limit it here.

[0422] S1305, Electronic device 100 reuses the first animation leash object to create an exit animation effect.

[0423] Specifically, firstly, the electronic device 100 needs to obtain the parameter information of the image frame in the exit animation. Then, the electronic device 100 draws the second window according to the first animation leash object. The electronic device 100 changes the properties of the first window according to the parameter information of the image frame in the start animation. The electronic device 100 synthesizes the image frame according to the parameter information of the image frame. The electronic device 100 displays the image frame in the second window.

[0424] Electronic device 100 obtains the parameter information of the image frame in the exit animation based on the interpolation algorithm.

[0425] In some embodiments, after the electronic device 100 has finished playing the startup animation and is displaying the main interface of the first application, the electronic device 100 receives a second operation to exit the first application. At this time, the electronic device 100 obtains the initial parameter information of the image frame in the exit animation as the parameter information of the Mth image frame in the startup animation. The Mth image frame in the startup animation is the last image frame in the startup animation.

[0426] First, the electronic device 100 obtains the initial parameter information of the image frames in the exit animation. This initial parameter information is the parameter information of the first image frame in the exit animation. The electronic device 100 can then use an interpolation algorithm to obtain the parameter information of the second image frame in the exit animation based on the parameter information of the first image frame, and so on. This process continues until the electronic device 100 uses an interpolation algorithm to obtain the parameter information of the Nth image frame in the exit animation based on the parameter information of the (N-1)th image frame, and so on, until the electronic device 100 uses an interpolation algorithm to obtain the parameter information of the Mth image frame in the exit animation based on the parameter information of the (M-1)th image frame. The exit animation includes M image frames. In other words, the electronic device 100 obtains the parameter information of the next image frame based on the parameter information of the currently displayed image frame using an interpolation algorithm.

[0427] In other embodiments, during the playback of a startup animation, for example, when the electronic device 100 is currently displaying the Nth frame of the startup animation, the electronic device 100 receives a second operation to exit the first application. At this time, the electronic device 100 obtains the initial parameter information of the exit animation as the parameter information of the Nth frame of the startup animation.

[0428] First, the electronic device 100 obtains the initial parameter information of the image frames in the exit animation. This initial parameter information is the parameter information of the first image frame in the exit animation. The electronic device 100 can then use an interpolation algorithm to obtain the parameter information of the second image frame in the exit animation based on the parameter information of the first image frame, and so on. The electronic device 100 can use the interpolation algorithm to obtain the parameter information of the third image frame in the exit animation based on the parameter information of the second image frame, and so on. The Nth image frame in the start animation is the last image frame in the exit animation. In other words, the electronic device 100 obtains the parameter information of the next image frame based on the parameter information of the currently displayed image frame using an interpolation algorithm.

[0429] This part has been described in detail in the foregoing embodiments, please refer to the description of the foregoing embodiments, and will not be repeated here.

[0430] Electronic device 100 obtains the parameter information of the image frame in the exit animation. Electronic device 100 reuses the first animation leash object from the startup animation. Then, electronic device 100 draws a second window based on the first animation leash object. Electronic device 100 then synthesizes an image frame based on the parameter information of the image frame in the exit animation, and displays the synthesized image frame on the second window. For details, please refer to... Figures 8A-8H , Figures 9A-9F , Figures 10A-10F The embodiments shown are not described in detail here.

[0431] In this way, when the electronic device 100 plays the exit animation, it reuses the first animation leash object created when the electronic device 100 plays the startup animation. On the one hand, this can be understood as the startup animation and the exit animation being a single animation, avoiding unnatural transitions between the two and improving the user experience. On the other hand, the electronic device 100 uses an interpolation algorithm to obtain the parameter information of the next image frame based on the parameter information of the current image frame, and then synthesizes the next image frame based on the parameter information of the next image frame. Thus, the startup and exit animations played by the electronic device 100 are more natural and smooth.

[0432] In some embodiments, the direction of the second operation to exit the first application also affects the effect of the exit animation played by the electronic device 100.

[0433] like Figure 8H As shown, Figure 8H An exemplary illustration shows the movement trajectory of the center point of the image frame in the exit animation when the second operation of exiting the first application is a sliding operation that is perpendicular to the bottom edge of the screen of the electronic device 100 and moves upwards on the screen.

[0434] When the second operation to exit the first application is a swipe operation perpendicular to the bottom edge of the screen of the electronic device 100 towards the upper right of the screen, the movement trajectory of the center point of the image frame in the exit animation shifts to the right side of the electronic device 100. For example... Figure 9F As shown, Figure 9F An example is shown where, during a second operation to exit the first application, a swipe operation perpendicular to the bottom edge of the screen of the electronic device 100 towards the upper right, the trajectory of the center point of the image frame in the exit animation is illustrated. Figure 8H The trajectory of the center point of the image frame shown. Figure 9F The trajectory of the center point of the image frame in the exit animation shown is shifted to the right side of the electronic device 100.

[0435] Specifically, assuming the application's startup animation includes M image frames, for example, electronic device 100 is currently displaying the Nth image frame in the startup animation. Electronic device 100 receives a second operation to exit the first application, and then starts playing the exit animation. First, electronic device 100 needs to obtain the parameter information of the first image frame in the exit animation. As analyzed above, electronic device 100 obtains the parameter information of the first image frame in the exit animation through the parameter information of the Nth image frame in the startup animation. The position information of the Nth image frame can be represented as (x + N*v, y + N*v). Since the second operation is a sliding operation perpendicular to the bottom edge of the screen of electronic device 100 towards the upper right, the horizontal coordinate of the position information of the Nth image frame in the interpolation algorithm input by electronic device 100 will increase. For example, the position information of the Nth image frame in the interpolation algorithm input by electronic device 100 is (x + N*v + x0, y + N*v), where x0 is greater than 0. The position information of the first image frame in the exit animation obtained by electronic device 100 through interpolation algorithm is (x+N*v+x0-v, y+N*vv). Therefore, the first image frame in the exit animation will be offset to the right side of the screen of electronic device 100. In this way, each image frame in the exit animation will be offset to the right side of the screen of electronic device 100.

[0436] When the second operation to exit the first application is a swipe operation perpendicular to the bottom edge of the screen of the electronic device 100 towards the upper left of the screen, the movement trajectory of the center point of the image frame in the exit animation shifts to the left side of the electronic device 100. For example... Figure 10F As shown, Figure 10F An example is shown where, during a second operation to exit the first application, a swipe operation perpendicular to the bottom edge of the screen of the electronic device 100 towards the upper left, the trajectory of the center point of the image frame in the exit animation is illustrated. Figure 8H The trajectory of the center point of the image frame shown. Figure 10F The trajectory of the center point of the image frame in the exit animation shown is shifted to the left of the electronic device 100.

[0437] Specifically, assuming the application's startup animation includes M image frames, for example, electronic device 100 is currently displaying the Nth image frame in the startup animation. Electronic device 100 receives a second operation to exit the first application, and then starts playing the exit animation. First, electronic device 100 needs to obtain the parameter information of the first image frame in the exit animation. As analyzed above, electronic device 100 obtains the parameter information of the first image frame in the exit animation through the parameter information of the Nth image frame in the startup animation. The position information of the Nth image frame can be represented as (x + N*v, y + N*v). Since the second operation is a sliding operation perpendicular to the bottom edge of the screen of electronic device 100 towards the upper left, the horizontal coordinate of the position information of the Nth image frame in the interpolation algorithm input by electronic device 100 will increase. For example, the position information of the Nth image frame in the interpolation algorithm input by electronic device 100 is (x + N*v - x0, y + N*v), where x0 is greater than 0. The position information of the first image frame in the exit animation obtained by electronic device 100 through interpolation algorithm is (x+N*v-x0-v, y+N*vv). Therefore, the first image frame in the exit animation will be offset to the right side of the screen of electronic device 100. Similarly, each image frame in the exit animation will be offset to the left side of the screen of electronic device 100.

[0438] For a detailed explanation of the interpolation algorithm, please refer to the description in the foregoing embodiments; this application will not repeat it here.

[0439] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A method for seamless animation transitions in an application, characterized in that, The method includes: The electronic device receives a first operation from the user, the first operation being used to initiate the playback of a first animation effect of a first application; According to the first operation, the electronic device displays the first image frame in the first animation effect in the first window drawn by the first animation Leash object; The electronic device receives a second operation from the user, the second operation being used to instruct the electronic device to play a second animation effect of the first application; According to the second operation, the electronic device displays the second image frame in the second animation effect in a second window drawn by the first animation Leash object.

2. The method according to claim 1, characterized in that, Before the electronic device displays the first image frame from the first animation effect in the first window drawn by the first animation Leash object, the method further includes: The electronic device synthesizes the first image frame based on the first parameter information of the first image frame in the first animation; Before the electronic device displays the second image frame from the second animation effect in a second window drawn by the first animation Leash object, the method further includes: The electronic device synthesizes the second image frame based on the second parameter information of the second image frame in the second motion effect.

3. The method according to any one of claims 1-2, characterized in that, The electronic device receives a second operation from the user, including: The electronic device receives the second operation while displaying the first image frame.

4. The method according to any one of claims 1-2, characterized in that, Before the electronic device receives the second operation, the method further includes: After the first animation effect finishes playing, the electronic device displays the first user interface of the first application.

5. The method according to claim 1 or 2, characterized in that, The second image frame is the first image frame in the second animation effect; Before the electronic device displays the second image frame from the second animation effect in a second window drawn by the first animation Leash object, the method further includes: The electronic device determines the second parameter information and the attribute information of the second window based on the first parameter information; The electronic device draws the second window based on the attribute information of the second window using the first animation Leash object.

6. The method according to claim 5, characterized in that, The electronic device determines the second parameter information based on the first parameter information, including: The electronic device calculates the second parameter information based on the first parameter information through interpolation.

7. The method according to claim 5, characterized in that, Before the electronic device displays the first image frame from the first animation effect in the first window drawn by the first animation Leash object, the method further includes: The electronic device creates a new motion effect processing thread in the surface flinger; The electronic device determines the second parameter information based on the first parameter information, including: The electronic device determines the second parameter information of the second image frame based on the first parameter information of the first image frame through the motion processing thread.

8. The method according to claim 1 or 2, characterized in that, The first parameter information includes any one or more of the following: the position of the center point of the first image frame, the window size of the first image frame, the transparency of the first image frame, and the rounded corner size of the first image frame; The second parameter information includes any one or more of the following: the position of the center point of the second image frame, the window size of the second image frame, the transparency of the second image frame, and the rounded corner size of the second image frame; The attribute information of the second window includes any one or more of the following: the position of the center point of the second window, the window size of the second window, the transparency of the second window, and the rounded corner size of the second window.

9. An electronic device, characterized in that, The electronic device includes: one or more processors and one or more memories; The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which the one or more processors invoke to cause the electronic device to execute: Receive the user's first operation, the first operation being used to start playing the first animation effect of the first application; According to the first operation, the first image frame in the first animation effect is displayed in the first window drawn by the first animation Leash object; Receive a second operation from the user, the second operation being used to instruct the electronic device to play a second animation effect of the first application; According to the second operation, the second image frame in the second animation effect is displayed in the second window drawn by the first animationLeash object.

10. The electronic device according to claim 9, characterized in that, Before the electronic device displays the first image frame from the first animation in the first window drawn by the first animation Leash object, the one or more processors invoke the computer instructions to cause the electronic device to execute: The first image frame is synthesized based on the first parameter information of the first image frame in the first animation; The second image frame is synthesized based on the second parameter information of the second image frame in the second animation.

11. The electronic device according to any one of claims 9-10, characterized in that, The one or more processors invoke the computer instructions to cause the electronic device to execute: The second operation is received while the first image frame is being displayed.

12. The electronic device according to any one of claims 9-10, characterized in that, Before the electronic device receives the second operation, the one or more processors invoke the computer instructions to cause the electronic device to execute: After the first animation effect finishes playing, the first user interface of the first application is displayed.

13. The electronic device according to claim 11, characterized in that, The second image frame is the first image frame in the second animation effect; Before the electronic device displays the second image frame from the second animation in a second window drawn by the first animation Leash object, the one or more processors invoke the computer instructions to cause the electronic device to execute: Based on the first parameter information, the second parameter information and the attribute information of the second window are determined; The second window is drawn using the first animation Leash object based on the attribute information of the second window.

14. The electronic device according to claim 13, characterized in that, The one or more processors invoke the computer instructions to cause the electronic device to execute: The second parameter information is calculated by interpolation based on the first parameter information.

15. The electronic device according to any one of claims 13-14, characterized in that, Before the electronic device displays the first image frame from the first animation in the first window drawn by the first animation Leash object, the one or more processors invoke the computer instructions to cause the electronic device to execute: Create a new animation processing thread in Surface Flinger; The motion processing thread determines the second parameter information of the second image frame based on the first parameter information of the first image frame.

16. The electronic device according to any one of claims 9-10, characterized in that, The first parameter information includes any one or more of the following: the position of the center point of the first image frame, the window size of the first image frame, the transparency of the first image frame, and the rounded corner size of the first image frame; The second parameter information includes any one or more of the following: the position of the center point of the second image frame, the window size of the second image frame, the transparency of the second image frame, and the rounded corner size of the second image frame; The attribute information of the second window includes any one or more of the following: the position of the center point of the second window, the window size of the second window, the transparency of the second window, and the rounded corner size of the second window.

17. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method according to any one of claims 1 to 8.

18. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Application interface display method and device, intelligent equipment and medium

    CN112882784A

  • Resource scheduling method and electronic device

    WO2021008543A1