Inter-application interaction method, electronic device and storage medium

By parallel rendering of the second application interface when the jump operation is received, the delay problem of electronic devices when jumping between applications is solved, and the user experience is improved.

WO2025153005A1PCT designated stage expired Publication Date: 2025-07-24HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/072680
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-17
Filing Date
2025-01-16
Publication Date
2025-07-24

AI Technical Summary

Technical Problem

After receiving user operations, electronic devices need to wait for a while before playing the switching animation, resulting in low jump efficiency between applications and poor user visual experience.

Method used

When receiving the user operation to jump to the second application, the first application plays the animation, and the second application renders the user interface to be displayed, avoiding waiting for the second application to complete the drawing and rendering, and shortening the animation playback delay in parallel execution.

Benefits of technology

It improves the efficiency of electronic devices jumping between applications, saves users' waiting time, and improves the visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025072680_24072025_PF_FP_ABST
    Figure CN2025072680_24072025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are an inter-application interaction method, an electronic device and a storage medium. A first application and a second application are installed on the electronic device. The method comprises: a first application displaying a first user interface; the first application receiving a first operation for the first user interface; in response to the first operation, rendering a first animation in the first application, and playing the first animation; rendering a second user interface in a second application; determining whether rendering of the second user interface is completed; when the rendering of the second user interface is completed, the first application stopping playing the first animation; and the second application displaying the second user interface. By means of the method, the time delay of playing the first animation by the electronic device is shortened, the problem of the electronic device being slow to respond to a user operation to jump to the second application is solved, the waiting time of a user is reduced, and the visual experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Inter-application interaction method, electronic device, and storage medium

[0001] This application claims priority to the Chinese patent application with application number 202410071114.9 filed with the State Intellectual Property Office of China on January 17, 2024, and priority to the Chinese patent application with the invention name “A method for interaction between applications, an electronic device and a storage medium”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to an inter-application interaction method, an electronic device, and a storage medium. Background Art

[0003] With the development of terminal technology, the number of applications installed on electronic devices is increasing. Users can use the applications installed on electronic devices to take photos / videos, watch movies and TV series, listen to music, make calls, etc., which greatly improves people's user experience.

[0004] In order to better guide users to use other applications installed on the electronic device, the electronic device can receive the user's operation in one application, jump to another application, and display the user interface in the other application. In order to improve the user's visual experience, the electronic device 100 can play a switching animation before jumping to another application. However, at present, after receiving the user's operation, the electronic device 100 needs to wait for a period of time before the electronic device 100 can play the switching animation, which has the problem of slow response. How to improve the efficiency of jumping between applications and reduce the delay of the electronic device 100 playing the switching animation needs further study. Summary of the Invention

[0005] This application provides an inter-application interaction method, electronic device, and storage medium. This method shortens the delay of an electronic device playing a first animation, solves the problem of slow response of the electronic device to a user's operation of jumping to a second application, saves the user's waiting time, and improves the user's visual experience.

[0006] In a first aspect, the present application provides a method for interaction between applications, wherein a first application and a second application are installed on an electronic device, and the method includes: the first application displays a first user interface; the first application receives a first operation for the first user interface; in response to the first operation, the first animation is rendered in the first application and the first animation is played; the second application renders the second user interface; determines whether the rendering of the second user interface is completed; if the rendering of the second user interface is completed, the first application stops playing the first animation; and the second application displays the second user interface.

[0007] Optionally, the first application may be a camera application, and the second application may be a gallery application, that is, a jump from the camera application to the gallery application is achieved.

[0008] Optionally, the first application may be a gallery application, and the second application may be a camera application, so as to implement a jump from the gallery application to the camera application.

[0009] Optionally, rendering the first animation in the first application may refer to the first application rendering the first animation, or may refer to a system function on the electronic device rendering the first animation.

[0010] Optionally, rendering the second user interface in the second application may refer to the second application rendering the second user interface, or may refer to a system function on the electronic device rendering the second user interface.

[0011] With this method, when an electronic device receives a user action to jump to a second application, it can play an animation through the first application while the second application renders the second user interface to be displayed, eliminating the need to wait for the second user interface to be displayed in the second application to be drawn and rendered before playing the first animation. This shortens the delay in the electronic device playing the first animation, solves the problem of the electronic device being slow to respond to user actions to jump to the second application, saves users waiting time, and improves their visual experience.

[0012] In combination with the first aspect, in a possible implementation, the first application plays the first animation and renders the second user interface in parallel.

[0013] That is to say, when the electronic device receives a user operation to jump to the second application, it can play the animation through the first application, and at the same time the second application renders the second user interface to be displayed. It needs to wait until the second user interface to be displayed in the second application is drawn and rendered before playing the first animation.

[0014] In combination with the first aspect, in a possible implementation method, when the rendering of the second user interface is completed, the method also includes: the second application confirms whether the first animation has been played; when it is confirmed that the first animation has not been played, the unplayed animation frames in the first animation are rendered in the second application, and the unplayed animation frames are played; after the second application plays the unplayed animation frames, the second application displays the second user interface; when it is confirmed that the first animation has been played, the second application displays the second user interface.

[0015] Optionally, after the first application stops playing the first animation, the first application may send the playing progress of the first animation to the second application, so that the second application confirms whether to continue playing the first animation.

[0016] When the first animation is finished, the second application does not need to continue playing the first animation and can directly switch to displaying the second user interface. When the second user interface is not finished playing, the second application needs to continue playing the unplayed animation frames in the first animation. After playing the unplayed animation frames in the first animation, the second application switches to displaying the second user interface. In this way, it can be ensured that after the first animation is finished playing, the electronic device switches to displaying the second user interface, and it can ensure a smooth switch from the first animation to displaying the second user interface.

[0017] In conjunction with the first aspect, in one possible implementation, if the second user interface is not completely rendered, the method further includes: the first application confirming whether the first animation has been completed; if the first animation has not been completed, rendering the unplayed animation frames of the first animation in the first application, and playing the unplayed animation frames. If the first animation is completely played, the first application displays a third user interface, the third user interface including the last animation frame of the first animation.

[0018] Optionally, the second application may send the rendering progress of the second user interface to the first application, so that the first application can confirm whether the rendering of the second user interface is complete.

[0019] When the second user interface is rendered, the first application needs to stop playing the first animation. When the second user interface is not rendered, the first application can continue playing the first animation.

[0020] In combination with the first aspect, in a possible implementation manner, the second user interface includes image content of the last animation frame in the first animation.

[0021] Thus, when the first animation has finished playing but the second user interface has not yet been rendered, the electronic device needs to continuously display the last frame of the first animation. Setting the image content of the last frame of the first animation to be the same or similar to the image content of the second user interface can ensure that the electronic device smoothly switches from the last frame of the first animation to displaying the second user interface without screen jumps.

[0022] In combination with the first aspect, in one possible implementation, after the first application receives a first operation on the first user interface, the method also includes: the electronic device confirms whether there is a process of the second application; if it is confirmed that there is no process of the second application, the electronic device creates a process of the second application.

[0023] In this way, on the one hand, when the electronic device needs to use the second application, the electronic device can create the process of the second application, that is, open the second application, ensuring that the electronic device can use the second application normally. Compared with the solution of immediately creating the process of the second application when the electronic device opens the first application, the memory space of the electronic device can be saved and resource waste can be avoided. On the other hand, when the process of the second application has not been created before, when the first application receives the user operation, the electronic device creates the process of the second application. Because the first application also needs to play the first animation, the electronic device can create the process of the second application at the same time without waiting for the electronic device to create the process of the second application before starting to play the first animation. In other words, the first application plays the first animation and the electronic device creates the process of the second application in parallel.

[0024] In combination with the first aspect, in one possible implementation, the first application is a camera application, the first user interface is a shooting preview interface of the camera application, the second application is a gallery application, the first operation is an operation of clicking a thumbnail, and the second user interface includes the original image corresponding to the thumbnail.

[0025] In this way, you can jump from the camera app to the gallery app.

[0026] In combination with the first aspect, in a possible implementation, the first animation is a transition animation from a thumbnail image to an original image.

[0027] In conjunction with the first aspect, in one possible implementation, the second user interface does not include controls in the gallery, so that the image content of the last animation frame in the first animation is guaranteed to be the same or similar to the image content of the second user interface.

[0028] In combination with the first aspect, in one possible implementation, after the second application displays the second user interface, the method also includes: the second application receives a second operation of the user on the second user interface; in response to the second operation, the second application displays a fourth user interface, and the fourth user interface includes the original image corresponding to the thumbnail and controls in the gallery.

[0029] In this way, after the electronic device displays the second user interface, the electronic device can receive a user operation to display a fourth user interface, and the user can edit the original image corresponding to the thumbnail in the fourth user interface.

[0030] In combination with the first aspect, in a possible implementation, after the first application stops playing the first animation, the method further includes: the first application performs any one or more of the following tasks: turning off the camera, releasing the plug-in, stopping streaming, and stopping streaming.

[0031] In this way, the first application destroys the initialization settings only when it is determined that the rendering of the second user interface is completed, which can avoid the occurrence of freezes in the first animation played by the first application due to frame loss.

[0032] In a second aspect, the present application provides an electronic device, which includes a memory and a processor; wherein the memory and the processor are coupled, and the memory is used to store a computer program. When the processor executes and calls the computer program, the electronic device executes an inter-application interaction method provided in any possible implementation of any of the above aspects.

[0033] In a third aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute an inter-application interaction method provided in any possible implementation of any of the above aspects.

[0034] In a fourth aspect, the present application provides a chip system, which includes one or more processors, and the processors are used to call computer instructions to enable an electronic device to execute an inter-application interaction method provided in any possible implementation of any of the above aspects.

[0035] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when run on an electronic device, enables the electronic device to execute an inter-application interaction method provided in any possible implementation of any of the above aspects.

[0036] For the description of the beneficial effects of the second to fifth aspects, reference may be made to the description of the beneficial effects in the first aspect, and this application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] FIG1A-FIG1B show UI diagrams of opening a camera application of electronic device 100;

[0038] FIG2 is a schematic flow chart showing a method for the electronic device 100 to display the user interface shown in FIG1B ;

[0039] FIG3A is a schematic diagram showing a state change process of an activity life cycle of a camera application when the camera application is started;

[0040] FIG3B is a schematic diagram showing the state changes of the activity life cycle of another camera application during the startup process;

[0041] 4A-4F show UI diagrams in which the electronic device 100 receives a user operation to jump to the gallery application, jumps to the gallery application and displays a large image preview interface;

[0042] FIG5 shows a flowchart of a specific implementation method for jumping from a camera application to a gallery application;

[0043] FIG6A shows a schematic diagram of the state change process of the life cycle of the activity of the camera application and the life cycle of the activity of the gallery application in the process of jumping from the camera application to the gallery application;

[0044] FIG6B shows another schematic diagram of the state change process of the life cycle of the activity of the camera application and the life cycle of the activity of the gallery application in the process of jumping from the camera application to the gallery application;

[0045] 7A-7G show UI diagrams in which the electronic device 100 receives a user operation to jump to a camera application, jumps to the camera application, and displays a shooting preview interface;

[0046] FIG8 shows a flowchart of a specific implementation method for jumping from a gallery application to a camera application;

[0047] FIG9 is a schematic diagram showing a process of state changes in the life cycle of the activity of the camera application and the life cycle of the activity of the gallery application in the process of jumping from the gallery application to the camera application;

[0048] FIG10 is a schematic diagram showing a state change process of the activity life cycle of the camera application when the electronic device 100 closes the camera application based on a user operation;

[0049] FIG11 is a schematic diagram of a method flow of an inter-application interaction method provided by the present application;

[0050] FIG12 shows a schematic diagram of the hardware structure of the electronic device 100;

[0051] FIG13 shows a schematic diagram of the software structure of the electronic device 100 . DETAILED DESCRIPTION

[0052] The following is a clear and detailed description of the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0053] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0054] The term "user interface (UI)" in the following embodiments of this application refers to the media interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The commonly used form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of a wearable device.

[0055] First, let me explain the technical terms involved in this application.

[0056] 1. Activity

[0057] An activity is an application component responsible for user interaction. It provides a window for the application to draw its interface, where users can perform various actions such as clicking and swiping. An activity implements a window within the application. An application can contain multiple activities, allowing the application to display multiple windows simultaneously.

[0058] An activity's lifecycle can include multiple stages. The activity's lifecycle spans from creation to destruction. During this process, the activity undergoes different state events. The activity's lifecycle can include, but is not limited to, the following stages: on create(), on start(), on resume(), on pause(), on stop(), and on destroy().

[0059] Among them, on create(), on start(), and on resume() are used when the application is first started or switched from the background to the foreground, and on pause(), on stop(), and on destroy() are used when the application is closed or switched from the foreground to the background.

[0060] Among them, on create() is involved when the application is first opened. For example, when the electronic device 100 receives a user click on the application icon of the application, the electronic device 100 opens the application for the first time, and the electronic device 100 can create and initialize the activity of the application. The activity of the application is in the on create() state, and the activity of the application is used to provide a window to display the main interface of the application. For example, the electronic device 100 can obtain the elements and the layout information of the elements in the main interface of the application from the disk file, and store them in the memory of the application (such as the running memory of the application). The elements and the layout information of the elements are used to draw the main interface of the application. Among them, the elements can be understood as the content that the user can see on the user interface. In one embodiment, the elements can include but are not limited to: text, pictures, widgets, etc. The layout information of the elements can be understood as information such as the position, size and direction of each element on the user interface.

[0061] In some embodiments, when the activity of the application is in the on create() state, the electronic device 100 also needs to initialize the application so that the application can run normally and implement related functions. For example, when the application is a camera application, the initialization settings include but are not limited to: turning on the camera, loading plug-ins, allocating streams, starting streams, etc. Among them, allocating streams can refer to configuring the shooting parameter information of the preview stream, including but not limited to shooting mode, shooting resolution, zoom ratio, picture ratio, etc. Starting streams can refer to the camera capturing images based on the shooting parameter information. After the initialization settings, the camera application can display the shooting preview interface, and can shoot videos or pictures based on the user's operations in the shooting preview interface. Optionally, the camera application also needs to save the shooting parameter information in the running memory of the camera application.

[0062] on start() is involved when the application is first started or switched from the background to the foreground. After the electronic device 100 creates the application's activity, the application's activity switches from the on create() state to the on start() state. When the application's activity is in the on start() state, the electronic device 100 can obtain the elements in the application's user interface and the layout information of the elements, and draw and render the user interface based on the elements and the layout information of the elements in the window provided by the application's activity.

[0063] For example, when the electronic device 100 first opens an application, the electronic device 100 can obtain the elements in the main interface and the layout information of the elements, and draw and render the main interface based on the elements in the main interface and the layout information of the elements in the window provided by the application's activity. For another example, when the electronic device 100 switches from the background to the foreground, the electronic device 100 can obtain the elements in the user interface to be displayed and the layout information of the elements, and draw and render the user interface to be displayed based on the elements in the user interface to be displayed and the layout information of the elements in the window provided by the application's activity. The user interface to be displayed by the application can be the main interface of the application, or it can be a sub-interface of the main interface of the application.

[0064] When the application's activity is in the on start() state, the user interface within the application has not yet been displayed in the foreground.

[0065] on resume() is also involved when the application is first started or switched from the background to the foreground. After the electronic device 100 draws and renders the user interface of the application, the activity of the application switches from the on start() state to the on resume() state. When the activity of the application is in the on resume() state, the electronic device 100 can display the user interface of the application in the foreground. The electronic device 100 can also receive various click operations or sliding operations of the user on elements within the user interface of the application. For example, when the application is a camera application, when the activity of the application is in the on resume() state, the camera application can display a shooting preview interface.

[0066] OnPause() is involved when the application is closed or switched from the foreground to the background. When it is detected that the application is closed or switched from the foreground to the background, the application's activity switches from OnResume() to OnPause(). When the application's activity is in the OnPause() state, the electronic device 100 can grayscale the elements in the user interface currently displayed by the application so that the elements in the user interface no longer respond to various click operations or sliding operations of the user.

[0067] On stop() is involved when the application is closed or switched from the foreground to the background. When it is detected that the application is closed or switched from the foreground to the background, the application's activity switches from on pause() to on stop() state. When the application's activity is in the on stop() state, the electronic device 100 can stop displaying the application's user interface in the foreground. For example, when the application is a camera application, in the on stop() stage, the electronic device 100 needs to stop displaying the shooting preview interface in the foreground.

[0068] In some embodiments, during the on stop() phase, the electronic device 100 also needs to destroy initialization settings to reduce the power consumption of the application. For example, when the application is a camera application, during the on pause() phase, the electronic device 100 needs to turn off the camera, release the plug-in, stop streaming, stop streaming, etc.

[0069] on destroy() is involved when the application is closed. When a user operation to close the application is detected, the application's activity is switched from on stop() to on destroy() state. When the application's activity is in the on destroy() state, the electronic device 100 can destroy the application's activity, so that the electronic device 100 stops displaying the user interface within the application. In some embodiments, in the on destroy() state, the electronic device 100 also needs to delete the application information stored in the application's running memory, close the application's process, and release the application's running memory. The application information includes but is not limited to elements in the user interface and the layout information of the elements.

[0070] In some embodiments, the electronic device 100 can receive a user operation in the first application and jump from the first application to the second application. In order to improve the user's visual experience, the electronic device 100 can play a switching animation before the electronic device 100 jumps to the second application. Before the electronic device 100 plays the switching animation, the electronic device 100 needs to create or obtain the activity of the second application, and draw and render the user interface to be displayed in the second application in the window provided by the activity of the second application. After the user interface to be displayed in the second application is drawn and rendered, the electronic device 100 can play the switching animation. After the electronic device 100 finishes playing the switching animation, the electronic device 100 jumps to the second application again and displays the user interface to be displayed in the second application.

[0071] Based on the above introduction, when the electronic device 100 jumps from the first application to the second application, the activity of the second application needs to go through multiple states such as on create(), on start(), on resume(), or on start(), on resume(). Each state is a time-consuming operation. Therefore, before the electronic device 100 plays the switching animation, the electronic device 100 needs to wait for a period of time. After the electronic device 100 draws and renders the user interface to be displayed in the second application, the electronic device 100 can play the switching animation. During the waiting period, the user feels that the electronic device 100 is slow to respond.

[0072] Based on the above analysis, in order to reduce the delay of the electronic device 100 in playing the switching animation, after the electronic device 100 receives the user operation of jumping from the first application to the second application, the electronic device 100 can immediately respond and play the switching animation. The present application provides an inter-application interaction method, which includes but is not limited to the following steps:

[0073] Step 1: The electronic device 100 displays the first user interface in the first application, receives a user operation performed by the user in the first user interface, and in response to the user operation, the electronic device 100 determines that it is about to jump to the second application.

[0074] For example, the first application may be a camera application, the first user interface may be a shooting preview interface in the camera application, the second application may be a gallery application, and the user operation may be an input operation, such as a single click, on a review control in the shooting preview interface in the camera application. In this way, a jump from the camera application to the gallery application can be achieved.

[0075] For example, the first application may be a gallery application, the first user interface may be a large image preview interface or a large image editing interface in the gallery application, the second application may be a camera application, and the user operation may be an input operation on the image displayed in the gallery application, such as a pull-down operation. In this way, a jump from the gallery application to the camera application can be achieved.

[0076] Step 2: The electronic device 100 draws and renders multiple image frames in the first animation through the first application, and plays the multiple image frames in the first animation.

[0077] Exemplarily, when the first application is a camera application, the camera application may obtain a thumbnail displayed in the playback control, and perform a zoom operation on the thumbnail to obtain multiple image frames in the first animation.

[0078] Exemplarily, when the first application is a gallery application, the camera application may obtain a picture displayed in a large picture preview interface or a large picture editing interface, and perform a zoom operation on the picture to obtain multiple image frames in the first animation.

[0079] Step 3: The electronic device 100 draws and renders the second user interface to be displayed in the second application.

[0080] Optionally, step 3 and step 2 can be performed simultaneously. Alternatively, step 3 can be performed at a time before step 2, or at a time after step 2. Step 4: After the second user interface is drawn and rendered, the electronic device 100 jumps to the second application and displays the second user interface.

[0081] Step 4: The electronic device 100 displays the second user interface within the second application.

[0082] In some embodiments, after the second user interface is drawn and rendered, the second user interface in the second application has not yet been rendered. The electronic device 100 can wait for the first application to finish playing multiple image frames in the first animation, and then switch to displaying the second user interface in the second application.

[0083] In some embodiments, after the second user interface is drawn and rendered, the animation frames in the first animation have not yet been played. The electronic device 100 can use the second application to draw and render the remaining unplayed image frames of the first animation. The remaining unplayed image frames of the first animation can then be continued to play. After the first animation is finished playing, the electronic device 100 displays the second user interface. This allows the electronic device 100 to more naturally jump from the first application to the second application.

[0084] With this method, upon receiving a user operation to jump to a second application, the electronic device 100 can immediately play the first animation, without having to wait for the second user interface to be displayed in the second application to be drawn and rendered before playing the first animation. This shortens the delay in the electronic device 100 playing the first animation, solves the problem of the electronic device 100 being slow to respond to the user operation to jump to the second application, saves the user waiting time, and improves the user's visual experience.

[0085] The first application and the second application are not limited to the camera application and the gallery application. The first application and the second application can also be other applications. This application only uses the first application and the second application as the camera application and the gallery application as an example for illustration, but does not constitute a limitation.

[0086] The application interaction method provided in this application includes, but is not limited to, the following stages: opening a camera application and displaying a shooting preview interface of the camera application, receiving a user operation to jump to a gallery application, playing a first switching animation, jumping to the gallery application and displaying a large image preview interface, receiving a user operation to jump to the camera application, playing a second switching animation, jumping to the camera application and displaying a shooting preview interface, and closing the camera application. In other words, the electronic device 100 can receive a user operation to jump from the camera application to the gallery application, and the electronic device 100 can also receive a user operation to jump from the gallery application to the camera application.

[0087] Next, the above stages are described in detail with reference to the UI diagram and the method flow chart.

[0088] 1. Open the camera app and display the shooting preview interface of the camera app.

[0089] 1A-1B show UI diagrams of the electronic device 100 opening a camera application.

[0090] As shown in Figure 1A, the electronic device 100 can display a desktop, in which a page with application icons is displayed, and the page includes multiple application icons (for example, a settings application icon, an application market application icon, a gallery application icon, a browser application icon, etc.). A page indicator is also displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. A tray area is displayed below the page indicator. Among them, the tray area includes multiple tray icons, for example, a camera application icon, an address book application icon, a phone application icon, and a message application icon. The tray area remains displayed when the page switches. In some embodiments, the above-mentioned page may also include multiple application icons and a page indicator. The page indicator may not be part of the page and may exist separately. The above-mentioned tray icon is also optional, and the embodiments of the present application are not limited to this.

[0091] The electronic device 100 may receive user input (e.g., a single click) on the camera application icon. In response to the input operation, the electronic device 100 may display a user interface as shown in FIG1B . FIG1B is a user interface for a capture and display service provided by the electronic device 100 according to an embodiment of the present application, which may also be referred to as a capture preview interface.

[0092] As shown in FIG. 1B , the preview interface may include a mode bar 101 , a shooting control 102 , a preview window 103 , a review control 104 , a quick function area 105 , and a focus adjustment option 106 .

[0093] The mode bar 101 may include multiple shooting mode options, such as "night scene", "portrait", "photo", "video recording", etc. Different shooting modes can provide users with shooting services with different effects. Users can select any shooting mode from multiple shooting modes to shoot according to different needs. For example, "photo recording" may be the default shooting mode for taking photos. "Video recording" is used to record videos. The "night scene" mode is suitable for shooting scenes with dim light, such as at night. The "portrait" mode is suitable for shooting scenes where the subject is a person. The electronic device 100 can also provide more shooting modes, such as "large aperture", "movie", "professional", etc., which will not be listed here one by one.

[0094] The electronic device 100 can detect user operations on the shooting mode options in the mode bar 101 and change the currently used shooting mode according to the above user operations. The above user operations are, for example, left / right swipe operations. For example, when it is detected that the mode bar 101 is dragged and swiped to the left (left swipe operation) and the float stops at the "Portrait" option, the electronic device 100 can switch to the "Portrait" mode. By default, the electronic device 100 first uses the "Photograph" mode.

[0095] The shooting control 102 is used to trigger taking a picture. The electronic device 100 can detect whether there is a user operation on the shooting control 102, such as a click operation. When a user operation on the shooting control 102 is detected, the electronic device 100 can generate a shooting instruction. The electronic device 100 can obtain the image reported by the camera at the corresponding timestamp according to the shooting instruction, and then save it as a photo. In some embodiments, when the electronic device 100 receives a user operation on the shooting control 102, if the process of the gallery application is not launched, the electronic device 100 can launch the process of the gallery application, so that the electronic device 100 can save the captured pictures or videos in the gallery application.

[0096] The preview window 103 can be used to display the image reported by the camera in real time. In different shooting modes, the electronic device 100 can process the image reported by the camera to improve the image display effect. For example, in "Portrait" mode, the electronic device 100 can blur the background of the image reported by the camera to highlight the portrait. Here, the preview window 103 can display the image processed by the image processing algorithm corresponding to each shooting mode in real time, allowing the user to perceive the shooting effect corresponding to each shooting mode in real time.

[0097] The review control 104 can be used to browse thumbnails of captured photos / videos. When a user operation on the review control 104 is detected, the electronic device 100 can also display the image corresponding to the thumbnail. In some embodiments, when the electronic device 100 receives a user operation on the review control 104, if the process of the gallery application is not launched, the electronic device 100 can launch the process of the gallery application, so that the electronic device 100 can jump to the gallery application to display the image corresponding to the thumbnail.

[0098] The quick function area 105 may include a control 105A for the protagonist recording mode, an AI scene recognition control 105B, a flash control 105C, a color mode control 105D, a setting control 105E, and the like. The control 105A for the protagonist recording mode can be used to trigger the electronic device 100 to identify the protagonist among multiple characters in the preview screen when it is turned on. The AI ​​scene recognition control 105B can be used to trigger the electronic device 100 to identify the shooting scene in the preview screen when it is turned on. The current AI scene recognition control 105B is in the off state. The flash control 105C can be used to trigger the electronic device 100 to turn on or off the flash. The color mode control 105D can be used to trigger the electronic device 100 to use a color filter to process the image captured by the camera. The setting control 105E can be used to set the shooting parameters of the electronic device 100 (for example, image size, image storage format, etc.), turn on the "auto-snap" function of the electronic device 100, and the like.

[0099] The focus adjustment option 106 shows a plurality of zoom ratio options, such as a 0.5x zoom ratio option, a 1x zoom ratio option, a 2.5x zoom ratio option, and a 10x zoom ratio option.

[0100] The current zoom ratio is 1x. The preview window 103 displays an image frame captured by the electronic device 100 at a zoom ratio of 1x.

[0101] FIG. 2 is a flow chart showing a method for the electronic device 100 to display the user interface shown in FIG. 1B .

[0102] S201. In response to a user operation of starting a camera application, the electronic device 100 obtains the activity of the camera application and obtains elements and layout information of the elements in a shooting preview interface.

[0103] Exemplarily, the user operation of opening the camera application may be an input operation on the camera application icon shown in FIG1A , such as a single click.

[0104] In response to the user operation of starting the camera application, the electronic device 100 obtains the activity of the camera application.

[0105] In one possible implementation, if the camera application is launched for the first time, the electronic device 100 needs to create and obtain the camera application activity, obtain the elements and their layout information in the shooting preview interface from a disk file, and save the elements and their layout information in the camera application's running memory.

[0106] In other possible implementations, if the camera application is not being launched for the first time and is already running in the background, the camera application activity already exists. The electronic device 100 does not need to create the camera application activity and can directly access the camera application activity. The electronic device 100 can directly access the elements and their layout information in the shooting preview interface from the camera application's running memory.

[0107] S202: The camera application draws and renders the shooting preview interface based on the elements in the shooting preview interface and the layout information of the elements.

[0108] When the activity of the camera application is in the on start() state, the electronic device 100 may draw and render the shooting preview interface based on the elements in the shooting preview interface and the layout information of the elements.

[0109] S203: The camera application performs initialization settings (opening the camera, loading plug-ins, allocating streams, starting streaming, etc.).

[0110] Optionally, if the camera application is opened for the first time and the activity of the camera application is in the on create() state, the camera application needs to perform initialization settings, or if the camera application is not opened for the first time and the activity of the camera application is in the on start() state, the camera application needs to perform initialization settings so that the camera application can run normally and implement related functions. Exemplarily, the initialization settings include but are not limited to: opening the camera, loading plug-ins, stream allocation, starting the stream, etc. Among them, stream allocation can refer to configuring the shooting parameter information of the preview stream, and the shooting parameter information includes but is not limited to the shooting mode, shooting resolution, zoom ratio, picture ratio, etc.

[0111] Optionally, S202 and S203 may be executed simultaneously, S203 may be executed before S202, or S203 may be executed after S202.

[0112] S204: The camera application displays a shooting preview interface in a window provided by the activity of the camera application.

[0113] After the electronic device 100 finishes drawing and rendering the shooting preview interface, the activity of the camera application can be switched from the on start() state to the on start() state and be in the on resume() state.

[0114] When the activity of the camera application is in the on resume() state, the camera application can display the shooting preview interface in the window provided by the activity of the camera application.

[0115] In some embodiments, the camera application may also receive and respond to user operations in the shooting preview interface, such as operations such as taking a picture or taking a video, and save the captured photos or videos in the gallery application.

[0116] Optionally, when the activity of the camera application is in the on resume() state, the electronic device 100 may also perform other tasks, which is not limited in this application.

[0117] FIG3A is a schematic diagram showing a state change process of an activity life cycle of a camera application when the camera application is started.

[0118] In a possible implementation, if the camera application is started for the first time, the electronic device 100 needs to create and obtain the activity of the camera application.

[0119] In this case, as shown in FIG3A , the electronic device 100 creates and initializes the activity of the camera application, and the activity of the camera application needs to be in the on create() state. When the activity of the camera application is in the on create() state, the electronic device 100 also needs to obtain the elements and the layout information of the elements in the shooting preview interface from the disk file, and save the elements and the layout information of the elements in the shooting preview interface in the running memory of the camera application. The shooting preview interface is the user interface to be displayed by the camera application. For example, the elements in the shooting preview interface can be multiple elements displayed in the user interface shown in FIG1B .

[0120] In some embodiments, when the activity of the camera application is in the on create() state, the electronic device 100 also needs to initialize the camera application so that the camera application can run normally and implement related functions. Exemplarily, the initialization settings include but are not limited to: turning on the camera, loading plug-ins, allocating streams, starting streams, etc. Among them, allocating streams can refer to the shooting parameter information of configuring the preview stream. The shooting parameter information includes but is not limited to the shooting mode, shooting resolution, zoom ratio, picture ratio, etc. The shooting parameter information in Figure 3A can be obtained from a disk file. Starting streams can refer to the camera capturing images based on the shooting parameter information. After the initialization settings, the camera application can display the shooting preview interface and can shoot videos or pictures based on the user's operations in the shooting preview interface. Optionally, the camera application also needs to save the shooting parameter information in the running memory of the camera application.

[0121] After the camera application is initialized, the camera application's activity can switch from the on create() state to the on start() state. While the camera application's activity is in the on start() state, the camera application can draw and render the capture preview interface based on the elements and their layout information.

[0122] After the camera application draws and renders the shooting preview interface, the camera application's activity can switch from the on start() state to the on resume() state. When the camera application's activity is in the on resume() state, the camera application can display the shooting preview interface in the window provided by the camera application's activity.

[0123] In other possible implementations, if the camera application is not started for the first time and is already running in the background, the activity of the camera application already exists, and the electronic device 100 does not need to create the activity of the camera application and can directly obtain the activity of the camera application.

[0124] FIG3B is a schematic diagram showing the state changes of an activity life cycle of another camera application during the startup process of the camera application.

[0125] In this case, as shown in FIG3B , the activity of the camera application has been created and initialized, and the activity of the camera application directly enters the on start() state.

[0126] When the camera application's activity is in the on start() state, the camera application can retrieve the elements and their layout information within the capture preview interface from the camera application's runtime memory. In some embodiments, the camera application also needs to perform initialization settings to ensure normal operation and related functionality. Exemplary initialization settings include, but are not limited to, starting the camera, loading plugins, allocating streams, and starting streams. Stream allocation can refer to configuring the capture parameters for the preview stream. The capture parameter information shown in Figure 3B can be retrieved from the camera application's runtime memory. Capturing parameter information includes, but is not limited to, capture mode, capture resolution, zoom factor, and image ratio. Starting streams can refer to the camera capturing images based on the capture parameter information. After initialization, the camera application can display the capture preview interface and capture videos or images based on user actions within the capture preview interface. Optionally, the camera application can also store the capture parameter information in the camera application's runtime memory.

[0127] When the activity of the camera application is in the on start() state, the camera application may also draw and render the shooting preview interface based on the elements in the shooting preview interface and the layout information of the elements.

[0128] After the camera application draws and renders the shooting preview interface, the camera application's activity can switch from the on start() state to the on resume() state. When the camera application's activity is in the on resume() state, the camera application can display the shooting preview interface in the window provided by the camera application's activity.

[0129] In some embodiments, when the activity of the camera application is in the on resume() state, if the process of the gallery application has not been started, and if the electronic device 100 has not received a user operation acting on the review control 104 or a user operation acting on the shooting control 102, the camera application may not start the process of the gallery application, that is, not open the gallery application. This can save memory space of the electronic device 100. When a user operation acting on the review control 104 or a user operation acting on the shooting control 102 is received, the camera application starts the process of the gallery application again. In this way, when the electronic device 100 needs to use the gallery application, the electronic device 100 can start the process of the gallery application again, that is, open the gallery application, ensuring that the electronic device 100 can use the gallery application normally. Compared with the solution of immediately starting the process of the gallery application when the electronic device 100 opens the camera application, the memory space of the electronic device 100 can be saved and resource waste can be avoided.

[0130] 2. Receive a user operation to jump to the gallery application, play a first switching animation, and jump to the gallery application to display a large image preview interface.

[0131] 4A-4F show UI diagrams in which the electronic device 100 receives a user operation to jump to the gallery application, jumps to the gallery application, and displays a large image preview interface.

[0132] In some embodiments, the electronic device 100 may receive a user operation on the shooting preview interface in the camera application and jump to the gallery application. For example, the user operation may be an input operation on the review control 104 in the shooting preview interface.

[0133] In order to improve the user's visual experience, before the electronic device 100 jumps to the gallery application, the electronic device 100 can play a first switching animation.

[0134] While the electronic device 100 is playing the first switching animation, the electronic device 100 may obtain the activity of the gallery application, and draw and render a large image preview interface to be displayed in the gallery application.

[0135] In this way, playing the first switching animation, drawing and rendering the large image preview interface to be displayed in the gallery application can be executed simultaneously, saving the user waiting time.

[0136] For example, as shown in Figure 4A, the electronic device 100 can receive a user input operation on the replay control 104, such as a single-click operation. In response to the user's input operation, the electronic device 100 can obtain animation elements and animation parameters, and draw and render animation frames based on the animation elements and animation parameters to obtain multiple animation frames in the first switching animation, and play multiple animation frames in the first switching animation.

[0137] For example, as shown in FIG. 4B to FIG. 4E , the electronic device 100 may sequentially play the animation frame 5001 , the animation frame 5002 , the animation frame 5003 , and the animation frame 5004 in the first switching animation.

[0138] As can be seen from animation frames 5001, 5002, 5003, and 5004, the animation frames are obtained by enlarging the thumbnails displayed in the replay control 104. The animation elements that can be obtained by the electronic device 100 can be the thumbnails displayed in the replay control 104, and the animation parameters can be the size of each animation frame, such as the size of animation frame 5001, the size of animation frame 5002, the size of animation frame 5003, and the size of animation frame 5004. The size of animation frame 5001 is smaller than the size of animation frame 5002, the size of animation frame 5002 is smaller than the size of animation frame 5003, and the size of animation frame 5003 is smaller than the size of animation frame 5004.

[0139] After the electronic device 100 finishes playing the first switching animation, the electronic device 100 may switch to displaying a large image preview interface of the gallery application.

[0140] Optionally, the image content of the large image preview interface of the gallery application can be the same as the image content of the last animation frame in the first switching animation. For example, the large image preview interface of the gallery application can also be an interface that displays animation frame 5004, and the large image preview interface does not include one or more editing options. The reason is that when the drawing and rendering of the large image preview interface are completed, the gallery application determines that the first switching animation has also been played. If the moment when the camera application finishes playing the first switching animation, before the moment when the gallery application completes drawing and rendering the large image preview interface, the camera application needs to stay and display the last animation frame in the first switching animation until the large image preview interface is drawn and rendered, and the electronic device 100 switches to displaying the large image preview interface of the gallery application. If the image content of the last animation frame in the first switching animation is significantly different from the image content of the large image preview interface of the gallery application, the user will experience a sudden change in image and a stuck effect, which is a poor user experience. Based on this, the image content of the last frame of the first transition animation can be set to be the same as the image content of the large image preview interface in the gallery application. When the camera application finishes playing the first transition animation and before the gallery application finishes drawing and rendering the large image preview interface, the user will not feel the image switching, thereby improving the user experience. Optional image content includes but is not limited to: image, image size, image transparency, etc.

[0141] Optionally, the large image preview interface in the gallery application includes only an image, such as the image shown in FIG4E , which may be the original image corresponding to the thumbnail displayed in the review control 104 in FIG4A . The large image preview interface in the gallery application does not include one or more editing options, so that the electronic device 100 can naturally switch from the first switching animation to displaying the large image preview interface in the gallery application.

[0142] In some embodiments, after the electronic device 100 displays the large image preview interface in the gallery application, the electronic device 100 may receive a user input operation on the large image preview interface, such as a single click, causing the electronic device 100 to display the large image editing interface in the gallery application. The large image editing interface includes one or more editing options, and the user can perform operations such as editing or sharing the displayed image in the large image editing interface.

[0143] For example, as shown in Figure 4E, the electronic device 100 can receive a user input operation on the large image preview interface, such as a single click. In response to the user input operation, the electronic device 100 can display the user interface 5005 shown in Figure 4F. The user interface 5005 includes a picture 5006. The picture 5006 can be the original picture corresponding to the thumbnail displayed in the review control 104 in Figure 4A.

[0144] As shown in FIG4F , user interface 5005 includes not only image 5006 but also multiple image editing options, such as a return option 5007, a share option 5012, a favorite option 5008, an edit option 5009, a delete option 5010, and a more option 5011. The user can use the return option 5007 to return to the camera application's shooting preview interface. The user can use the share option 5012 to share image 5006 to other applications on electronic device 100 or to other electronic devices. The user can use the favorite option 5008 to save image 5006 to a favorites folder on electronic device 100. The user can use the edit option 5009 to edit image 5006, such as cropping, rotating, adding filters and special effects, etc. The user can use the delete option 5010 to delete image 5006 saved in the gallery application. The user can use the more option 5011 to perform other operations on image 5006.

[0145] It should be noted that Figures 4B-4E only show some animation frames in the first switching animation. The first switching animation can also include more other animation frames. Figures 4B-4E also only show a display style of the first switching animation. The first switching animation can also be other display styles. This application does not limit this.

[0146] FIG5 shows a flowchart of a specific implementation method for jumping from a camera application to a gallery application.

[0147] S501: The camera application receives a user operation on a review control in a shooting preview interface.

[0148] In some embodiments, the camera application can receive user input operations on the review control 104 in the shooting preview interface, such as a single click. In response to the user's input operation, the electronic device 100 can jump from the camera application to the large image preview interface in the gallery application.

[0149] In some embodiments, when the camera application receives the user's operation on the review control in the shooting preview interface, the electronic device 100 also needs to determine whether the process of the gallery application exists. When the process of the gallery application does not exist, that is, the gallery application is not turned on, the electronic device 100 can create a process for the gallery application, ensuring that the electronic device 100 can use the gallery application normally. When the process of the gallery application already exists, for example, when it is running in the background, the electronic device 100 may not need to create a process for the gallery application. In this way, on the one hand, when the electronic device 100 needs to use the gallery application, the electronic device 100 can create a process for the gallery application, that is, turn on the gallery application, ensuring that the electronic device 100 can use the gallery application normally. Compared with the solution of immediately creating the process of the gallery application when the electronic device 100 turns on the camera application, the memory space of the electronic device 100 can be saved and the waste of resources can be avoided. On the other hand, when the process of the gallery application has not been created before, when the camera application receives the user's operation on the review control in the shooting preview interface, the electronic device 100 creates the process of the gallery application. Because the camera application also needs to play the first switching animation, the electronic device 100 can create the process of the gallery application at the same time without waiting for the electronic device 100 to create the process of the gallery application before starting to play the first switching animation. In other words, the camera application plays the first switching animation and the electronic device 100 creates the process of the gallery application in parallel.

[0150] S502: The camera application obtains animation elements and animation parameters of a first switching animation.

[0151] It takes a while for the camera application to jump to the gallery application. In order to improve the user experience during the waiting period, the camera application can play a first switching animation to improve the user's visual experience.

[0152] Before playing the first switching animation, the camera application needs to obtain the animation elements and animation parameters in the first switching animation, and draw and render multiple animation frames based on the animation elements and animation parameters in the first switching animation.

[0153] Animation elements may refer to image content in an animation frame, and animation parameters may include but are not limited to information such as size, transparency, position, etc. of the animation frame. For example, the animation element may be a thumbnail displayed in the review control 104 shown in FIG4A .

[0154] In one possible implementation, the electronic device 100 pre-stores the animation elements and animation parameters corresponding to each frame of the first switching animation, and the camera application can directly obtain the animation elements and animation parameters corresponding to each frame of the first switching animation from the electronic device 100.

[0155] In other possible implementations, the camera application may also calculate the animation parameters corresponding to each animation frame in the first switching animation in real time based on the duration of the first switching animation. Optionally, the first switching animation may include a preset duration, such as 300ms, and the camera application may determine the number of animation frames included in the first switching animation based on the display duration of each animation frame. For example, if the display duration of each animation frame is 50ms, the first switching animation includes 6 animation frames. Based on the animation parameters of the initial animation frame in the first switching animation, the animation parameters of the termination animation frame in the first switching animation, and the number of animation frames, the animation parameters corresponding to each animation frame in the first switching animation are determined.

[0156] Optionally, the animation elements in different animation frames may be the same or different, and this application does not impose any limitation on this.

[0157] S503: The camera application sends the animation elements and animation parameters of the first switching animation to the gallery application.

[0158] After obtaining the animation elements and animation parameters in the first switching animation, the camera application also needs to send the animation elements and animation parameters in the first switching animation to the gallery application. This allows the gallery application to draw and render the unplayed animation frames based on the animation elements and animation parameters in the first switching animation after the electronic device 100 jumps to the gallery application. This ensures that the electronic device 100 can play the first switching animation to its full length, achieving a smooth and natural transition from the first switching animation to the large image preview interface of the gallery application.

[0159] Optionally, S503 may also be executed before, after, or simultaneously with any step before S511.

[0160] S504: The camera application draws and renders multiple animation frames in the first switching animation based on the animation elements and animation parameters.

[0161] S505: The camera application plays multiple animation frames in the first switching animation.

[0162] After acquiring the animation elements and animation parameters in the first switching animation, the camera application may draw and render multiple animation frames in the first switching animation based on the animation elements and animation parameters, and play the multiple animation frames in the first switching animation.

[0163] Exemplarily, the multiple animation frames in the first switching animation may be animation frame 5001 , animation frame 5002 , animation frame 5003 , and animation frame 5004 as shown in FIG. 4B to FIG. 4E .

[0164] In some embodiments, in response to the user's operation on the review control in the shooting preview interface, the electronic device 100 determines that the current user operation is a user operation to jump to the gallery application. The electronic device 100 may determine that the camera application is running in the background and the gallery application is running in the foreground. Based on the principle that the foreground operation priority is higher than the background operation priority, the electronic device 100 may lower the CPU scheduling priority of the camera application. After the CPU scheduling priority of the camera application is lowered, the camera application may not be able to draw and render multiple animation frames in the first switching animation in time, resulting in frame loss. In order to ensure that the camera application draws and renders multiple animation frames in the first switching animation normally without frame loss, that is, to ensure that the CPU scheduling priority of the camera application is not reduced, the camera application can be bound to the on create() state callback of the activity of the gallery application or the on start() state callback of the activity of the gallery application. Because the on create() status callback of the activity of the gallery application or the on start() status callback of the activity of the gallery application is in the foreground running state, the specific service in the camera application is bound to the on create() status callback of the activity of the gallery application or the on start() status callback of the activity of the gallery application, so that the electronic device 100 believes that the camera application is also running in the foreground, ensuring that the CPU scheduling priority of the camera application is not reduced.

[0165] Optionally, the specific service may be an empty service, which is used when the camera application jumps to the gallery application.

[0166] S506: The gallery application obtains the elements and element layout information in the large image preview interface, and draws and renders the large image preview interface based on the elements and element layout information in the large image preview interface.

[0167] Optionally, S506 may be executed in parallel with S504 and S505, or S506 may be executed at a time before S504, or at a time after S504, which is not limited in this application.

[0168] Through this method, after detecting the user operation of jumping to the gallery application, the electronic device 100 can simultaneously play the first switching animation and draw and render the large image preview interface to be displayed by the gallery application. There is no need to wait for the large image preview interface to be displayed by the gallery application to be drawn and rendered before starting to play the first switching animation. This shortens the delay of the electronic device 100 in playing the first switching animation, solves the problem of the electronic device 100 responding slowly to the user operation of jumping to the gallery application, saves the user's waiting time, and improves the user's visual experience.

[0169] In response to the user's operation on the review control in the shooting preview interface, the gallery application can obtain the elements and element layout information in the large image preview interface, and draw and render the large image preview interface based on the elements and element layout information in the large image preview interface.

[0170] In one possible implementation, if the gallery application is launched for the first time, the electronic device 100 needs to create and obtain the gallery application activity, obtain the elements and their layout information in the large image preview interface from a disk file, and save the elements and their layout information in the capture preview interface in the gallery application's runtime memory.

[0171] In other possible implementations, if the gallery application is not being launched for the first time and is already running in the background, the gallery application activity already exists. Electronic device 100 does not need to create the gallery application activity and can directly access the gallery application activity. The gallery application can directly access the elements and their layout information in the large image preview interface from the gallery application's running memory.

[0172] S507 : The gallery application sends the drawing and rendering progress of the large image preview interface to the camera application.

[0173] Optionally, the large image preview interface drawing and rendering progress may be a large image preview interface drawing and rendering completion message. After the gallery application completes drawing and rendering the large image preview interface, the gallery application sends the large image preview interface drawing and rendering completion message to the camera application.

[0174] Optionally, the large image preview interface drawing and rendering progress carries a message indicating whether the large image preview interface drawing and rendering is completed or not. S507 may be executed irregularly / periodically / at intervals of a certain length, or after the large image preview interface drawing and rendering is completed.

[0175] S508: The camera application needs to confirm whether the large image preview interface is drawn and rendered.

[0176] During the process of the camera application playing the first switching animation, the camera application needs to confirm whether the large image preview interface in the gallery application is drawn and rendered.

[0177] Optionally, the camera application may determine whether the drawing and rendering of the large image preview interface are completed based on the drawing and rendering progress of the large image preview interface sent by the gallery application.

[0178] When the large image preview interface drawing and rendering progress can be a large image preview interface drawing and rendering completion message, if the camera application has not received the large image preview interface drawing and rendering progress sent by the gallery application, the camera application can confirm that the large image preview interface has not been drawn and rendered. If the camera application receives the large image preview interface drawing and rendering progress sent by the gallery application, the camera application can confirm that the large image preview interface has been drawn and rendered.

[0179] When the large image preview interface drawing and rendering progress contains a message indicating that the large image preview interface drawing and rendering is complete or incomplete, after receiving the large image preview interface drawing and rendering progress, the camera application can determine that the gallery application has completed drawing and rendering the large image preview interface based on the message indicating that the large image preview interface drawing and rendering is complete contained in the large image preview interface drawing and rendering progress.

[0180] After the large image preview interface in the camera application is drawn and rendered, the camera application needs to stop drawing and playing the first switching animation.

[0181] When the large image preview interface in the camera application is not drawn and rendered, the camera application can continue to play the first switching animation until the large image preview interface in the camera application is drawn and rendered, and the camera application stops drawing and playing the first switching animation.

[0182] When it is confirmed that the drawing and rendering of the large image preview interface are completed, the camera application executes S511.

[0183] When it is confirmed that the large image preview interface has not been drawn and rendered, the camera application executes S509.

[0184] S509: The camera application needs to confirm whether the first switching animation has been played.

[0185] When the camera application confirms that the large image preview interface has not been drawn and rendered, the camera application needs to confirm whether the first switching animation has been played, and determine whether to continue playing the first switching animation or display the last animation frame in the first switching animation.

[0186] When it is confirmed that the large image preview interface has not been drawn and rendered, and the first switching animation has not been played, the camera application needs to continue drawing and rendering the animation frames that have not been played in the first switching animation, and play the animation frames that have not been played in the first switching animation. The camera application executes S504 and S505.

[0187] When it is confirmed that the large image preview interface has not been drawn and rendered, but the first switching animation has been played, the camera application needs to display the last animation frame in the first switching animation, that is, the camera application executes S510.

[0188] S510: The camera application displays the last animation frame in the first switching animation.

[0189] Exemplarily, the last animation frame in the first switching animation may be the animation frame 5004 shown in FIG. 4E .

[0190] S511: The camera application sends the playback progress of the first switching animation to the gallery application.

[0191] S512: The gallery application needs to confirm whether the first switching animation has been played.

[0192] When it is determined that the drawing and rendering of the large image preview interface are completed, the camera application stops playing the animation frames in the first switching animation and sends the playing progress of the first switching animation to the gallery application.

[0193] The playback progress of the first switching animation may refer to the camera application having played the mth animation frame in the first switching animation, where the first switching animation includes n animation frames, and m is less than or equal to n.

[0194] After receiving the playback progress of the first switching animation sent by the camera application, the gallery application needs to confirm whether the first switching animation has been played.

[0195] When m is equal to n, it indicates that the camera application has finished playing the first switching animation, and S515 is executed.

[0196] When m is less than n, it means that the camera application has not finished playing the first switching animation, and the (m+1)th frame animation frame to the nth frame animation frame in the first switching animation have not been played. The gallery application continues to play the (m+1)th frame animation frame to the nth frame animation frame in the first switching animation and executes S513.

[0197] In some embodiments, when it is determined that the drawing and rendering of the large image preview interface in the gallery application are completed, in addition to stopping the drawing and playing the first switching animation, the camera application also needs to destroy the initialization settings, such as turning off the camera, releasing the plug-in, stopping the flow distribution, stopping the flow, etc., to save power consumption of the electronic device 100.

[0198] The camera app needs to seize CPU resources to destroy the initialization settings. If the camera app destroys the initialization settings while drawing and playing the first transition animation, it may not be able to allocate CPU resources to draw and render the animation frames in time, resulting in frame drops and lag. With this method, the camera app only destroys the initialization settings after determining that the drawing and rendering of the large image preview interface in the gallery app are complete, thus avoiding lags caused by frame drops when the camera app plays the first transition animation.

[0199] S513: The gallery application draws and renders the unplayed animation frames in the first switching animation.

[0200] S514: The gallery application plays the unplayed animation frames in the first switching animation.

[0201] When it is determined that the first switching animation has not been completed, the gallery application can draw and render the unplayed animation frames in the first switching animation based on the obtained animation elements and animation parameters of the unplayed animation frames, and play the unplayed animation frames in the first switching animation.

[0202] For example, if the camera app finishes playing animation frame 5002 shown in FIG4C and the large image preview interface is drawn and rendered, the camera app will not be able to play animation frame 5003 shown in FIG4D and animation frame 5004 shown in FIG4E . If animation frames 5003 and 5004 are not played and the large image preview interface of the gallery app is directly switched to, the user will visually experience a jump from animation frame 5002 to a large image preview interface similar to that shown in FIG4E . The image content of animation frame 5002 and the large image preview interface are significantly different, giving the user an unnatural effect of image content jump and switching.

[0203] To avoid this, the camera app cannot play the remaining animation frames even after the drawing and rendering of the large image preview interface is complete but the first transition animation has not yet finished playing. To ensure that the remaining animation frames of the first transition animation can be played, allowing a natural and smooth transition from the first transition animation to the large image preview interface in the gallery app, the gallery app can continue to draw and play the remaining animation frames, ensuring a natural and smooth transition from the camera app to the gallery app and display of the large image preview interface in the gallery app.

[0204] For example, the gallery application can obtain the animation elements and animation parameters of the (m+1)th animation frame to the nth animation frame in the first switching animation, draw and render the (m+1)th animation frame to the nth animation frame in the first switching animation, and play the (m+1)th animation frame to the nth animation frame in the first switching animation.

[0205] For example, m can be 2 and n can be 4. In this case, animation frame 5001 shown in FIG. 4B and animation frame 5002 shown in FIG. 4C are drawn and played by the camera application. Animation frame 5003 shown in FIG. 4D and animation frame 5004 shown in FIG. 4E are drawn and played by the gallery application. This ensures a smooth transition from the camera application to the gallery application and displays the large image preview interface in the gallery application.

[0206] S515. The gallery application displays a large image preview interface of the gallery application.

[0207] When it is determined that the first switching animation has been played, the animation frame 5001 shown in Figure 4B, the animation frame 5002 shown in Figure 4C, the animation frame 5003 shown in Figure 4D, and the animation frame 5004 shown in Figure 4E are all drawn and played by the camera application, and the gallery application can directly display the large image preview interface of the gallery application. For example, the gallery application can display a user interface similar to that shown in Figure 4E. In this case, the moment when the camera application finishes playing the first switching animation can be the same as the moment when the gallery application finishes drawing and rendering the large image preview interface. The moment when the camera application finishes playing the first switching animation can also be before the moment when the gallery application finishes drawing and rendering the large image preview interface.

[0208] In S512, after the gallery application finishes playing the unplayed animation frames in the first switching animation, that is, after playing the (m+1)th frame to the nth frame in the first switching animation, the gallery application may display the large image preview interface of the gallery application. For example, the gallery application may display a user interface similar to that shown in FIG4E. In this case, the moment when the camera application finishes playing the first switching animation is after the moment when the gallery application completes drawing and rendering the large image preview interface.

[0209] Optionally, the image content of the large image preview interface of the gallery application can be the same as the image content of the last animation frame in the first switching animation. For example, the large image preview interface of the gallery application can also be an interface that displays animation frame 5004, and the large image preview interface does not include one or more editing options. The reason is that when the drawing and rendering of the large image preview interface are completed, the gallery application determines that the first switching animation has also been played. If the moment when the camera application finishes playing the first switching animation, before the moment when the gallery application completes drawing and rendering the large image preview interface, the camera application needs to stay and display the last animation frame in the first switching animation until the large image preview interface is drawn and rendered, and the electronic device 100 switches to displaying the large image preview interface of the gallery application. If the image content of the last animation frame in the first switching animation is significantly different from the image content of the large image preview interface of the gallery application, the user will experience a sudden change in image and a stuck effect, which is a poor user experience. Based on this, the image content of the last frame of the first transition animation can be set to be the same as the image content of the large image preview interface in the gallery application. When the camera application finishes playing the first transition animation and before the gallery application finishes drawing and rendering the large image preview interface, the user will not feel the image switching, thereby improving the user experience. Optional image content includes but is not limited to: image, image size, image transparency, etc.

[0210] Optionally, the large image preview interface in the gallery application includes only an image, such as the image shown in FIG4E , which may be the original image corresponding to the thumbnail displayed in the review control 104 in FIG4A . The large image preview interface in the gallery application does not include one or more editing options, so that the electronic device 100 can naturally switch from the first switching animation to displaying the large image preview interface in the gallery application.

[0211] In some embodiments, after the electronic device 100 displays the large image preview interface in the gallery application, the electronic device 100 may receive a user input operation on the large image preview interface, such as a single click, causing the electronic device 100 to display the large image editing interface in the gallery application. The large image editing interface includes one or more editing options, and the user can perform operations such as editing or sharing the displayed image in the large image editing interface.

[0212] For example, as shown in Figure 4E, the electronic device 100 can receive a user input operation on the large image preview interface, such as a single click. In response to the user input operation, the electronic device 100 can display the user interface 5005 shown in Figure 4F. The user interface 5005 includes a picture 5006. The picture 5006 can be the original picture corresponding to the thumbnail displayed in the review control 104 in Figure 4A.

[0213] As shown in FIG4F , user interface 5005 includes not only image 5006 but also multiple image editing options, such as a return option 5007, a share option 5012, a favorite option 5008, an edit option 5009, a delete option 5010, and a more option 5011. The user can use the return option 5007 to return to the camera application's shooting preview interface. The user can use the share option 5012 to share image 5006 to other applications on electronic device 100 or to other electronic devices. The user can use the favorite option 5008 to save image 5006 to a favorites folder on electronic device 100. The user can use the edit option 5009 to edit image 5006, such as cropping, rotating, adding filters and special effects, etc. The user can use the delete option 5010 to delete image 5006 saved in the gallery application. The user can use the more option 5011 to perform other operations on image 5006.

[0214] FIG6A shows a schematic diagram of the state change process of the life cycle of the activity of the camera application and the life cycle of the activity of the gallery application during the process of jumping from the camera application to the gallery application.

[0215] In a possible implementation, if the gallery application is not yet opened when the camera application jumps to the gallery application, the electronic device 100 needs to create and obtain the activity of the gallery application.

[0216] In this case, as shown in FIG3A , in response to a user input operation on the review control in the shooting preview interface, such as a single click, the electronic device 100 creates and initializes the activity of the gallery application, and the activity of the gallery application needs to be in the on create() state. When the activity of the gallery application is in the on create() state, the gallery application also needs to obtain the elements and the layout information of the elements in the large image preview interface from the disk file, and save the elements and the layout information of the elements in the large image preview interface in the running memory of the gallery application. The large image preview interface is the user interface to be displayed by the gallery application, such as the user interface 5005 shown in FIG4F . Exemplarily, the elements in the large image preview interface can be multiple elements displayed in the user interface 5005 shown in FIG4F .

[0217] When the activity of the gallery application is in the on create() state, the gallery application also needs to perform initialization settings so that the gallery application can run normally and implement related functions, such as loading the rendering library, querying the database, loading plug-ins, and other operations.

[0218] After the camera application completes initialization, the gallery application's activity can switch from the on create() state to the on start() state. While the gallery application's activity is in the on start() state, the gallery application can draw and render the large image preview interface based on the elements and their layout information in the large image preview interface.

[0219] Optionally, when the activity of the gallery application is in the on start() state, the gallery application also needs to send the large image preview interface drawing and rendering progress to the camera application. In one possible implementation, the large image preview interface drawing and rendering progress can be a large image preview interface drawing and rendering completion message. After the gallery application completes the drawing and rendering of the large image preview interface, the gallery application sends a large image preview interface drawing and rendering completion message to the camera application. In other possible implementations, the large image preview interface drawing and rendering progress carries a large image preview interface drawing and rendering completion or incomplete message. The large image preview interface drawing and rendering progress can be sent to the camera application irregularly / periodically / at certain intervals.

[0220] In the present application, in response to the user's input operation on the review control in the shooting preview interface, such as a single click, the activity of the camera application needs to enter the on pause() state from the on resume() state. When the activity of the camera application is in the on pause() state, the camera application needs to grayscale the shooting preview interface so that the camera application no longer responds to the user's various click operations, sliding operations, etc. on the shooting preview interface. The camera application also needs to draw and play the first switching animation, waiting for the gallery application to complete the drawing and rendering of the large picture preview interface. The activity of the camera application needs to be continuously in the on pause() state until the gallery application completes the drawing and rendering of the large picture preview interface. The activity of the camera application will enter the next state.

[0221] Optionally, when the activity of the camera application is in the on pause() state, the camera application can bind a specific service in the camera application to the on create() state callback of the activity of the gallery application. Because the on create() state callback of the activity of the gallery application is in the foreground running state, binding the specific service in the camera application to the on create() state callback of the activity of the gallery application makes the electronic device 100 believe that the camera application is also running in the foreground, ensuring that the CPU scheduling priority of the camera application is not reduced. This allows the camera application to draw and render multiple animation frames in the first switching animation in a timely manner, avoiding frame loss and lag.

[0222] Optionally, when the activity of the camera application is in the on pause() state, the camera application may also perform other operations, which are not limited in this application.

[0223] Step 5 and step 3 shown in FIG6A can be executed simultaneously, or step 5 can be executed before step 3. Step 5 does not need to wait until step 3 is completed before being executed.

[0224] In Figure 6A , after the gallery application draws and renders a large image preview interface, the camera application's activity can switch from the on pause() state to the on stop() state. While the camera application's activity is in the on stop() state, the camera application must destroy initialization settings, such as turning off the camera, releasing plugins, stopping streaming, and stopping streaming, to conserve power consumption of the electronic device 100.

[0225] After determining that the large image preview interface is drawn and rendered, the camera application may send the first switching animation playback progress to the gallery application, so that the gallery application confirms whether to continue playing the first switching animation.

[0226] Optionally, when the activity of the camera application is in the on stop() state, if the first switching animation has not finished playing, the gallery application also needs to stop playing the first switching animation.

[0227] When the camera application's activity is in the on stop() state, the camera application's shooting preview interface is invisible.

[0228] Optionally, after the gallery application completes drawing and rendering the large image preview interface, if the first switching animation has not yet been completed, after the camera application stops playing the first switching animation, in order to naturally and smoothly switch to displaying the large image preview interface of the gallery application, the gallery application needs to continue drawing and playing the unplayed animation frames until the first switching animation is completed, and the activity of the gallery application is switched to the on resume() state, and the gallery application then displays the large image preview interface in the window provided by the activity of the gallery application, for example, displaying a user interface similar to that shown in Figure 4E.

[0229] In Figure 6A , after the gallery application draws and renders the large image preview interface and the first transition animation is played, the gallery application's activity can switch from the on start() state to the on resume() state, without continuing to play the first transition animation. While the gallery application's activity is in the on resume() state, the gallery application can display the large image preview interface in the window provided by the gallery application's activity, for example, displaying a user interface similar to that shown in Figure 4E .

[0230] It should be noted that the step numbers in FIG6A do not represent the execution order of the steps, and this application does not limit the execution order of the steps in FIG6A.

[0231] FIG6B shows another schematic diagram of the state change process of the life cycle of the activity of the camera application and the life cycle of the activity of the gallery application during the process of jumping from the camera application to the gallery application.

[0232] In a possible implementation, if the gallery application is already opened when the camera application jumps to the gallery application, the electronic device 100 does not need to create an activity of the gallery application and directly obtains the activity of the gallery application.

[0233] In this case, as shown in FIG6B , in response to the user's input operation on the review control in the shooting preview interface, such as a single click, the activity of the gallery application needs to be in the on start() state. The activity of the gallery application enters the on start() state again from the on stop() state. When the activity of the gallery application is in the on start() state, the gallery application can obtain the elements and the layout information of the elements in the large image preview interface from the running memory of the gallery application. The large image preview interface is the user interface to be displayed by the gallery application, such as the user interface 5005 shown in FIG4F . Exemplarily, the elements in the large image preview interface can be multiple elements displayed in the user interface 5005 shown in FIG4F .

[0234] When the activity of the gallery application is in the on start() state, the gallery application also needs to perform initialization settings so that the gallery application can run normally and implement related functions, such as loading the rendering library, querying the database, loading plug-ins, and other operations.

[0235] When the activity of the gallery application is in the on start() state, the gallery application can draw and render the large image preview interface based on the elements and the layout information of the elements in the large image preview interface.

[0236] Optionally, when the activity of the gallery application is in the on start() state, the gallery application also needs to send the large image preview interface drawing and rendering progress to the camera application. In one possible implementation, the large image preview interface drawing and rendering progress can be a large image preview interface drawing and rendering completion message. After the gallery application completes the drawing and rendering of the large image preview interface, the gallery application sends a large image preview interface drawing and rendering completion message to the camera application. In other possible implementations, the large image preview interface drawing and rendering progress carries a large image preview interface drawing and rendering completion or incomplete message. The large image preview interface drawing and rendering progress can be sent to the camera application irregularly / periodically / at certain intervals.

[0237] In the present application, in response to the user's input operation on the review control in the shooting preview interface, such as a single click, the activity of the camera application needs to enter the on pause() state from the on resume() state. When the activity of the camera application is in the on pause() state, the camera application needs to grayscale the shooting preview interface so that the camera application no longer responds to the user's various click operations, sliding operations, etc. on the shooting preview interface. The camera application also needs to draw and play the first switching animation, waiting for the gallery application to complete the drawing and rendering of the large picture preview interface. The activity of the camera application needs to be continuously in the on pause() state until the gallery application completes the drawing and rendering of the large picture preview interface. The activity of the camera application will enter the next state.

[0238] Optionally, when the activity of the camera application is in the on pause() state, the camera application can bind a specific service in the camera application to the on create() state callback of the activity of the gallery application. Because the on create() state callback of the activity of the gallery application is in the foreground running state, binding the specific service in the camera application to the on create() state callback of the activity of the gallery application makes the electronic device 100 believe that the camera application is also running in the foreground, ensuring that the CPU scheduling priority of the camera application is not reduced. This allows the camera application to draw and render multiple animation frames in the first switching animation in a timely manner, avoiding frame loss and lag.

[0239] Optionally, when the activity of the camera application is in the on pause() state, the camera application may also perform other operations, which are not limited in this application.

[0240] Step 5 and step 3 shown in FIG6B may be executed simultaneously, or step 5 may be executed before step 3. Step 5 does not need to wait until step 3 is completed before being executed.

[0241] In Figure 6B , after the gallery application draws and renders the large image preview interface, the camera application's activity can switch from the on pause() state to the on stop() state. While the camera application's activity is in the on stop() state, the camera application must destroy initialization settings, such as turning off the camera, releasing plugins, stopping streaming, and stopping streaming, to conserve power consumption of the electronic device 100.

[0242] After determining that the large image preview interface is drawn and rendered, the camera application may send the first switching animation playback progress to the gallery application, so that the gallery application confirms whether to continue playing the first switching animation.

[0243] Optionally, when the activity of the camera application is in the on stop() state, if the first switching animation has not finished playing, the camera application also needs to stop playing the first switching animation.

[0244] When the camera application's activity is in the on stop() state, the camera application's shooting preview interface is invisible.

[0245] Optionally, after the gallery application completes drawing and rendering the large image preview interface, if the first switching animation has not yet been completed, after the camera application stops playing the first switching animation, in order to naturally and smoothly switch to displaying the large image preview interface of the gallery application, the gallery application needs to continue drawing and playing the unplayed animation frames until the first switching animation is completed, and the activity of the gallery application is switched to the on resume() state, and the gallery application then displays the large image preview interface in the window provided by the activity of the gallery application, for example, displaying a user interface similar to that shown in Figure 4E.

[0246] In Figure 6B , after the gallery application draws and renders the large image preview interface and the first transition animation is played, the gallery application's activity can switch from the on start() state to the on resume() state. While the gallery application's activity is in the on resume() state, the gallery application can display the large image preview interface in the window provided by the gallery application's activity, for example, displaying a user interface similar to that shown in Figure 4E .

[0247] It should be noted that the step numbers in FIG6B do not represent the execution order of the steps, and this application does not limit the execution order of the steps in FIG6B.

[0248] 3. Receive a user operation to jump from the gallery application to the camera application, play the second switching animation, jump to the camera application and display the shooting preview interface.

[0249] In some embodiments, after jumping from the camera application to the gallery application and displaying the large image preview interface in the gallery application, the electronic device 100 can receive a user operation to jump from the gallery application to the camera application.

[0250] 7A-7G show UI diagrams in which the electronic device 100 receives a user operation to jump to a camera application, jumps to the camera application, and displays a shooting preview interface.

[0251] In some embodiments, the electronic device 100 can receive a user operation on the large image editing interface in the gallery application and jump to the camera application. For example, the user operation can be a long press and swipe operation on the image displayed in the large image editing interface, or an input operation on the return option in the large image editing interface, such as a single click.

[0252] Similar to the principle of the camera application jumping to the gallery application, before the gallery application jumps to the camera application, it needs to wait for the camera application's activity to be launched. The camera application's activity needs to go through multiple states such as on start() and on resume(). Each state is a time-consuming operation. In order to improve the user's visual experience and reduce the user's waiting time, the electronic device 100 can play a second switching animation before jumping to the camera application.

[0253] While the electronic device 100 is playing the second switching animation, the electronic device 100 may obtain the activity of the camera application, and draw and render the shooting preview interface to be displayed in the camera application.

[0254] In this way, playing the second switching animation, drawing and rendering the shooting preview interface to be displayed in the camera application can be executed simultaneously, saving the user waiting time.

[0255] For example, as shown in Figure 7A, the electronic device 100 can receive a user input operation for the return option 5007, such as a single-click operation. In response to the user's input operation, the electronic device 100 can obtain animation elements and animation parameters, and draw and render animation frames based on the animation elements and animation parameters to obtain multiple animation frames in the second switching animation, and play multiple animation frames in the second switching animation.

[0256] For example, as shown in Figure 7B, the electronic device 100 can also receive user input operations on the picture 5006 in the user interface 5005, such as a long press and slide operation. In response to the user's input operation, the electronic device 100 can obtain animation elements and animation parameters, and draw and render animation frames based on the animation elements and animation parameters to obtain multiple animation frames in the second switching animation, and play multiple animation frames in the second switching animation.

[0257] For example, as shown in FIG. 7C to FIG. 7F , the electronic device 100 may sequentially play the animation frame 7001 , the animation frame 7002 , the animation frame 7003 , and the animation frame 7004 in the second switching animation.

[0258] As can be seen from animation frames 7001, 7002, 7003, and 7004, the animation frames are obtained by reducing the size of image 5006 in user interface 5005. The animation element that can be obtained by electronic device 100 can be image 5006 in user interface 5005, and the animation parameters can be the size of each animation frame, such as the size of animation frame 7001, the size of animation frame 7002, the size of animation frame 7003, and the size of animation frame 7004. The size of animation frame 7001 is larger than the size of animation frame 7002, the size of animation frame 7002 is larger than the size of animation frame 7003, and the size of animation frame 7003 is larger than the size of animation frame 7004.

[0259] After the electronic device 100 plays the second switching animation, the electronic device 100 may switch to displaying the shooting preview interface of the camera application. For example, the electronic device 100 may display the user interface 7005 shown in FIG7G . A preview image is displayed on the user interface 7005, which may also be referred to as the shooting preview interface of the camera application. The user interface 7005 is similar to the user interface shown in FIG1B . The user can select a shooting mode in the user interface 7005, take a photo or a video, select a shooting function in the quick function area 105, adjust the focus, and perform other operations.

[0260] Optionally, the transparency of the background of the animation frame shown in Figures 7C-7F can become lower and lower until the transparency of the animation frame is close to 0, and the background elements of the animation frame are invisible. The electronic device 100 then switches to displaying the shooting preview interface of the camera application to achieve a natural and smooth transition to displaying the shooting preview interface of the camera application.

[0261] Optionally, the gallery application may also receive user operations on the large image preview interface to jump to the camera application. Exemplarily, the operation may be a long press and slide down operation on the large image preview interface. Then the second switching animation may include animation frame 5003 shown in Figure 4D, animation frame 5002 shown in Figure 4C, and animation frame 5001 shown in Figure 4B. After playing the animation frame 5001 shown in Figure 4B, the electronic device 100 may display the user interface 7005 shown in Figure 7G. This application does not limit the display style of the second switching animation.

[0262] Optionally, the image parameters of the last frame of the second transition animation can also be the same as the image parameters in the shooting preview interface to avoid lag. Image parameters include but are not limited to: image content, image size, image transparency, etc.

[0263] It should be noted that Figures 7C-7F only show some animation frames in the second switching animation. The second switching animation can also include more other animation frames. Figures 7C-7F also only show a display style of the second switching animation. The second switching animation can also be other display styles. This application does not limit this.

[0264] FIG8 shows a flowchart of a specific implementation method for jumping from a gallery application to a camera application.

[0265] S801: The gallery application receives a user operation on a large image editing interface to jump to a camera application.

[0266] In some embodiments, the electronic device 100 can receive a user operation on the large image editing interface in the gallery application and jump to the camera application. For example, the operation can be an input operation on the return option in the large image editing interface, such as an input operation on the return option 5007 shown in Figure 7A, such as a single click operation, or a long press and swipe operation on the image displayed in the large image editing interface, such as an input operation on the image 5006 in the user interface 5005 shown in Figure 7B, such as a long press and swipe operation.

[0267] Optionally, the gallery application may also receive a user operation on the large image preview interface to jump to the camera application. For example, the operation may be a long press and slide operation on the large image preview interface. Then the second switching animation may include animation frame 5003 shown in Figure 4D, animation frame 5002 shown in Figure 4C, and animation frame 5001 shown in Figure 4B. This application does not limit the display style of the second switching animation.

[0268] S802: The gallery application obtains animation elements and animation parameters of the second switching animation.

[0269] It takes a while for the gallery application to jump to the camera application. In order to improve the user experience during the waiting period, the gallery application can play a second switching animation to improve the user's visual experience.

[0270] Before playing the second switching animation, the gallery application needs to obtain the animation elements and animation parameters in the second switching animation, and draw and render multiple animation frames based on the animation elements and animation parameters in the second switching animation.

[0271] Animation elements may refer to image content in an animation frame, and animation parameters may include but are not limited to information such as size, transparency, position, etc. of the animation frame. For example, the animation element may be the picture 5006 shown in FIG7A .

[0272] In one possible implementation, the electronic device 100 pre-stores the animation elements and animation parameters corresponding to each frame of the second switching animation, and the gallery application can directly obtain the animation elements and animation parameters corresponding to each frame of the second switching animation from the electronic device 100.

[0273] In other possible implementations, the gallery application can also calculate the animation parameters corresponding to each animation frame in the second switching animation in real time based on the duration of the second switching animation. Optionally, the second switching animation may include a preset duration, such as 300ms, and the camera application can determine the number of animation frames included in the second avatar switching animation based on the display duration of each animation frame. For example, if the display duration of each animation frame is 50ms, the second switching animation includes 6 animation frames. Based on the animation parameters of the initial animation frame in the second switching animation, the animation parameters of the terminal animation frame in the second switching animation, and the number of animation frames, the animation parameters corresponding to each animation frame in the second switching animation are determined.

[0274] Optionally, the animation elements in different animation frames may be the same or different, and this application does not impose any limitation on this.

[0275] S803: The gallery application sends the animation elements and animation parameters of the second switching animation to the camera application.

[0276] After obtaining the animation elements and animation parameters of the first transition animation, the gallery application also needs to send the animation elements and animation parameters of the second transition animation to the camera application. This allows the camera application to draw and render the unplayed animation frames based on the animation elements and animation parameters of the second transition animation before the second transition animation is completed after the electronic device 100 jumps to the camera application. This ensures that the electronic device 100 can complete the second transition animation and achieve a smooth and natural transition from the second transition animation to the shooting preview interface of the second application.

[0277] Optionally, S803 may also be executed before, after, or simultaneously with any step before S813.

[0278] S804: The gallery application draws and renders multiple animation frames in the second switching animation based on the animation elements and animation parameters.

[0279] S805: The gallery application plays multiple animation frames in the second switching animation.

[0280] After acquiring the animation elements and animation parameters in the second switching animation, the gallery application may draw and render multiple animation frames in the second switching animation based on the animation elements and animation parameters, and play the multiple animation frames in the second switching animation.

[0281] Exemplarily, the multiple animation frames in the second switching animation may be animation frame 7001 , animation frame 7002 , animation frame 7003 , and animation frame 7004 as shown in FIG. 7C to FIG. 7F .

[0282] In some embodiments, in response to a user operation on the large image preview interface, electronic device 100 determines that the current user operation is a user operation to jump to the camera application. Electronic device 100 may determine that the gallery application is running in the background and the camera application is running in the foreground. Based on the principle that foreground operation priority exceeds background operation priority, electronic device 100 may lower the gallery application's CPU scheduling priority. After the gallery application's CPU scheduling priority is lowered, the gallery application may be unable to promptly draw and render multiple animation frames in the second transition animation, resulting in frame drops. To ensure that the gallery application draws and renders multiple animation frames in the second transition animation normally without frame drops, that is, to ensure that the camera application's CPU scheduling priority is not lowered, the gallery application may be bound to the on start() state callback of the camera application's activity. Because the on start() state callback of the camera application's activity is in the foreground, binding a specific service in the gallery application to the on start() state callback of the camera application's activity allows electronic device 100 to assume that the gallery application is also running in the foreground, ensuring that the gallery application's CPU scheduling priority is not lowered.

[0283] Optionally, the specific service may be an empty service, which is used when the gallery application switches to the camera application.

[0284] S806: The camera application obtains the elements and element layout information in the shooting preview interface, and draws and renders the shooting preview interface based on the elements and element layout information in the shooting preview interface.

[0285] Optionally, S806 may be executed in parallel with S804 and S805, or S806 may be executed at a time before S804, or at a time after S804, which is not limited in this application.

[0286] Through this method, after detecting the user operation of jumping to the camera application, the electronic device 100 can simultaneously play the second switching animation and draw and render the shooting preview interface to be displayed by the camera application. There is no need to wait for the drawing and rendering of the shooting preview interface to be displayed by the camera application to be completed before starting to play the second switching animation. This shortens the delay of the electronic device 100 in playing the second switching animation, solves the problem of the electronic device 100 responding slowly to the user operation of jumping to the camera application, saves the user's waiting time, and improves the user's visual experience.

[0287] In response to the user's operation on the large image preview interface, the camera application can obtain the elements and element layout information in the shooting preview interface, and draw and render the shooting preview interface based on the elements and element layout information in the shooting preview interface.

[0288] Since the camera application is already open and running in the background, the camera application activity already exists. The electronic device 100 does not need to create the camera application activity and can directly obtain the camera application activity. The camera application can directly obtain the elements and element layout information in the shooting preview interface from the camera application's running memory.

[0289] S807: The camera application sends the drawing and rendering progress of the shooting preview interface to the gallery application.

[0290] Optionally, the shooting preview interface drawing and rendering progress may be a shooting preview interface drawing and rendering completion message. After the camera application completes drawing and rendering the shooting preview interface, the camera application sends the shooting preview interface drawing and rendering completion message to the gallery application.

[0291] Optionally, the shooting preview interface drawing and rendering progress carries a shooting preview interface drawing and rendering completion or incomplete message. S807 can be executed irregularly / periodically / at intervals of a certain length, or S807 can be executed after the shooting preview interface drawing and rendering is completed.

[0292] S808. The gallery application needs to confirm whether the shooting preview interface is drawn and rendered.

[0293] While the gallery application is playing the second switching animation, the gallery application needs to confirm whether the shooting preview interface in the camera application is drawn and rendered.

[0294] Optionally, the gallery application may determine whether the drawing and rendering of the large image preview interface are completed based on the drawing and rendering progress of the large image preview interface sent by the camera application.

[0295] If the drawing and rendering progress of the large image preview interface is a message indicating that the drawing and rendering of the shooting preview interface is complete, and the Gallery app has not received the drawing and rendering progress of the shooting preview interface from the Camera app, the Gallery app can confirm that the drawing and rendering of the shooting preview interface is not complete. If the Gallery app receives the drawing and rendering progress of the shooting preview interface from the Camera app, the Gallery app can confirm that the drawing and rendering of the shooting preview interface is complete.

[0296] When the capture preview interface drawing and rendering progress contains a message indicating that the capture preview interface drawing and rendering is complete or incomplete, after receiving the capture preview interface drawing and rendering progress, the gallery application can determine that the capture preview interface drawing and rendering is complete based on the capture preview interface drawing and rendering completion message contained in the capture preview interface drawing and rendering progress.

[0297] After the shooting preview interface in the camera application is drawn and rendered, the gallery application needs to stop drawing and playing the second switching animation.

[0298] When the shooting preview interface in the camera application is not drawn and rendered, the gallery application can continue to play the second switching animation until the shooting preview interface in the camera application is completed, and the gallery application stops drawing and playing the second switching animation.

[0299] When confirming that the drawing and rendering of the shooting preview interface are completed, the camera application executes S811.

[0300] If it is confirmed that the shooting preview interface has not been drawn and rendered, the camera application executes S804.

[0301] S809: The gallery application needs to confirm whether the second switching animation has been played.

[0302] When the gallery application confirms that the shooting preview interface has not been drawn and rendered, the gallery application needs to confirm whether the second switching animation has been played, and determine whether to continue playing the second switching animation or display the last animation frame in the second switching animation.

[0303] When it is confirmed that the shooting preview interface has not been drawn and rendered, and the second switching animation has not been played, the gallery application needs to continue drawing and rendering the unplayed animation frames in the second switching animation, and play the unplayed animation frames in the second switching animation. The gallery application executes 8 and S805.

[0304] When it is confirmed that the shooting preview interface has not been drawn and rendered, but the second switching animation has been played, the gallery application needs to display the last animation frame in the second switching animation, that is, the camera application executes S810.

[0305] S810: The gallery application displays the last animation frame in the second switching animation.

[0306] Exemplarily, the last animation frame in the second switching animation may be the animation frame 5004 shown in FIG. 4E .

[0307] S811. The gallery application sends the playback progress of the second switching animation to the camera application.

[0308] S812: The camera application needs to confirm whether the second switching animation has been played.

[0309] When it is determined that the drawing and rendering of the shooting preview interface are completed, the gallery application stops playing the animation frames in the second switching animation and sends the playing progress of the second switching animation to the camera application.

[0310] The playback progress of the second switching animation may refer to the mth animation frame in the second switching animation played by the gallery application, where the second switching animation includes n animation frames, and m is less than or equal to n.

[0311] After receiving the playback progress of the second switching animation sent by the gallery application, the camera application needs to confirm whether the second switching animation has been played.

[0312] When m is equal to n, it indicates that the gallery application has finished playing the second switching animation, and S815 is executed.

[0313] When m is less than n, it means that the gallery application has not finished playing the second switching animation, and the (m+1)th frame animation frame to the nth frame animation frame in the second switching animation have not been played. The camera application continues to play the (m+1)th frame animation frame to the nth frame animation frame in the second avatar switching animation and executes S813.

[0314] When it is determined that the drawing and rendering of the shooting preview interface in the camera application are completed, in addition to stopping drawing and playing the second switching animation, the gallery application also needs to destroy the initialization settings, such as releasing the rendering library, stopping querying the database, releasing plug-ins, etc., to save power consumption of the electronic device 100.

[0315] The Gallery app needs to seize CPU resources to destroy the initialization settings. If the Gallery app destroys the initialization settings while drawing and playing the second transition animation, it may not be able to allocate CPU resources to draw and render the animation frames in time, resulting in frame drops and lag. With this method, the Gallery app only destroys the initialization settings after determining that the drawing and rendering of the shooting preview interface in the Camera app are complete, which can avoid lag caused by frame drops when the Gallery app plays the second transition animation.

[0316] In other embodiments, the gallery application destroys the initialization settings and the gallery application plays the second switching animation at the same time, or the gallery application destroys the initialization settings and the gallery application plays the second switching animation before. This application does not limit this.

[0317] S813: The camera application draws and renders the unplayed animation frames in the second switching animation.

[0318] S814: The camera application plays the unplayed animation frames in the second switching animation.

[0319] When it is determined that the second switching animation has not been completed, the camera application can draw and render the unplayed animation frames in the second switching animation based on the animation elements and animation parameters of the unplayed animation frames, and play the unplayed animation frames in the second switching animation.

[0320] For example, if the gallery application finishes playing animation frame 7002 shown in Figure 7D and the drawing and rendering of the capture preview interface are complete, the gallery application will not be able to continue playing animation frame 7003 shown in Figure 7E and animation frame 7004 shown in Figure 7F. If the application does not continue playing animation frames 7003 and 7004 and directly switches to displaying user interface 7005 shown in Figure 7G, the user will visually experience a jump from animation frame 7002 to displaying user interface 7005. The image content of animation frame 7002 and user interface 7005 is quite different, giving the user an unnatural effect of image content jump and switching.

[0321] To avoid this, if the drawing and rendering of the capture preview interface is complete but the second transition animation has not yet finished playing, the Gallery app cannot play the remaining animation frames. To ensure that the remaining animation frames of the second transition animation can be played, allowing a natural and smooth transition from the second transition animation to the capture preview interface in the Camera app, the Camera app can continue to draw and play the remaining animation frames, ensuring a natural and smooth jump from the Gallery app to the Camera app and display of the capture preview interface in the Camera app.

[0322] For example, the camera application can obtain the animation elements and animation parameters of the (m+1)th animation frame to the nth animation frame in the second switching animation, draw and render the (m+1)th animation frame to the nth animation frame in the second switching animation, and play the (m+1)th animation frame to the nth animation frame in the second switching animation.

[0323] For example, m can be 2 and n can be 4. Animation frame 7001 shown in FIG. 7C and animation frame 7002 shown in FIG. 7D are drawn and played by the Gallery application. Animation frame 7003 shown in FIG. 7E and animation frame 7004 shown in FIG. 7F are drawn and played by the Camera application. This ensures a smooth transition from the Gallery application to the Camera application and displays the shooting preview interface in the Camera application.

[0324] S815. The camera application displays a shooting preview interface of the camera application.

[0325] When it is determined that the second switching animation has been played, animation frame 7001 shown in Figure 7C, animation frame 7002 shown in Figure 7D, animation frame 7003 shown in Figure 7E, and animation frame 7004 shown in Figure 7F are all drawn and played by the gallery application, and the camera application can directly display the large image preview interface of the gallery application. For example, the camera application can display user interface 7005 shown in Figure 7G. In this case, the moment when the gallery application finishes playing the second switching animation can be the same as the moment when the camera application finishes drawing and rendering the shooting preview interface. The moment when the gallery application finishes playing the second switching animation can also be before the moment when the camera application finishes drawing and rendering the shooting preview interface.

[0326] In S812, after the camera application finishes playing the unplayed animation frames in the second switching animation, that is, after playing the (m+1)th frame to the nth frame in the second switching animation, the camera application may display a shooting preview interface, for example, the camera application may display user interface 7005 shown in FIG7G . In this case, the moment when the gallery application finishes playing the second switching animation is after the moment when the camera application finishes drawing and rendering the shooting preview interface.

[0327] In some embodiments, the image content of the last frame of the second switching animation is the same as the image content of the shooting preview interface in the camera application. The image content includes but is not limited to: picture, picture size, picture transparency, etc.

[0328] The reason is that when the drawing and rendering of the shooting preview interface are completed, the gallery application determines that the second switching animation has also been played. If the gallery application finishes playing the first switching animation and before the camera application finishes drawing and rendering the shooting preview interface, the gallery application needs to stay displaying the last frame of the second switching animation until the shooting preview interface is drawn and rendered, and the electronic device 100 switches to displaying the shooting preview interface of the camera application. If the image parameters of the last frame of the animation in the second switching animation are significantly different from the image parameters of the shooting preview interface of the camera application, the user will visually experience a sudden change and a stuck effect of the image, which is a poor user experience. Based on this, the image parameters of the last frame of the animation in the second switching animation can be set to be the same as the parameters of the image content of the shooting preview interface in the camera application. At the moment when the gallery application finishes playing the first avatar switching animation and before the camera application finishes drawing and rendering the shooting preview interface, the user will not feel that the image switching has occurred, thereby improving the user experience.

[0329] FIG9 shows a schematic diagram of the state change process of the life cycle of the activity of the camera application and the life cycle of the activity of the gallery application in the process of jumping from the gallery application to the camera application.

[0330] When jumping from the gallery application to the camera application, since the camera application is already opened and running in the background, the activity of the camera application already exists. The electronic device 100 does not need to create the activity of the camera application and can directly obtain the activity of the camera application.

[0331] In this case, as shown in FIG9 , in response to the user's operation on the large image preview interface to jump to the camera application, the camera application's activity needs to be in the on start() state. The camera application's activity enters the on start() state again from the on stop() state. When the camera application's activity is in the on start() state, the camera application can obtain the elements and the layout information of the elements in the shooting preview interface from the camera application's running memory. The shooting preview interface is the user interface to be displayed by the camera application, such as the user interface 7005 shown in FIG7G . Exemplarily, the elements in the shooting preview interface can be multiple elements displayed in the user interface 7005.

[0332] When the camera application's activity is in the on start() state, the camera application also needs to perform initialization settings so that the gallery application can run normally and implement related functions, such as opening the camera, loading plug-ins, allocating streams, and starting streaming.

[0333] When the activity of the camera application is in the on start() state, the camera application can draw and render the shooting preview interface based on the elements in the shooting preview interface and the layout information of the elements.

[0334] Optionally, when the camera application's activity is in the on start() state, the camera application also needs to send the progress of drawing and rendering the shooting preview interface to the gallery application. In one possible implementation, the progress of drawing and rendering the shooting preview interface can be a message that the drawing and rendering of the shooting preview interface is completed. After the camera application completes drawing and rendering the shooting preview interface, the camera application sends a message that the drawing and rendering of the shooting preview interface is completed to the camera application. In other possible implementations, the drawing and rendering progress of the shooting preview interface carries a message that the drawing and rendering of the shooting preview interface is completed or not completed. The drawing and rendering progress of the shooting preview interface can be sent to the gallery application irregularly / periodically / at certain intervals.

[0335] In this application, in response to the user's operation on the large image preview interface to jump to the camera application, the activity of the gallery application needs to enter the on pause() state from the on resume() state. When the activity of the gallery application is in the on pause() state, the gallery application needs to grayscale the large image preview interface so that the gallery application no longer responds to the user's various click operations, sliding operations, etc. on the large image preview interface. The gallery application also needs to draw and play the second switching animation, waiting for the camera application to complete the drawing and rendering of the shooting preview interface. The activity of the gallery application needs to be continuously in the on pause() state until the camera application completes the drawing and rendering of the shooting preview interface. The activity of the gallery application will enter the next state.

[0336] Optionally, when the activity of the gallery application is in the on pause() state, the gallery application can bind a specific service in the gallery application to the on start() state callback of the activity of the camera application. Because the on start() state callback of the camera application's activity is in the foreground running state, binding the specific service in the gallery application to the on start() state callback of the camera application's activity makes the electronic device 100 believe that the gallery application is also running in the foreground, ensuring that the CPU scheduling priority of the gallery application is not reduced. This allows the gallery application to draw and render multiple animation frames in the second switching animation in a timely manner, avoiding frame loss and lag.

[0337] Optionally, when the activity of the gallery application is in the on pause() state, the gallery application may also perform other operations, which are not limited in this application.

[0338] Optionally, step 2 and step 5 in Figure 9 can be performed simultaneously, or step 2 can be performed before step 5. Step 5 does not need to wait until step 2 is completed before being performed.

[0339] In Figure 9, after the camera application draws and renders the shooting preview interface, the gallery application's activity can switch from the on pause() state to the on stop() state. When the gallery application's activity is in the on stop() state, the gallery application needs to destroy initialization settings, such as releasing the rendering library, stopping database queries, and releasing plug-ins, to save power consumption of the electronic device 100.

[0340] After determining that the shooting preview interface is drawn and rendered, the gallery application may send the second switching animation playback progress to the camera application, so that the camera application confirms whether to continue playing the second switching animation.

[0341] Optionally, when the activity of the gallery application is in the on stop() state, if the second switching animation has not finished playing, the gallery application also needs to stop playing the second switching animation.

[0342] When the activity of the gallery application is in the on stop() state, the large image preview interface of the gallery application is invisible.

[0343] Optionally, after the camera application completes drawing and rendering the shooting preview interface, if the second switching animation has not yet finished playing Figure 7G, after the gallery application stops playing the second switching animation, in order to naturally and smoothly switch to displaying the shooting preview interface of the camera application, the camera application needs to continue drawing and playing the unplayed animation frames until the second switching animation is finished playing, and the activity of the camera application is switched to the on resume() state, and the camera application then displays the shooting preview interface in the window provided by the activity of the camera application, such as the user interface 7005 shown.

[0344] In Figure 9 , after the camera application completes drawing and rendering the shooting preview interface and the second switching animation plays, the camera application's activity can switch from the on start() state to the on resume() state. While the camera application's activity is in the on resume() state, the camera application can display the shooting preview interface in the window provided by the camera application's activity, such as user interface 7005 shown in Figure 7G .

[0345] It should be noted that the step numbers in FIG9 do not represent the execution order of the steps, and this application does not limit the execution order of the steps in FIG9.

[0346] 4. Close the camera app.

[0347] In some embodiments, after the electronic device 100 receives a user operation to start a camera application, the electronic device 100 may also receive a user operation to close the camera application.

[0348] FIG10 is a schematic diagram showing a state change process of the activity life cycle of the camera application when the electronic device 100 closes the camera application based on a user operation.

[0349] As shown in FIG10 , the electronic device 100 may receive a user operation to close the camera application, and the activity of the camera application is in the on pause() state.

[0350] In response to the camera application's activity being in the on pause() state, the camera application grays out the shooting preview interface displayed, making the camera application unable to respond to various click operations, sliding operations, etc. performed by the user on the shooting preview interface.

[0351] Optionally, when the activity of the camera application is in the on pause() state, the camera application may also perform other operations, which are not limited in this application.

[0352] Afterwards, the camera application's activity can switch from the on pause() state to the on stop() state.

[0353] In response to the camera application's activity being in the on stop() state, the camera application needs to destroy initialization settings, such as closing the camera, releasing plug-ins, stopping stream allocation, and stopping stream initiation.

[0354] In response to the camera application's activity being in the on stop() state, the camera application also needs to delete the elements and the layout information of the elements in the shooting preview interface stored in the camera application's running memory.

[0355] Optionally, when the activity of the camera application is in the on stop() state, the camera application may also perform other operations, which are not limited in this application.

[0356] Afterwards, the camera application's activity can be switched from the on stop() state to the on destroy() state.

[0357] In response to the camera application's activity being in the on destroy() state, the camera application destroys the camera application's activity. After destroying the camera application's activity, the camera application stops displaying the capture preview interface. Optionally, the camera application also destroys the camera application's process, freeing up the camera application's runtime memory, etc., to shut down the camera application.

[0358] FIG11 is a flow chart of a method for interaction between applications provided in this application.

[0359] S1101: A first application displays a first user interface.

[0360] Exemplarily, the first application may be a camera application, and the first user interface may be the shooting preview interface shown in FIG. 4A .

[0361] Exemplarily, the first application may be a gallery application, the first user interface may be the user interface 5005 shown in FIG. 7A , or the first user interface may be the user interface shown in FIG. 4E .

[0362] S1102: The first application receives a first operation on the first user interface.

[0363] For example, when the first application is a camera application, the first operation may be a single-click operation on the review control 104 shown in FIG. 4A .

[0364] Exemplarily, when the first application is a gallery application, the first operation may be a single-click operation on the return option 5007 shown in FIG7A , the first operation may be a long press and pull-down operation on the picture 5006 shown in FIG7B , or the first operation may be a long press and pull-down operation on the picture shown in FIG4E .

[0365] S1103 : In response to the first operation, render a first animation in the first application, and play the first animation.

[0366] Optionally, rendering the first animation in the first application may refer to the first application rendering the first animation, or may refer to a system function on the electronic device rendering the first animation.

[0367] For example, when the first application is a camera application, the first animation may also be referred to as a first switching animation. The first animation may include animation frame 5001 , animation frame 5002 , animation frame 5003 , and animation frame 5004 .

[0368] For example, when the first application is a gallery application, the first animation may also be referred to as a second switching animation. The first animation may include animation frame 7001, animation frame 7002, animation frame 7003, and animation frame 7004.

[0369] Exemplarily, the first animation may also include animation frame 5004 , animation frame 5003 , animation frame 5002 and animation frame 5001 .

[0370] S1104: Render a second user interface in a second application.

[0371] Optionally, rendering the second user interface in the second application may refer to the second application rendering the second user interface, or may refer to a system function on the electronic device rendering the second user interface.

[0372] For example, when the second application is a gallery application, the second user interface may be the large image preview interface shown in Figure 4E. In some embodiments, the second user interface may also be the large image editing interface shown in Figure 4F.

[0373] Exemplarily, when the second application is a camera application, the second user interface may be a shooting preview interface as shown in FIG. 7G .

[0374] S1105: Determine whether the second user interface is rendered.

[0375] S1106: When the rendering of the second user interface is completed, the first application stops playing the first animation; and the second application displays the second user interface.

[0376] With this method, when an electronic device receives a user action to jump to a second application, it can play an animation through the first application while the second application renders the second user interface to be displayed, eliminating the need to wait for the second user interface to be displayed in the second application to be drawn and rendered before playing the first animation. This shortens the delay in the electronic device playing the first animation, solves the problem of the electronic device being slow to respond to user actions to jump to the second application, saves users waiting time, and improves their visual experience.

[0377] In a possible implementation, the first application plays the first animation and renders the second user interface in parallel.

[0378] That is to say, when the electronic device receives a user operation to jump to the second application, it can play the animation through the first application, and at the same time the second application renders the second user interface to be displayed. It needs to wait until the second user interface to be displayed in the second application is drawn and rendered before playing the first animation.

[0379] In one possible implementation, when the rendering of the second user interface is completed, the method also includes: the second application confirms whether the first animation has been played; when it is confirmed that the first animation has not been played, rendering the unplayed animation frames in the first animation in the second application, and playing the unplayed animation frames; after the second application plays the unplayed animation frames, the second application displays the second user interface; when it is confirmed that the first animation has been played, the second application displays the second user interface.

[0380] Optionally, after the first application stops playing the first animation, the first application may send the playing progress of the first animation to the second application, so that the second application confirms whether to continue playing the first animation.

[0381] When the first animation is finished, the second application does not need to continue playing the first animation and can directly switch to displaying the second user interface. When the second user interface is not finished playing, the second application needs to continue playing the unplayed animation frames in the first animation. After playing the unplayed animation frames in the first animation, the second application switches to displaying the second user interface. In this way, it can be ensured that after the first animation is finished playing, the electronic device switches to displaying the second user interface, and it can ensure a smooth switch from the first animation to displaying the second user interface.

[0382] In one possible implementation, if the second user interface is not completely rendered, the method further includes: the first application confirming whether the first animation has been completed; if the first animation has not been completed, rendering the unplayed animation frames of the first animation in the first application, and playing the unplayed animation frames. If the first animation is completely played, the first application displays a third user interface, and the third user interface includes the last animation frame of the first animation.

[0383] Exemplarily, the third user interface may be the user interface shown in FIG. 4E .

[0384] Optionally, the second application may send the rendering progress of the second user interface to the first application, so that the first application can confirm whether the rendering of the second user interface is complete.

[0385] When the second user interface is rendered, the first application needs to stop playing the first animation. When the second user interface is not rendered, the first application can continue playing the first animation.

[0386] In a possible implementation, the second user interface includes image content of the last animation frame in the first animation.

[0387] Thus, when the first animation has finished playing but the second user interface has not yet been rendered, the electronic device needs to continuously display the last frame of the first animation. Setting the image content of the last frame of the first animation to be the same or similar to the image content of the second user interface can ensure that the electronic device smoothly switches from the last frame of the first animation to displaying the second user interface without screen jumps.

[0388] In one possible implementation, after the first application receives the first operation on the first user interface, the method further includes: the electronic device confirming whether there is a process of the second application; if it is confirmed that there is no process of the second application, the electronic device creates the process of the second application.

[0389] In this way, on the one hand, when the electronic device needs to use the second application, the electronic device can create the process of the second application, that is, open the second application, ensuring that the electronic device can use the second application normally. Compared with the solution of immediately creating the process of the second application when the electronic device opens the first application, the memory space of the electronic device can be saved and resource waste can be avoided. On the other hand, when the process of the second application has not been created before, when the first application receives the user operation, the electronic device creates the process of the second application. Because the first application also needs to play the first animation, the electronic device can create the process of the second application at the same time without waiting for the electronic device to create the process of the second application before starting to play the first animation. In other words, the first application plays the first animation and the electronic device creates the process of the second application in parallel.

[0390] In one possible implementation, the first application is a camera application, the first user interface is a shooting preview interface of the camera application, the second application is a gallery application, the first operation is an operation of clicking a thumbnail, and the second user interface includes the original image corresponding to the thumbnail.

[0391] In this way, you can jump from the camera app to the gallery app.

[0392] In a possible implementation, the first animation is a transition animation from a thumbnail image to an original image.

[0393] In a possible implementation, the second user interface does not include controls in the gallery, so that the image content of the last animation frame in the first animation can be guaranteed to be the same or similar to the image content of the second user interface.

[0394] In one possible implementation, after the second application displays the second user interface, the method also includes: the second application receives a second operation of the user on the second user interface; in response to the second operation, the second application displays a fourth user interface, and the fourth user interface includes the original image corresponding to the thumbnail and controls in the gallery.

[0395] Exemplarily, the fourth user interface may be the user interface 5005 shown in FIG. 4F , and the user interface 5005 may also be referred to as a large image editing interface.

[0396] In this way, after the electronic device displays the second user interface, the electronic device can receive a user operation to display a fourth user interface, and the user can edit the original image corresponding to the thumbnail in the fourth user interface.

[0397] In a possible implementation, after the first application stops playing the first animation, the method further includes: the first application performs any one or more of the following tasks: closing the camera, releasing the plug-in, stopping streaming, and stopping streaming.

[0398] In this way, the first application destroys the initialization settings only when it is determined that the rendering of the second user interface is completed, which can avoid the occurrence of freezes in the first animation played by the first application due to frame loss.

[0399] The present application provides an electronic device, which includes a memory and a processor; wherein the memory and the processor are coupled, and the memory is used to store a computer program. When the processor executes and calls the computer program, the electronic device executes an inter-application interaction method shown in Figure 11.

[0400] The present application provides a computer-readable storage medium including instructions. When the instructions are executed on an electronic device, the electronic device executes an inter-application interaction method shown in FIG11 .

[0401] The present application provides a chip system, which includes one or more processors, and the processors are used to call computer instructions to enable an electronic device to execute an inter-application interaction method shown in Figure 11.

[0402] The present application provides a computer program product including instructions. When the computer program product is run on an electronic device, the electronic device executes an inter-application interaction method shown in FIG11 .

[0403] The following describes the hardware structure of an electronic device 100 provided in an embodiment of the present application.

[0404] FIG12 shows a schematic diagram of the hardware structure of the electronic device 100 .

[0405] The following embodiments are described in detail using electronic device 100 as an example. It should be understood that the electronic device 100 shown in FIG12 is merely an example, and that the electronic device 100 may have more or fewer components than those shown in FIG12 , may combine two or more components, or may have a different component configuration. The various components shown in FIG12 may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.

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

[0407] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0408] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0409] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

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

[0411] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0412] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby enabling the touch function of the electronic device 100.

[0413] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0414] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0415] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0416] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0417] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0418] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0419] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0420] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0421] 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, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

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

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

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

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

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

[0427] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

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

[0429] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniLED, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0430] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0431] The ISP processes data fed back by camera 193. For example, when taking a photo, 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, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise and brightness. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0432] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. 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, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0433] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

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

[0435] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

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

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

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

[0439] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0440] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0441] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0442] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0443] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0444] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0445] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0446] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0447] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0448] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0449] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0450] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0451] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.

[0452] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0453] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.

[0454] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0455] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.

[0456] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0457] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0458] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0459] The SIM card interface 195 is used to connect a SIM card.

[0460] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0461] FIG13 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.

[0462] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

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

[0464] As shown in FIG13 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

[0465] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0466] As shown in FIG13 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

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

[0468] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0469] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0470] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0471] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0472] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

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

[0474] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0475] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0476] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0477] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0478] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

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

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

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

Claims

1. An inter-application interaction method, characterized in that A first application and a second application are installed on an electronic device, and the method includes: The first application displays a first user interface; The first application receives a first operation on the first user interface; In response to the first operation, a first animation is rendered and played in the first application; A second user interface is rendered in the second application; Determine whether the rendering of the second user interface is completed; When the rendering of the second user interface is completed, the first application stops playing the first animation; The second application displays the second user interface.

2. The method according to claim 1, wherein The first application playing the first animation and rendering the second user interface are executed in parallel.

3. The method according to claim 1 or 2, characterized in that, When the rendering of the second user interface is completed, the method further includes: The second application confirms whether the first animation has finished playing; When it is confirmed that the first animation has not finished playing, the unplayed animation frames in the first animation are rendered and played in the second application; After the unplayed animation frames are played in the second application, the second application displays the second user interface; When it is confirmed that the first animation has finished playing, the second application displays the second user interface.

4. The method according to any one of claims 1-3, characterized in that, When the rendering of the second user interface is not completed, the method further includes: The first application confirms whether the first animation has finished playing; When the first animation has not finished playing, the unplayed animation frames in the first animation are rendered and played in the first application; When the first animation has finished playing, the first application displays a third user interface, and the third user interface includes the last animation frame in the first animation.

5. The method according to any one of claims 1-4, characterized in that, The second user interface includes the image content of the last animation frame in the first animation.

6. The method according to any one of claims 1-5, characterized in that, After the first application receives the first operation on the first user interface, the method further includes: The electronic device confirms whether there is a process of the second application; When it is confirmed that there is no process of the second application, the electronic device creates a process of the second application.

7. The method according to any one of claims 1-6, characterized in that, The first application is a camera application, the first user interface is the shooting preview interface of the camera application, the second application is a gallery application, the first operation is an operation of clicking on a thumbnail, and the second user interface includes the original image corresponding to the thumbnail.

8. The method according to claim 7, characterized in that, The first animation is a transition animation from the thumbnail to the original image.

9. The method according to claim 7 or 8, characterized in that, The second user interface does not include controls in the gallery.

10. The method according to any one of claims 7-9, characterized in that, After the second application displays the second user interface, the method further includes: The second application receives a second operation from the user on the second user interface; In response to the second operation, the second application displays a fourth user interface, and the fourth user interface includes the original image corresponding to the thumbnail and controls in the gallery.

11. The method according to any one of claims 7 to 10, characterized in that, After the first application stops playing the first animation, the method further includes: The first application performs any one or more of the following task items: closing the camera, releasing the plug-in, stopping the stream distribution, and stopping the stream start.

12. An electronic device, characterized in that, The electronic device includes a memory and a processor; wherein, the memory is coupled to the processor, and the memory is used to store a computer program. When the processor executes and calls the computer program, the electronic device executes the method described in any one of claims 1-11.

13. A computer-readable storage medium, comprising instructions, characterized in that, When the instruction runs on the electronic device, the electronic device executes the method described in any one of claims 1-11.

14. A computer program product comprising instructions, characterized in that, When the computer program product runs on the electronic device, the electronic device executes the method described in any one of claims 1-11.

Citation Information

Patent Citations

  • Interaction method between applications, electronic equipment and storage medium

    CN120335909A

  • Method and computing device providing animated graphics transitions between applications

    CN102736912B

  • Application switching method and device, and virtual reality device

    CN107908447A

  • Interface jump method and device of application software, electronic equipment and medium

    CN109522082A

  • Animation platform

    US20090315897A1