Interaction method between applications, electronic equipment and storage medium

By performing animation playback of the first application and user interface rendering of the second application in parallel on the electronic device, the problem of jump delay between applications is solved and the user experience is improved.

CN120335909APending Publication Date: 2025-07-18HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410071114.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-17
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

After receiving user operations, electronic devices need to wait for a while before playing the switch 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 animation is played through the first application, 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

Improves the efficiency of jumping between applications, reduces user waiting time, and improves visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335909A_ABST
    Figure CN120335909A_ABST
Patent Text Reader

Abstract

The invention provides an inter-application interaction method, electronic equipment and a storage medium. A first application and a second application are installed on the electronic equipment. The method comprises the steps that 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, rendering a first animation in the first application, and playing the first animation; rendering a second user interface in a second application; determining whether the second user interface is rendered; under the condition that rendering of the second user interface is completed, the first application stops playing the first animation; the second application displays a second user interface. Through the method, the time delay of playing the first animation by the electronic equipment is shortened, the problem that the electronic equipment responds to slow user operation of jumping to the second application is solved, the waiting time of the user is saved, and the visual experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminals, and particularly to an inter-application interaction method, an electronic device, and a storage medium. Background Art

[0002] With the development of terminal technologies, the number of applications installed on electronic devices has been increasing. Users can take photos / videos, watch movies and TV shows, listen to music, make phone calls, etc. through the applications installed on the electronic devices, greatly improving people's usage experience.

[0003] In order to better guide users to use other applications installed on the electronic device, the electronic device can receive an operation of the user in one of the applications and jump to another application to display the user interface in the other application. To improve the user's visual experience, before jumping to another application, the electronic device 100 can play a switching animation. However, currently, after the electronic device receives the operation of the user, it needs to wait for a period of time before the electronic device 100 can play the switching animation, resulting in a problem of slow response. How to improve the jump efficiency between applications and reduce the delay of the electronic device 100 in playing the switching animation remains to be further studied. Summary of the Invention

[0004] This application provides an inter-application interaction method, an electronic device, and a storage medium. The delay of the electronic device in playing the first animation is shortened, the problem of slow response of the electronic device to the user operation of jumping to the second application is solved, the waiting time of the user is saved, and the user's visual experience is improved.

[0005] In a first aspect, this application provides an inter-application interaction method. A first application and a second application are installed on the electronic device. 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; it is determined whether the second user interface is rendered completely; in the case where the second user interface is rendered completely, the first application stops playing the first animation; the second application displays the second user interface.

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

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

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

[0009] Optionally, rendering a second user interface in a second application may mean that the second application renders the second user interface, or it may mean that the system function on the electronic device renders the second user interface.

[0010] Through this method, when the electronic device receives a user operation to jump to the second application, the first application can play an animation, and the second application renders the second user interface to be displayed, without waiting for the second user interface to be drawn and rendered in the second application before playing the first animation. This shortens the latency of the electronic device playing the first animation, solves the problem of slow response of the electronic device to the user operation of jumping to the second application, saves the user's waiting time, and improves the user's visual experience.

[0011] In combination with the first aspect, in a possible implementation, the first application playing the first animation and rendering the second user interface are executed in parallel.

[0012] That is to say, when the electronic device receives a user operation to jump to the second application, the first application can play an animation, and at the same time the second application renders the second user interface to be displayed, without waiting for the second user interface to be drawn and rendered in the second application before playing the first animation.

[0013] In combination with the first aspect, in a possible implementation, when the second user interface is rendered, the method further includes: the second application confirms whether the first animation has finished playing; if it is confirmed that the first animation has not finished playing, the second application renders the unplayed animation frames in the first animation and plays the unplayed animation frames; after the second application finishes playing the unplayed animation frames, the second application displays the second user interface; if it is confirmed that the first animation has finished playing, the second application displays the second user interface.

[0014] 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 can confirm whether to continue playing the first animation.

[0015] When the first animation has finished playing, the second application does not need to continue playing the first animation and directly switches to display the second user interface. When the first animation has not finished playing, the second application needs to continue playing the unplayed animation frames in the first animation, and after playing the unplayed animation frames in the first animation, the second application switches to display the second user interface. In this way, it can be ensured that the first animation finishes playing before the electronic device switches to display the second user interface, and it can be ensured that the switch from the first animation to the display of the second user interface is smooth.

[0016] In combination with the first aspect, in a possible implementation, when the second user interface has not been completely rendered, the method further includes: the first application determines whether the first animation has finished playing; when the first animation has not finished playing, the first application renders the unplayed animation frames in the first animation and plays the unplayed animation frames. 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.

[0017] Optionally, the second application may send the rendering progress of the second user interface to the first application, so that the first application can determine whether the second user interface has been completely rendered.

[0018] When the second user interface has been completely rendered, the first application needs to stop playing the first animation. When the second user interface has not been completely rendered, the first application may continue to play the first animation.

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

[0020] In this way, when the first animation has finished playing and the second user interface has not been completely rendered, the electronic device needs to continuously display the last animation frame in the first animation. Setting the image content of the last animation frame in the first animation to be the same as or similar to the image content of the second user interface can ensure that the electronic device smoothly switches from the last animation frame in the first animation to displaying the second user interface without screen jumping.

[0021] In combination with the first aspect, in a possible implementation, after the first application receives a first operation on the first user interface, the method further includes: the electronic device determines whether there is a process of the second application; when it is determined that there is no process of the second application, the electronic device creates a process of the second application.

[0022] In this way, on the one hand, when the electronic device needs to use the second application, the electronic device can create a process of the second application, that is, start the second application, ensuring that the electronic device can normally use the second application. Compared with the solution of immediately creating a process of the second application when the first application is started on the electronic device, it can save the memory space of the electronic device and avoid resource waste. On the other hand, when the process of the second application has not been created before, when the first application receives a user operation, the electronic device creates a process of the second application. Because the first application still needs to play the first animation, the electronic device can create a process of the second application at the same time without waiting for the electronic device to create a process of the second application before starting to play the first animation. That is to say, the first application playing the first animation and the electronic device creating a process of the second application are executed in parallel.

[0023] In combination with the first aspect, in a possible implementation, 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.

[0024] In this way, it is possible to implement a jump from within the camera application to the gallery application.

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

[0026] In combination with the first aspect, in a possible implementation, the second user interface does not include controls in the gallery. In this way, it is possible to ensure that the image content of the last animation frame in the first animation is the same as or similar to the image content of the second user interface.

[0027] In combination with the first aspect, in a possible implementation, after the second application displays the second user interface, the method further includes: the second application receives a second operation from the user for 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.

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

[0029] 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 task items: closing the camera, releasing the plugin, stopping the stream distribution, and stopping the stream startup.

[0030] In this way, in the case where it is determined that the rendering of the second user interface is completed, the first application can destroy the initialization settings, which can avoid the occurrence of stuttering when the first application plays the first animation due to dropped frames.

[0031] 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 application interaction method provided in any possible implementation of any of the above aspects.

[0032] In a third aspect, the present application provides a computer-readable storage medium, including instructions. When the instructions run on an electronic device, the electronic device executes an application interaction method provided in any possible implementation of any of the above aspects.

[0033] In a fourth aspect, the present application provides a chip system. The chip system includes one or more processors, and the processors are configured to call computer instructions to cause an electronic device to execute an application interaction method provided in any possible implementation manner of any of the above aspects.

[0034] In a fifth aspect, the present application provides a computer program product containing instructions. When the computer program product runs on an electronic device, it causes the electronic device to execute an application interaction method provided in any possible implementation manner of any of the above aspects.

[0035] 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 the present application will not repeat them here. Description of the Drawings

[0036] Figures 1A - 1B Shows a UI diagram of an electronic device 100 turning on the camera application;

[0037] Figure 2 Shows a schematic flowchart of a method for an electronic device 100 to display Figure 1B The user interface shown;

[0038] Figure 3A Shows a schematic diagram of the state change process of the life cycle of the activity of the camera application during the opening process of the camera application;

[0039] Figure 3B Shows another schematic diagram of the state change process of the life cycle of the activity of the camera application during the opening process of the camera application;

[0040] Figures 4A - 4F Shows a UI diagram of an electronic device 100 receiving a user operation to jump to the gallery application, jumping to the gallery application and displaying a large - image preview interface;

[0041] Figure 5 Shows a schematic flowchart of a specific implementation method for jumping from the camera application to the gallery application;

[0042] Figure 6A 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;

[0043] Figure 6B 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;

[0044] Figures 7A - 7G It shows that the electronic device 100 receives a user operation to jump to the camera application, jumps to the camera application and displays a UI diagram of the shooting preview interface;

[0045] Figure 8 It shows a schematic diagram of the method flow of a specific implementation of jumping from the gallery application to the camera application;

[0046] Figure 9 It 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 gallery application to the camera application;

[0047] Figure 10 It shows a schematic diagram of the state change process of the life cycle of the activity of the camera application when the electronic device 100 closes the camera application based on a user operation;

[0048] Figure 11 It is a schematic diagram of the method flow of an inter-application interaction method provided by the present application;

[0049] Figure 12 It shows a schematic diagram of the hardware structure of the electronic device 100;

[0050] Figure 13 It shows a schematic diagram of the software structure of the electronic device 100. Detailed implementation

[0051] Next, the technical solutions in the embodiments of the present application will be clearly and elaborately described with reference to the accompanying drawings. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.

[0052] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" is two or more than two.

[0053] In the following embodiments of this application, the term "user interface (UI)" refers to the media interface for interaction and information exchange between an application or an operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The common manifestation form of the user interface is the graphic user interface (GUI), which refers to the user interface related to computer operations displayed in a graphic manner. It can be visual interface elements 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.

[0054] First, continue to explain the technical terms related to this application for you.

[0055] 1. activity

[0056] An activity is a component of an application and is responsible for interacting with the user. An activity provides a window for the application to draw the interface, and the user can perform various operations such as clicking and swiping in this window. An activity can implement a window in an application, and an application can include multiple activities, enabling the application to display multiple windows simultaneously.

[0057] The life cycle of an activity can include multiple stages. The life cycle of an activity refers to the process from when the activity is created to when it is destroyed. During this process, the activity will experience different state events. The life cycle of an activity can but is not limited to the following stages: on create(), on start(), on resume(), on pause(), on stop(), on destroy().

[0058] Among them, on create(), on start(), and on resume() are involved when the application is first launched or the application switches from the background to the foreground for operation, and on pause(), on stop(), and on destroy() are involved when the application is closed or the application switches from the foreground operation to the background operation.

[0059] Among them, on create() is involved when the application is first launched. For example, when the electronic device 100 receives a user's click on the application icon, the electronic device 100 launches the application for the first time. 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 in the main interface of the application and the layout information of the elements from a 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 users can see on the user interface. In one embodiment, the elements may include, but are not limited to: text, pictures, widgets, etc. The layout information of the elements can be understood as information such as the positions, sizes, and directions of the various elements on the user interface.

[0060] In some embodiments, when the activity of the application is in the on create() state, the electronic device 100 also needs to perform initialization settings on the application so that the application can run normally and implement related functions. Exemplarily, when the application is a camera application, the initialization settings include, but are not limited to: turning on the camera, loading plugins, stream configuration, and stream start. Among them, stream configuration may 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. Stream start may refer to the camera collecting images based on the shooting parameter information. After the initialization settings, the camera application can display a 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.

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

[0062] For example, when the electronic device 100 first launches 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 within the window provided by the activity of the application. For another example, when the electronic device 100 switches from the background to the foreground for operation, 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 within the window provided by the activity of the application. The user interface to be displayed by the application can be the main interface of the application or a sub-interface of the main interface of the application.

[0063] When the activity of the application is in the on start() state, the user interface within the application has not been displayed in the foreground.

[0064] on resume() is also involved when the application is first launched or when it switches from the background to the foreground for operation. 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 onresume() 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 swipe operations from the user on the elements within the user interface of the application. Exemplarily, when the application is a camera application, when the activity of the application is in the on resume() state, the camera application can display the shooting preview interface.

[0065] on pause() is involved when the application is closed or when it switches from the foreground to the background for operation. When it is detected that the application is closed or when it switches from the foreground to the background for operation, the activity of the application switches from the on resume() to the on pause() state. When the activity of the application is in the on pause() state, the electronic device 100 can grayscale the elements within the currently displayed user interface of the application, so that the elements within the user interface no longer respond to various click operations or swipe operations from the user.

[0066] onStop() 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 activity of the application switches from onPause() to onStop() state. When the activity of the application is in the onStop() state, the electronic device 100 can stop displaying the user interface of the application in the foreground. Exemplarily, when the application is a camera application, in the onStop() stage, the electronic device 100 needs to stop displaying the shooting preview interface in the foreground.

[0067] In some embodiments, in the onStop() stage, the electronic device 100 also needs to destroy the initialization settings to reduce the power consumption of the application. Exemplarily, when the application is a camera application, in the onPause() stage, the electronic device 100 needs to turn off the camera, release the plug-in, stop the flow allocation, stop the flow start, etc.

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

[0069] In some embodiments, the electronic device 100 can receive the user operation in the first application and jump from the first application to the second application. To improve the user's visual experience, before the electronic device 100 jumps to the second application, the electronic device 100 can play a switching animation. 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 within 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 plays the switching animation, the electronic device 100 then jumps to the second application and displays the user interface to be displayed in the second application.

[0070] Based on the above introduction, during the process of the electronic device 100 jumping 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 responds slowly.

[0071] Based on the above analysis, in order to reduce the delay of the electronic device 100 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;

[0072] Step 1: The electronic device 100 displays the first user interface in the first application, receives the user operation of the user acting on 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.

[0073] Exemplarily, the first application can be a camera application, the first user interface can be the shooting preview interface in the camera application, the second application can be a gallery application, and the user operation can be an input operation on the review control in the shooting preview interface of the camera application, such as a click. In this way, it is possible to realize the jump from the camera application to the gallery application.

[0074] Exemplarily, the first application can be a gallery application, the first user interface can be the large picture preview interface or the large picture editing interface in the gallery application, the second application can be a camera application, and the user operation can be an input operation on the picture displayed in the gallery application, such as a pull-down operation. In this way, it is possible to realize the jump from the gallery application to the camera application.

[0075] 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.

[0076] Exemplarily, when the first application is a camera application, the camera application can obtain the thumbnail displayed in the review control and perform a zoom-in operation on the thumbnail to obtain multiple image frames in the first animation.

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

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

[0079] Optionally, Step 3 and Step 2 can be executed simultaneously. Or Step 3 is executed at a moment before Step 2, or Step 3 is executed at a moment after Step 2. Step 4: After the drawing and rendering of the second user interface are completed, the electronic device 100 jumps to the second application and displays the second user interface.

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

[0081] In some embodiments, after the drawing and rendering of the second user interface are completed and the second user interface in the second application has not been completely rendered, the electronic device 100 can wait for the first application to play all the multiple image frames in the first animation, and then switch to display the second user interface in the second application.

[0082] In some embodiments, after the drawing and rendering of the second user interface are completed and the animation frames in the first animation have not been completely played. The electronic device 100 can draw and render the remaining unplayed image frames in the first animation through the second application. And continue to play the remaining unplayed image frames in the first animation. After the first animation is played, the electronic device 100 then displays the second user interface. In this way, the electronic device 100 can more naturally jump from the first application to the second application.

[0083] Through this method, when the electronic device 100 receives a user operation to jump to the second application, it can immediately play the first animation without waiting for the second user interface to be drawn and rendered in the second application before playing the first animation. This shortens the latency of the electronic device 100 in playing the first animation, solves the problem that the electronic device 100 responds slowly to the user operation of jumping to the second application, saves the user's waiting time, and improves the user's visual experience.

[0084] 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 takes 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.

[0085] An application interaction method provided by this application includes, but is not limited to, the following stages: opening the camera application and displaying the shooting preview interface of the camera application, receiving a user operation to jump to the gallery application, playing a first switching animation, jumping to the gallery application and displaying the large picture preview interface, receiving a user operation to jump to the camera application, playing a second switching animation, jumping to the camera application and displaying the shooting preview interface, and closing the camera application. That is to say, 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.

[0086] Next, the above stages will be described in detail with reference to the UI diagram and the method flow diagram respectively.

[0087] I. Opening the camera application and displaying the shooting preview interface of the camera application.

[0088] Figures 1A - 1B A UI diagram showing the electronic device 100 opening the camera application is shown.

[0089] As Figure 1A shown, the electronic device 100 can display a desktop, and a page with application icons is displayed on the desktop. This page includes multiple application icons (for example, settings application icon, app market application icon, gallery application icon, browser application icon, etc.). Below the multiple application icons, a page indicator is also displayed to indicate the positional relationship between the currently displayed page and other pages. Below the page indicator, a tray area is displayed. Among them, the tray area includes multiple tray icons, for example, a camera application icon, a contacts application icon, a phone application icon, and a messages application icon. The tray area remains displayed during page switching. In some embodiments, the above page may also include multiple application icons and a page indicator. The page indicator may not be part of the page and exists separately. The above tray icons are also optional, and the embodiments of this application do not limit this.

[0090] The electronic device 100 can receive an input (such as a click) from the user on the camera application icon. In response to this input operation, the electronic device 100 can display a user interface as Figure 1B shown. Figure 1B This is a user interface provided by the shooting and display service of the electronic device 100 provided by the embodiments of this application, and it can also be called a shooting preview interface.

[0091] As Figure 1B shown, the preview interface may include a mode bar 101, shooting controls 102, a preview window 103, a review control 104, a quick function area 105, and a focal length adjustment option 106.

[0092] The mode bar 101 may include multiple shooting mode options, such as "night scene", "portrait", "photo shooting", "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 according to different needs. For example, "photo shooting" can be the default shooting mode for taking photos. "Video recording" is used for recording videos. The "night scene" mode is suitable for shooting scenes with relatively 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 one by one here.

[0093] The electronic device 100 can detect a user operation on the shooting mode option in the mode bar 101 and change the currently used shooting mode according to the above user operation. The above user operation is, for example, a left swipe / right swipe operation. For example, when it is detected that the mode bar 101 is dragged and swiped to the left (left swipe operation) and the floating icon stops at the "portrait" option, the electronic device 100 can switch to the "portrait" mode. By default, the electronic device 100 first uses the "photo shooting" mode.

[0094] The shooting control 102 is used to trigger photo shooting. The electronic device 100 can detect whether there is a user operation on the shooting control 102, such as a click operation. After detecting a user operation on the shooting control 102, the electronic device 100 can generate a photo shooting instruction. The electronic device 100 can obtain the image reported by the camera at the corresponding timestamp according to the photo 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 and the process of the gallery application has not been launched, the electronic device 100 can launch the process of the gallery application so that the electronic device 100 can save the captured picture or video in the gallery application.

[0095] 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 display effect of the image. For example, in the "portrait" mode, the electronic device 100 can blur the background in 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 different shooting modes in real time, so that users can perceive the shooting effects corresponding to different shooting modes in real time.

[0096] The review control 104 can be used to browse the thumbnails of the captured photos / videos. After detecting a user operation on the review control 104, the electronic device 100 can also display the picture corresponding to the thumbnail. In some embodiments, after the electronic device 100 receives a user operation on the review control 104, when the process of the gallery application has not been 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 picture corresponding to the thumbnail.

[0097] The quick function area 105 may include a control 105A for the main character video recording mode, an AI scene recognition control 105B, a flash control 105C, a color mode control 105D, a settings control 105E, etc. The control 105A for the main character video recording mode can be used to trigger the electronic device 100 to identify the main character among multiple people 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, and currently the 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 process the image captured by the camera using a color filter. The settings control 105E can be used to set the shooting parameters of the electronic device 100 (such as image size, image storage format, etc.), turn on the "automatic capture" function of the electronic device 100, and so on.

[0098] Multiple zoom ratio options are shown in the focal length adjustment option 106. For example, 0.5x zoom ratio option, 1x zoom ratio option, 2.5x zoom ratio option, 10x zoom ratio option, etc.

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

[0100] Figure 2 A schematic flowchart of a method for an electronic device 100 to display Figure 1B the user interface shown is presented.

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

[0102] Exemplarily, the user operation to start the camera application can be Figure 1A the input operation shown for the camera application icon, such as a click.

[0103] In response to a user operation to start the camera application, the electronic device 100 obtains the activity of the camera application.

[0104] In a possible implementation, if the camera application is launched for the first time, the electronic device 100 needs to create and obtain the activity of the camera application. And 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.

[0105] In other possible implementations, if the camera application is not launched for the first time and the camera application 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. The electronic device 100 can directly obtain the elements and the layout information of the elements in the shooting preview interface from the running memory of the camera application.

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

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

[0108] S203. The camera application performs initialization settings (turning on the camera, loading plugins, stream configuration, starting the stream, etc.).

[0109] Optionally, if the camera application is launched for the first time and the activity of the camera application is in the on create() state, the camera application also needs to perform initialization settings, or if the camera application is not launched for the first time and the activity of the camera application is in the onstart() state, the camera application also 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: turning on the camera, loading plugins, stream configuration, starting the stream, etc. Among them, stream configuration can refer to configuring the shooting parameter information of the preview stream, and the shooting parameter information includes but is not limited to shooting mode, shooting resolution, zoom ratio, picture ratio, etc.

[0110] Optionally, S202 and S203 can be executed simultaneously, S203 can also be executed before S202, and S203 can also be executed after S202.

[0111] S204. The camera application displays the shooting preview interface within the window provided by the activity of the camera application.

[0112] After the electronic device 100 has drawn and rendered the shooting preview interface, the activity of the camera application can be switched from the onstart() state to the on start() state and be in the on resume() state.

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

[0114] In some embodiments, the camera application can also receive and respond to user operations on the shooting preview interface, such as operations of taking pictures or shooting videos, and save the taken photos or videos in the gallery application.

[0115] Optionally, when the activity of the camera application is in the on resume() state, the electronic device 100 can also perform other task matters, which are not limited in this application.

[0116] Figure 3A The figure shows a schematic diagram of the state change process of the life cycle of the activity of the camera application during the startup process of the camera application.

[0117] In a possible implementation manner, 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.

[0118] In this case, as Figure 3A shown, 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 layout information of the shooting preview interface from the disk file and save the elements and layout information of 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. Exemplarily, the elements in the shooting preview interface can be Figure 1B the multiple elements shown in the user interface shown.

[0119] In some embodiments, when the activity of the camera application is in the on create() state, the electronic device 100 also needs to perform initialization settings on 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 plugins, stream configuration, starting the stream, etc. Among them, stream configuration can refer to configuring the shooting parameter information of the preview stream, and the shooting parameter information includes but is not limited to shooting mode, shooting resolution, zoom ratio, picture ratio, etc.Figure 3A The shooting parameter information therein can be obtained from a disk file. Starting the stream can refer to the camera capturing an image based on the shooting parameter information. After the initialization settings, the camera application can display a shooting preview interface and can shoot a video or a picture 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.

[0120] After the initialization settings of the camera application are completed, the activity of the camera application can switch from the onCreate() state to the onStart() state. When the activity of the camera application is in the onStart() 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.

[0121] After the camera application draws and renders the shooting preview interface, the activity of the camera application can switch from the onStart() state to the onResume() state. When the activity of the camera application is in the onResume() state, the camera application can display the shooting preview interface within the window provided by the activity of the camera application.

[0122] In other possible implementation manners, if the camera application is not started for the first time and the camera application 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 directly obtains the activity of the camera application.

[0123] Figure 3B Fig. shows a schematic diagram of the state change process of the life cycle of the activity of the camera application during the startup process of another camera application.

[0124] In this case, as Figure 3B shown, the activity of the camera application has been created and initialized, and the activity of the camera application directly enters the onStart() state.

[0125] When the activity of the camera application is in the onStart() state, the camera application can obtain the elements in the shooting preview interface and the layout information of the elements from the running memory of the camera application. In some embodiments, the camera application also needs to perform initialization settings on 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 plugins, stream configuration, starting the stream, etc. Among them, stream configuration can refer to configuring the shooting parameter information of the preview stream. Figure 3BThe shooting parameter information therein can be obtained from the running memory of the camera application. The shooting parameter information includes but is not limited to shooting mode, shooting resolution, zoom ratio, picture ratio, etc. Starting can refer to the camera collecting an image based on the shooting parameter information. After initialization settings, the camera application can display a shooting preview interface and can shoot a video or a picture 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.

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

[0127] After the camera application draws and renders to obtain the shooting preview interface, the activity of the camera application can be switched from the onstart() state to the on resume() state. When the activity of the camera application is in the on resume() state, the camera application can display the shooting preview interface within the window provided by the activity of the camera application.

[0128] In some embodiments, when the activity of the camera application is in the on resume() state, in the case where the process of the gallery application has not been launched, and in the case where the electronic device 100 has not received a user operation on the review control 104 or has not received a user operation on the shooting control 102, the camera application can not launch the process of the gallery application, that is, does not open the gallery application. This can save the memory space of the electronic device 100. When a user operation on the review control 104 or a user operation on the shooting control 102 is received, the camera application then launches the process of the gallery application. In this way, when the electronic device 100 needs to use the gallery application, the electronic device 100 can launch the process of the gallery application again, that is, open the gallery application, ensuring that the electronic device 100 can normally use the gallery application. Compared with the solution of immediately launching the process of the gallery application when the electronic device 100 opens the camera application, it can save the memory space of the electronic device 100 and avoid the occurrence of resource waste.

[0129] Second, receive a user operation to jump to the gallery application, play the first switching animation, and jump to the gallery application to display the large picture preview interface.

[0130] Figures 4A - 4F Shows a UI diagram of the electronic device 100 receiving a user operation to jump to the gallery application, jumping to the gallery application and displaying the large picture preview interface.

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

[0132] To improve the user's visual experience, before the electronic device 100 jumps to the gallery application, the electronic device 100 may play a first switching animation.

[0133] During the process of the electronic device 100 playing the first switching animation, the electronic device 100 may obtain the activity of the gallery application and draw and render the large - image preview interface to be displayed in the gallery application.

[0134] 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's waiting time.

[0135] Exemplarily, as Figure 4A shown, the electronic device 100 may receive a user input operation for the review control 104, such as a click operation. In response to the user's input operation, the electronic device 100 may 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 the multiple animation frames in the first switching animation.

[0136] Exemplarily, as Figures 4B - 4E shown, the electronic device 100 may sequentially play animation frame 5001, animation frame 5002, animation frame 5003, and animation frame 5004 in the first switching animation.

[0137] It can be seen from animation frame 5001, animation frame 5002, animation frame 5003, and animation frame 5004 that the animation frames are enlarged based on the thumbnails displayed in the review control 104. The animation elements that the electronic device 100 can obtain may be the thumbnails displayed in the review control 104, and the animation parameters may 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.

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

[0139] 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 an animation frame similar to 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 in the gallery application are completed, the gallery application determines that the first switching animation has also finished playing. If the moment when the camera application finishes playing the first switching animation is before the moment when the gallery application finishes 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 then the electronic device 100 switches to display the large - image preview interface of the gallery application. If the difference between the image content of the last animation frame in the first switching animation and the image content of the large - image preview interface of the gallery application is large, there will be an effect of image mutation and lag in the user's vision, and the user experience is not good. Based on this, the image content of the last animation frame in the first switching animation can be set to be the same as the image content of the large - image preview interface in the gallery application. In the case where the moment when the camera application finishes playing the first switching animation is before the moment when the gallery application finishes drawing and rendering the large - image preview interface, the user does not feel the occurrence of image switching, so as to improve the user experience. Optionally, the image content includes but is not limited to: pictures, picture sizes, picture transparencies, etc.

[0140] Optionally, the large - image preview interface in the gallery application only includes pictures. For example, Figure 4E the picture shown, and this picture can be Figure 4A the original picture corresponding to the thumbnail displayed in the review control 104 in

[0141] In some embodiments, after the electronic device 100 displays the large - image preview interface in the gallery application, the electronic device 100 can receive an input operation from the user for the large - image preview interface, such as a click, so that the electronic device 100 displays 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 on the displayed picture within the large - image editing interface.

[0142] Exemplarily, as Figure 4E shown, the electronic device 100 can receive an input operation from the user for the large - image preview interface, such as a click. In response to the user's input operation, the electronic device 100 can display Figure 4F the user interface 5005 shown, and the user interface 5005 includes a picture 5006, and the picture 5006 can be Figure 4A the original picture corresponding to the thumbnail displayed in the review control 104 in

[0143] As shown Figure 4F in the figure, the user interface 5005 not only includes the picture 5006, but also includes a plurality of picture editing options, such as a return option 5007, a sharing option 5012, a favorite option 5008, an editing option 5009, a deletion option 5010, and a more option 5011, etc. Among them, the user can jump back to the shooting preview interface of the camera application again through the return option 5007. The user can share the picture 5006 to other applications on the electronic device 100 or share it to other electronic devices through the sharing option 5012. The user can save the picture 5006 in the favorite folder on the electronic device 100 through the favorite option 5008. The user can edit the picture 5006 through the editing option 5009, such as cropping, rotating, adding filters and special effects, etc. The user can delete the picture 5006 saved in the gallery application through the deletion option 5010. The user can perform more other operations on the picture 5006 through the more option 5011.

[0144] It should be noted that Figures 4B - 4E only some of the animation frames in the first switching animation are shown, and the first switching animation may further include more other animation frames. Figures 4B - 4E Also, only one display style of the first switching animation is shown, and the first switching animation may also be other display styles, which are not limited in this application.

[0145] Figure 5 It shows a schematic diagram of the method flow for a specific implementation of jumping from the camera application to the gallery application.

[0146] S501. The camera application receives an operation of the user on the review control in the shooting preview interface.

[0147] In some embodiments, the camera application can receive an input operation of the user on the review control 104 in the shooting preview interface, such as a click. In response to the input operation of the user, the electronic device 100 can jump from the camera application to the large picture preview interface in the gallery application.

[0148] In some embodiments, when the camera application receives a user 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, when the gallery application is not started, the electronic device 100 can create the process of 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 does not need to create the process of 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 the process of the gallery application again, that is, start 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 starts the camera application, it can save the memory space of the electronic device 100 and avoid resource waste. On the other hand, when the process of the gallery application has not been created before, when the camera application receives a user 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. That is to say, the camera application plays the first switching animation and the electronic device 100 creates the process of the gallery application in parallel.

[0149] S502. The camera application obtains the animation elements and animation parameters of the first switching animation.

[0150] It takes a certain amount of time for the camera application to jump to the gallery application. To improve the user experience during the waiting period for the jump, the camera application can play the first switching animation to enhance the user's visual experience.

[0151] Before playing the first switching animation, the camera application needs to obtain the animation elements and animation parameters in the first switching animation. And based on the animation elements and animation parameters in the first switching animation, multiple animation frames are drawn and rendered.

[0152] Animation elements can refer to the image content in the animation frame, and animation parameters can include but are not limited to information such as the size, transparency, and position of the animation frame. Exemplarily, the animation elements can be Figure 4A the thumbnail shown in the review control 104 as shown.

[0153] In a possible implementation manner, the animation elements and animation parameters corresponding to each animation frame in the first switching animation are pre-stored in the electronic device 100, and the camera application can directly obtain the animation elements and animation parameters corresponding to each animation frame in the first switching animation from the electronic device 100.

[0154] In other possible implementations, the camera application can also calculate, in real time based on the duration of the first switching animation, the animation parameters corresponding to each animation frame in the first switching animation. Optionally, the first switching animation may include a preset duration, such as 300 ms. The camera application can 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 50 ms, then the first switching animation includes 6 animation frames. Then, 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.

[0155] Optionally, the animation elements in different animation frames can be the same or different, and the present application does not make any limitations in this regard.

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

[0157] 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. So that after the electronic device 100 jumps to the gallery application and the first switching animation has not finished playing, the gallery application can draw and render the unplayed animation frames based on the animation elements and animation parameters in the first switching animation. To ensure that the electronic device 100 can play the first switching animation completely and achieve a smooth and natural switch from the first switching animation to the large picture preview interface of the gallery application.

[0158] Optionally, S503 can also be executed before, after, or at the same time as any step before S511.

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

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

[0161] After obtaining the animation elements and animation parameters in the first switching animation, the camera application can draw and render multiple animation frames in the first switching animation based on the animation elements and animation parameters, and play multiple animation frames in the first switching animation.

[0162] Exemplarily, the multiple animation frames in the first switching animation can be Figures 4B - 4E the animation frame 5001, the animation frame 5002, the animation frame 5003, and the animation frame 5004 as shown.

[0163] In some embodiments, in response to a 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 running priority is higher than the background running priority, the electronic device 100 may reduce the CPU scheduling priority of the camera application. After the CPU scheduling priority of the camera application is reduced, the camera application may not be able to draw and render multiple animation frames in the first switching animation in a timely manner, resulting in frame loss. To ensure that the camera application can normally draw and render multiple animation frames in the first switching animation without frame loss, that is, to ensure that the CPU scheduling priority of the camera application is not reduced, the camera application can bind 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. 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, binding a specific service in the camera application 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 makes the electronic device 100 think that the camera application is also in the foreground running, ensuring that the CPU scheduling priority of the camera application is not reduced.

[0164] Optionally, the specific service may be an empty service for use when the camera application jumps to the gallery application.

[0165] 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.

[0166] Optionally, S506 may be executed in parallel with S504 and S505. Or S506 may be executed at a moment before S504, or S506 may be executed at a moment after S504. This application does not make any limitations in this regard.

[0167] Through this method, after detecting the user operation to jump to the gallery application, the electronic device 100 can play the first switching animation and draw and render the large image preview interface to be displayed by the gallery application at the same time, without waiting 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, shortening the delay of the electronic device 100 in playing the first switching animation, solving the problem that the electronic device 100 responds slowly to the user operation of jumping to the gallery application, saving the user's waiting time, and improving the user's visual experience.

[0168] 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.

[0169] In a possible implementation, if the gallery application is opened for the first time, the electronic device 100 needs to create and obtain the activity of the gallery application. And obtain the elements and their layout information in the large - image preview interface from the disk file, and save the elements and their layout information in the shooting preview interface in the running memory of the gallery application.

[0170] In other possible implementations, if the gallery application is not opened for the first time and the gallery application is already running in the background, the activity of the gallery application already exists. The electronic device 100 does not need to create the activity of the gallery application and can directly obtain the activity of the gallery application. The gallery application can directly obtain the elements and their layout information in the large - image preview interface from the running memory of the gallery application.

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

[0172] Optionally, the drawing and rendering progress of the large - image preview interface can be a message indicating that the drawing and rendering of the large - image preview interface is completed. After the gallery application finishes drawing and rendering the large - image preview interface, the gallery application sends a message indicating that the drawing and rendering of the large - image preview interface is completed to the camera application.

[0173] Optionally, the drawing and rendering progress of the large - image preview interface carries a message indicating whether the drawing and rendering of the large - image preview interface is completed or not. S507 can be executed irregularly / periodically / at a certain time interval, and S507 can also be executed after the drawing and rendering of the large - image preview interface is completed.

[0174] S508: The camera application needs to confirm whether the drawing and rendering of the large - image preview interface is completed.

[0175] During the process of the camera application playing the first switching animation, the camera application needs to confirm whether the drawing and rendering of the large - image preview interface in the gallery application is completed.

[0176] Optionally, the camera application can determine whether the drawing and rendering of the large - image preview interface is completed based on the drawing and rendering progress of the large - image preview interface sent by the gallery application.

[0177] When the drawing and rendering progress of the large - image preview interface can be the message indicating the completion of the drawing and rendering of the large - image preview interface, in the case where the camera application has not received the drawing and rendering progress of the large - image preview interface sent by the gallery application, the camera application can confirm that the large - image preview interface has not been drawn and rendered. In the case of receiving the drawing and rendering progress of the large - image preview interface sent by the gallery application, the camera application can confirm that the large - image preview interface has been drawn and rendered.

[0178] When the drawing and rendering progress of the large - image preview interface carries the message indicating the completion or non - completion of the drawing and rendering of the large - image preview interface. After receiving the drawing and rendering progress of the large - image preview interface, the camera application can determine that the gallery application has completed the drawing and rendering of the large - image preview interface based on the message indicating the completion of the drawing and rendering of the large - image preview interface carried in the drawing and rendering progress.

[0179] After the drawing and rendering of the large - image preview interface in the camera application is completed, the camera application needs to stop drawing and playing the first switching animation.

[0180] When the large - image preview interface in the camera application has not been drawn and rendered, the camera application can continue to play the first switching animation until the drawing and rendering of the large - image preview interface in the camera application is completed, and then the camera application stops drawing and playing the first switching animation.

[0181] In the case of confirming that the drawing and rendering of the large - image preview interface is completed, the camera application executes S511.

[0182] In the case of confirming that the drawing and rendering of the large - image preview interface is not completed, the camera application executes S509.

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

[0184] In the case where the camera application confirms that the drawing and rendering of the large - image preview interface is not completed, 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.

[0185] In the case of confirming that the drawing and rendering of the large - image preview interface is not completed and the first switching animation has not been played, the camera application needs to continue to draw and render the unplayed animation frames in the first switching animation and play the unplayed animation frames in the first switching animation, and the camera application executes S504 and S505.

[0186] In the case of confirming that the drawing and rendering of the large - image preview interface is not completed 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.

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

[0188] Exemplarily, the last animation frame in the first switching animation can be Figure 4E the animation frame 5004 as shown.

[0189] S511. The camera application sends the playing progress of the first switching animation to the gallery application.

[0190] S512. The gallery application needs to confirm whether the first switching animation has finished playing.

[0191] When it is determined that the drawing and rendering of the large picture 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.

[0192] The playing progress of the first switching animation can indicate that the camera application has played the m-th animation frame in the first switching animation. The first switching animation includes n animation frames, and m is less than or equal to n.

[0193] After receiving the playing progress of the first switching animation sent by the camera application, the gallery application needs to confirm whether the switching animation has finished playing.

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

[0195] 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 to n-th animation frames in the first switching animation have not been played. The gallery application continues to play the (m + 1)-th to n-th animation frames in the first switching animation, and S513 is executed.

[0196] In some embodiments, when it is determined that the drawing and rendering of the large picture preview interface in the gallery application are completed, in addition to stopping drawing and playing the first switching animation, the camera application also needs to destroy the initialization settings, such as closing the camera, releasing plugins, stopping stream allocation, stopping stream startup, etc., to save the power consumption of the electronic device 100.

[0197] Destroying the initialization settings by the camera application requires preempting CPU resources. If the camera application destroys the initialization settings during the process of drawing and playing the first switching animation, it may cause the camera application to be unable to schedule CPU resources in time to draw and render animation frames, resulting in frame loss and causing a lag situation. Through this method, the camera application destroys the initialization settings only when it is determined that the drawing and rendering of the large picture preview interface in the gallery application are completed, which can avoid the situation of lag when the camera application plays the first switching animation due to frame loss.

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

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

[0200] When it is determined that the first switching animation has not been played completely, the gallery application may draw and render the unplayed animation frames in the first switching animation based on obtaining the animation elements and animation parameters of the unplayed animation frames, and play the unplayed animation frames in the first switching animation.

[0201] For example, if the camera application finishes playing Figure 4C After the animation frame 5002, the large preview interface drawing and rendering have been completed, and the camera application cannot play at this time Figure 4D The animation frames 5003 and Figure 4E If you do not continue to play animation frames 5003 and 5004, and directly switch to the large picture preview interface of the gallery application, the user will visually feel that the animation frame 5002 jumps to a similar Figure 4E In the large image preview interface shown, the image contents of the animation frame 5002 and the large image preview interface are quite different, which brings an unnatural effect of image content jump and switching to the user.

[0202] To avoid this situation, the drawing and rendering of the large image preview interface has been completed, but the first switching animation has not been played, and the camera application cannot play the remaining animation frames. In order to ensure that the remaining animation frames in the first switching animation can be played, so that the first switching animation can be switched to the large image preview interface in the gallery application naturally and smoothly, the gallery application can continue to draw and play the remaining animation frames, so as to ensure a natural and smooth jump from the camera application to the gallery application and display the large image preview interface in the gallery application.

[0203] 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.

[0204] For example, m can be 2, n can be 4, then Figure 4B Animation frame 5001 shown in Figure 4C The animation frame 5002 shown in FIG. 5 is drawn and played by the camera application. Figure 4D Animation frame 5003 shown in Figure 4E The animation frame 5004 shown in FIG. 5 is drawn and played by the gallery application to ensure smooth transition from the camera application to the gallery application and display of the large image preview interface in the gallery application.

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

[0206] When it is determined that the first switching animation has finished playing, then Figure 4B the animation frame 5001 shown in Figure 4C the animation frame 5002 shown in Figure 4D the animation frame 5003 shown in Figure 4E the animation frame 5004 shown in are all drawn and played by the camera application. 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 Figure 4E that shown. In this case, the moment when the camera application finishes playing the first switching animation and the moment when the gallery application finishes drawing and rendering the large - image preview interface can be the same, or 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.

[0207] In S512, after the gallery application finishes playing the unplayed animation frames in the first switching animation, that is, after finishing playing the (m + 1)-th to the n - th animation frames in the first switching animation, the gallery application can display the large - image preview interface of the gallery application. For example, the gallery application can display a user interface similar to Figure 4E that shown. In this case, the moment when the camera application finishes playing the first switching animation is after the moment when the gallery application finishes drawing and rendering the large - image preview interface.

[0208] 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 something similar to 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 in the gallery application are completed, the gallery application determines that the first switching animation has also finished playing. If the moment when the camera application finishes playing the first switching animation is before the moment when the gallery application finishes 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 then the electronic device 100 switches to display the large - image preview interface of the gallery application. If the difference between the image content of the last animation frame in the first switching animation and the image content of the large - image preview interface of the gallery application is significant, there will be an effect of image mutation and lag in the user's vision, and the user experience is not good. Based on this, the image content of the last animation frame in the first switching animation can be set to be the same as the image content of the large - image preview interface in the gallery application. In the case where the moment when the camera application finishes playing the first switching animation is before the moment when the gallery application finishes drawing and rendering the large - image preview interface, the user does not feel the occurrence of image switching, so as to improve the user experience. Optionally, the image content includes but is not limited to: pictures, picture sizes, picture transparencies, etc.

[0209] Optionally, the large - image preview interface in the gallery application only includes pictures. For example, Figure 4E the picture shown, and this picture can be Figure 4A the original picture corresponding to the thumbnail displayed in the review control 104 in . The large - image preview interface in the gallery application does not include one or more editing options, enabling the electronic device 100 to naturally switch from the first switching animation to display the large - image preview interface in the gallery application.

[0210] In some embodiments, after the electronic device 100 displays the large - image preview interface in the gallery application, the electronic device 100 can receive an input operation from the user for the large - image preview interface, such as a 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 picture within the large - image editing interface.

[0211] Exemplarily, as Figure 4E shown, the electronic device 100 can receive an input operation from the user for the large - image preview interface, such as a click. In response to the user's input operation, the electronic device 100 can display Figure 4F the user interface 5005 shown. The user interface 5005 includes a picture 5006, and the picture 5006 can be Figure 4A the original picture corresponding to the thumbnail displayed in the review control 104 in .

[0212] As Figure 4F shown, the user interface 5005 not only includes the picture 5006, but also includes a plurality of picture editing options, such as a return option 5007, a sharing option 5012, a favorite option 5008, an editing option 5009, a deletion option 5010, and a more option 5011, etc. Among them, the user can jump back to the shooting preview interface of the camera application again through the return option 5007. The user can share the picture 5006 to other applications on the electronic device 100 or share it to other electronic devices through the sharing option 5012. The user can save the picture 5006 in the favorite folder on the electronic device 100 through the favorite option 5008. The user can edit the picture 5006 through the editing option 5009, such as cropping, rotating, adding filters and special effects, etc. The user can delete the picture 5006 saved in the gallery application through the deletion option 5010. The user can perform more other operations on the picture 5006 through the more option 5011.

[0213] Figure 6A 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.

[0214] In a possible implementation manner, when jumping from the camera application to the gallery application, if the gallery application has not been started yet, the electronic device 100 needs to create and obtain the activity of the gallery application.

[0215] In this case, as Figure 3A shown, in response to the user's input operation on the review control in the shooting preview interface, such as a 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 picture preview interface from the disk file, and save the elements and the layout information of the elements in the large picture preview interface in the running memory of the gallery application. The large picture preview interface is the user interface to be displayed by the gallery application, such as Figure 4F the user interface 5005 shown. Exemplarily, the elements in the large picture preview interface can be Figure 4F the multiple elements displayed in the user interface 5005 shown.

[0216] 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 plugins, etc.

[0217] After the initialization settings of the camera application are completed, the activity of the gallery application can be switched from the onCreate() state to the onStart() state. When the activity of the gallery application is in the onStart() 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.

[0218] Optionally, when the activity of the gallery application is in the onStart() state, the gallery application also needs to send the drawing and rendering progress of the large image preview interface to the camera application. In a possible implementation, the drawing and rendering progress of the large image preview interface can be a message indicating that the drawing and rendering of the large image preview interface are completed. After the gallery application completes the drawing and rendering of the large image preview interface, the gallery application sends a message indicating that the drawing and rendering of the large image preview interface are completed to the camera application. In other possible implementations, the drawing and rendering progress of the large image preview interface carries a message indicating whether the drawing and rendering of the large image preview interface are completed or not, and the drawing and rendering progress of the large image preview interface can be sent to the camera application irregularly / periodically / at regular intervals.

[0219] In this application, in response to a user's input operation on the review control in the shooting preview interface, such as a click, the activity of the camera application also needs to enter the onPause() state from the onResume() state. When the activity of the camera application is in the onPause() state, the camera application needs to grayscale the shooting preview interface so that the camera application no longer responds to various click operations, swipe operations, etc. of the user on the shooting preview interface. The camera application also needs to draw and play a first switching animation and wait for the gallery application to complete the drawing and rendering of the large image preview interface. The activity of the camera application needs to continuously be in the onPause() state until waiting for the gallery application to complete the drawing and rendering of the large image preview interface. Only then will the activity of the camera application enter the next state.

[0220] Optionally, when the activity of the camera application is in the on pause() state, the camera application can callback the on create() state of the activity that binds the gallery application with a specific service in the camera application. Since the on create() state callback of the activity of the gallery application is in the foreground running state, binding the on create() state callback of the activity of the gallery application with a specific service in the camera application makes the electronic device 100 think that the camera application is also in the foreground running, ensuring that the CPU scheduling priority of the camera application does not decrease. This enables the camera application to possibly draw and render multiple animation frames in the first switching animation in a timely manner, avoiding frame drops and lags.

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

[0222] Figure 6A Step 5 and step 3 shown can be executed simultaneously, step 5 can also be executed before step 3, and step 5 does not need to wait for step 3 to complete before execution.

[0223] In Figure 6A after the gallery application draws and renders the large image preview interface, the activity of the camera application can switch from the on pause() state to the on stop() state. When the activity of the camera application is in the on stop() state, the camera application needs to destroy the initialization settings, such as turning off the camera, releasing plugins, stopping stream allocation, stopping stream startup, etc., to save the power consumption of the electronic device 100.

[0224] After determining that the large image preview interface is drawn and rendered, the camera application can send the playback progress of the first switching animation to the gallery application, enabling the gallery application to confirm whether to continue playing the first switching animation.

[0225] 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.

[0226] When the activity of the camera application is in the on stop() state, the shooting preview interface of the camera application is not visible.

[0227] Optionally, after the gallery application finishes drawing and rendering the large - image preview interface, if the first switching animation has not finished playing and the camera application stops playing the first switching animation, in order to smoothly switch to display 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 played out. Then, the activity of the gallery application switches to the onResume() state, and the gallery application displays the large - image preview interface within the window provided by the activity of the gallery application. For example, it displays a user interface similar to Figure 4E as shown.

[0228] In Figure 6A , after the gallery application draws and renders the large - image preview interface and the first switching animation is played out, the activity of the gallery application can switch from the onStart() state to the onResume() state, and the gallery application does not need to continue playing the first switching animation. When the activity of the gallery application is in the onResume() state, the gallery application can display the large - image preview interface within the window provided by the activity of the gallery application. For example, it displays a user interface similar to Figure 4E as shown.

[0229] It should be noted that Figure 6A the step numbers in Figure 6A do not represent the execution order of each step, and this application does not limit the execution order of each step in

[0230] Figure 6B 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.

[0231] In a possible implementation, if the gallery application is already open when jumping from the camera application to the gallery application, the electronic device 100 does not need to create the activity of the gallery application and directly obtains the activity of the gallery application.

[0232] In this case, as Figure 6B shown, in response to the user's input operation on the review control in the shooting preview interface, such as a click, the activity of the gallery application needs to be in the onStart() state. The activity of the gallery application enters the onStart() state again from the onStop() state. When the activity of the gallery application is in the onStart() 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. For exampleFigure 4F The user interface 5005 shown. Exemplarily, the elements in the large - image preview interface can be Figure 4F Multiple elements shown in the user interface 5005 shown.

[0233] 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 plugins, etc.

[0234] 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 in the large - image preview interface and the layout information of the elements.

[0235] Optionally, when the activity of the gallery application is in the on start() state, the gallery application also needs to send the drawing and rendering progress of the large - image preview interface to the camera application. In one possible implementation, the drawing and rendering progress of the large - image preview interface can be a message indicating that the drawing and rendering of the large - image preview interface is completed. After the gallery application completes the drawing and rendering of the large - image preview interface, the gallery application sends a message indicating that the drawing and rendering of the large - image preview interface is completed to the camera application. In other possible implementations, the drawing and rendering progress of the large - image preview interface carries a message indicating whether the drawing and rendering of the large - image preview interface is completed or not, and the drawing and rendering progress of the large - image preview interface can be sent to the camera application irregularly / periodically / at a certain time interval.

[0236] In this application, in response to a user's input operation on the review control in the shooting preview interface, such as a click, the activity of the camera application also 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 various click operations, swipe operations, etc. on the shooting preview interface. The camera application also needs to draw and play the first switching animation and wait for the gallery application to complete the drawing and rendering of the large - image preview interface. The activity of the camera application needs to continuously be in the on pause() state until waiting for the gallery application to complete the drawing and rendering of the large - image preview interface. Only then will the activity of the camera application enter the next state.

[0237] Optionally, when the activity of the camera application is in the onPause() state, the camera application can callback the onCreate() state of the activity that binds the gallery application with a specific service in the camera application. Since the callback of the onCreate() state of the activity of the gallery application is in the foreground running state, binding the onCreate() state callback of the activity of the gallery application with a specific service in the camera application makes the electronic device 100 think that the camera application is also in the foreground running, ensuring that the CPU scheduling priority of the camera application does not decrease. This enables the camera application to possibly draw and render multiple animation frames in the first switching animation in a timely manner, avoiding frame loss and stuttering.

[0238] Optionally, when the activity of the camera application is in the onPause() state, the camera application can also perform other operations, which are not limited in this application.

[0239] Figure 6B Step 5 and step 3 shown can be executed simultaneously, step 5 can also be executed before step 3, and step 5 does not need to wait until step 3 is completed before execution.

[0240] In Figure 6B After the gallery application draws and renders the large - image preview interface, the activity of the camera application can switch from the onPause() state to the onStop() state. When the activity of the camera application is in the onStop() state, the camera application needs to destroy the initialization settings, such as turning off the camera, releasing the plug - in, stopping the stream allocation, stopping the stream start, etc., to save the power consumption of the electronic device 100.

[0241] After determining that the large - image preview interface is drawn and rendered, the camera application can send the playback progress of the first switching animation to the gallery application, so that the gallery application can confirm whether to continue playing the first switching animation.

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

[0243] When the activity of the camera application is in the onStop() state, the shooting preview interface of the camera application is not visible.

[0244] Optionally, after the gallery application finishes drawing and rendering the large - image preview interface, if the first switching animation has not finished playing and the camera application stops playing the first switching animation, in order to smoothly switch to 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 played out. Then the activity of the gallery application switches to the on resume() state, and the gallery application displays the large - image preview interface within the window provided by the activity of the gallery application. For example, it displays a user interface similar to Figure 4E as shown.

[0245] In Figure 6B , after the gallery application draws and renders the large - image preview interface and the first switching animation is played out, the activity of the gallery application can switch from the on start() state to the on resume() state. When the activity of the gallery application is in the on resume() state, the gallery application can display the large - image preview interface within the window provided by the activity of the gallery application. For example, it displays a user interface similar to Figure 4E as shown.

[0246] It should be noted that Figure 6B the step numbers in Figure 6B do not represent the execution order of each step, and this application does not limit the execution order of each step in

[0247] III. Receive the 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.

[0248] 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 the user operation to jump from the gallery application to the camera application again.

[0249] Figures 7A - 7G Shows the UI diagram of the electronic device 100 receiving the user operation to jump to the camera application, jumping to the camera application, and displaying the shooting preview interface.

[0250] In some embodiments, the electronic device 100 can receive the user operation for the large - image editing interface in the gallery application and jump to the camera application. Exemplarily, the user operation can be a long - press and slide - down operation on the displayed picture in the large - image editing interface, or an input operation on the return option in the large - image editing interface, such as a click.

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

[0252] During the process of the electronic device 100 playing the second switching animation, the electronic device 100 can obtain the activity of the camera application and draw and render the shooting preview interface to be displayed in the camera application.

[0253] 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's waiting time.

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

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

[0256] Exemplarily, as Figures 7C - 7F shown, the electronic device 100 can sequentially play the animation frame 7001, animation frame 7002, animation frame 7003, and animation frame 7004 in the second switching animation.

[0257] As can be seen from animation frame 7001, animation frame 7002, animation frame 7003, and animation frame 7004, the animation frames are obtained by shrinking based on the picture 5006 in the user interface 5005. The animation elements that the electronic device 100 can obtain can be the picture 5006 in the 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 greater than the size of animation frame 7002, the size of animation frame 7002 is greater than the size of animation frame 7003, and the size of animation frame 7003 is greater than the size of animation frame 7004.

[0258] After the electronic device 100 finishes playing the second switching animation, the electronic device 100 can switch to display the shooting preview interface of the camera application. For example, the electronic device 100 can display Figure 7G the user interface 7005 shown. A preview image is displayed on the user interface 7005. The user interface 7005 can also be referred to as the shooting preview interface of the camera application. The user interface 7005 is similar to Figure 1B the user interface shown. The user can select a shooting mode within the user interface 7005, take a photo or shoot a video, select a shooting function in the quick function area 105, and adjust the focal length and other operations.

[0259] Optionally, Figures 7C - 7F the transparency of the background of the animation frames shown can become lower and lower until the transparency of the animation frames approaches 0 and the background elements of the animation frames are not visible. Then the electronic device 100 switches to display the shooting preview interface of the camera application to achieve a natural and smooth transition to the shooting preview interface of the camera application.

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

[0261] Optionally, the image parameters of the last animation frame in the second switching animation can also be the same as the image parameters in the shooting preview interface, and no jamming will occur. The image parameters include but are not limited to: image content, image size, image transparency, etc.

[0262] It should be noted that Figures 7C - 7F only some of the animation frames in the second switching animation are shown. The second switching animation may further include more animation frames. Figures 7C - 7F Also, only one display style of the second switching animation is shown. The second switching animation may also be other display styles, which are not limited in this application.

[0263] Figure 8 FIG. shows a schematic flowchart of a specific implementation method for jumping from a gallery application to a camera application.

[0264] S801. The gallery application receives an operation by the user on the large - image editing interface to jump to the camera application.

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

[0266] Optionally, the gallery application may also receive an operation by the user on the large - image preview interface to jump to the camera application. Exemplarily, the operation may be a long - press and downward - slide operation on the large - image preview interface. Then the second switching animation may include Figure 4D the animation frame 5003 as shown, Figure 4C the animation frame 5002 as shown, Figure 4B the animation frame 5001 as shown. The display style of the second switching animation is also not limited in this application.

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

[0268] The gallery application needs to wait for a period of time to jump to the camera application. To improve the user experience during the waiting - for - jump period, the gallery application may play the second switching animation to improve the user's visual experience.

[0269] Before playing the second switching animation, the gallery application needs to obtain the animation elements and animation parameters in the second switching animation. And based on the animation elements and animation parameters in the second switching animation, multiple animation frames are drawn and rendered.

[0270] An animation element may refer to the image content in an animation frame, and animation parameters may include, but are not limited to, information such as the size, transparency, position, etc. of the animation frame. Exemplarily, the animation element may be Figure 7A the picture 5006 shown.

[0271] In a possible implementation, the animation elements and animation parameters corresponding to each animation frame in the second switching animation are pre-stored in the electronic device 100, and the gallery application can directly obtain the animation elements and animation parameters corresponding to each animation frame in the second switching animation from the electronic device 100.

[0272] In other possible implementations, the gallery application can also calculate in real time the animation parameters corresponding to each animation frame in the second switching animation based on the duration of the second switching animation. Optionally, the second switching animation may include a preset duration, such as 300 ms. The camera application can determine the number of animation frames included in the second switching animation based on the display duration of each animation frame. For example, if the display duration of each animation frame is 50 ms, then the second switching animation includes 6 animation frames. Then, based on the animation parameters of the initial animation frame in the second switching animation, the animation parameters of the termination 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.

[0273] Optionally, the animation elements in different animation frames may be the same or different, and the present application does not make any limitation thereto.

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

[0275] After obtaining the animation elements and animation parameters in the switching animation, the gallery application also needs to send the animation elements and animation parameters in the second switching animation to the camera application. So that after the electronic device 100 jumps to the camera application and the second switching animation has not finished playing, the camera application can draw and render the unplayed animation frames based on the animation elements and animation parameters in the second switching animation. To ensure that the electronic device 100 can play the second switching animation completely and achieve a smooth and natural switch from the second switching animation to the shooting preview interface of the second application.

[0276] Optionally, S803 may also be executed before, after, or simultaneously with any one of the steps before S813.

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

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

[0279] After obtaining the animation elements and animation parameters in the second switching animation, the gallery application can 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.

[0280] Exemplarily, the multiple animation frames in the second switching animation can be Figures 7C - 7F the animation frame 7001, the animation frame 7002, the animation frame 7003, and the animation frame 7004 as shown.

[0281] In some embodiments, in response to a user operation on the large image preview interface, the electronic device 100 determines that the current user operation is a user operation to jump to the camera application. The 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 the foreground running priority is higher than the background running priority, the electronic device 100 may lower the CPU scheduling priority of the gallery application. After the CPU scheduling priority of the gallery application is lowered, the gallery application may not be able to draw and render multiple animation frames in the second switching animation in time, resulting in frame loss. To ensure that the gallery application can normally draw and render multiple animation frames in the second switching animation without frame loss, that is, to ensure that the CPU scheduling priority of the camera application is not lowered, the gallery application can bind to the on start() status callback of the activity of the camera application. Because the on start() status callback of the activity of the camera application is in the foreground running state, binding a specific service in the gallery application to the on start() status callback of the activity of the camera application makes the electronic device 100 think that the gallery application is also in the foreground running, ensuring that the CPU scheduling priority of the gallery application is not lowered.

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

[0283] 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.

[0284] Optionally, S806 can be executed in parallel with S804 and S805. Or S806 is executed at a moment before S804, or S806 is executed at a moment after S804. This application does not make a limitation on this.

[0285] Through this method, after detecting a user operation to jump to the camera application, the electronic device 100 can play the second switching animation and draw and render the shooting preview interface to be displayed by the camera application simultaneously, without waiting for the shooting preview interface to be drawn and rendered by the camera application to complete before starting to play the second switching animation. This shortens the latency of the electronic device 100 in playing the second switching animation, solves the problem of slow response of the electronic device 100 to the user operation of jumping to the camera application, saves the user's waiting time, and improves the user's visual experience.

[0286] In response to a user's operation on the large picture 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.

[0287] Since the camera application has been started and is running in the background, the activity of the camera application already exists. The electronic device 100 can directly obtain the activity of the camera application without creating it. The camera application can directly obtain the elements and element layout information in the shooting preview interface from the running memory of the camera application.

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

[0289] Optionally, the drawing and rendering progress of the shooting preview interface can be a message indicating that the drawing and rendering of the shooting preview interface is completed. After the camera application completes the drawing and rendering of the shooting preview interface, the camera application sends a message indicating that the drawing and rendering of the shooting preview interface is completed to the gallery application.

[0290] Optionally, the drawing and rendering progress of the shooting preview interface carries a message indicating whether the drawing and rendering of the shooting preview interface is completed or not. S807 can be executed irregularly / periodically / at a certain interval, and S807 can also be executed after the drawing and rendering of the shooting preview interface is completed.

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

[0292] During the process of the gallery application playing the second switching animation, the gallery application needs to confirm whether the shooting preview interface in the camera application is drawn and rendered completed.

[0293] Optionally, the gallery application can determine whether the large picture preview interface is drawn and rendered completed based on the drawing and rendering progress of the large picture preview interface sent by the camera application.

[0294] When the drawing and rendering progress of the large - image preview interface can be the message indicating the completion of the drawing and rendering of the shooting preview interface, in the case where the gallery application has not received the drawing and rendering progress of the shooting preview interface sent by the camera application, the gallery application can confirm that the shooting preview interface has not been drawn and rendered. In the case of receiving the drawing and rendering progress of the shooting preview interface sent by the camera application, the gallery application can confirm that the shooting preview interface has been drawn and rendered.

[0295] When the drawing and rendering progress of the shooting preview interface carries the message indicating the completion or non - completion of the drawing and rendering of the shooting preview interface. After receiving the drawing and rendering progress of the shooting preview interface, the gallery application can determine that the drawing and rendering of the shooting preview interface is completed based on the message indicating the completion of the drawing and rendering of the shooting preview interface carried in the drawing and rendering progress.

[0296] After the drawing and rendering of the shooting preview interface in the camera application is completed, the gallery application needs to stop drawing and playing the second switching animation.

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

[0298] In the case of confirming that the drawing and rendering of the shooting preview interface is completed, the camera application executes S811.

[0299] In the case of confirming that the drawing and rendering of the shooting preview interface is not completed, the camera application executes S804.

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

[0301] In the case where the gallery application confirms that the drawing and rendering of the shooting preview interface is not completed, the gallery application needs to confirm whether the second switching animation has been played completely and determine whether to continue playing the second switching animation or display the last animation frame in the second switching animation.

[0302] In the case of confirming that the drawing and rendering of the shooting preview interface is not completed and the second switching animation has not been played completely, the gallery application needs to continue to draw and render the unplayed animation frames in the second switching animation and play the unplayed animation frames in the second switching animation. The gallery application executes S8 and S805.

[0303] In the case of confirming that the drawing and rendering of the shooting preview interface is not completed but the second switching animation has been played completely, the gallery application needs to display the last animation frame in the second switching animation, that is, the camera application executes S810.

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

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

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

[0307] S812. The camera application needs to confirm whether the second switching animation has finished playing.

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

[0309] The playback progress of the second switching animation may indicate that the gallery application has played the m-th animation frame in the second switching animation. The second switching animation includes n animation frames, and m is less than or equal to n.

[0310] 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 finished playing.

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

[0312] When m is less than n, it indicates that the gallery application has not finished playing the second switching animation, and the (m + 1)-th to n-th animation frames in the second switching animation have not been played yet. The camera application continues to play the (m + 1)-th to n-th animation frames in the second switching animation, and S813 is executed.

[0313] 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 plugins, etc., to save the power consumption of the electronic device 100.

[0314] Destroying the initialization settings by the gallery application requires preempting CPU resources. If the gallery application destroys the initialization settings during the process of drawing and playing the second switching animation, it may cause the gallery application to be unable to schedule CPU resources in time to draw and render the animation frames, resulting in frame loss and causing lag. Through this method, when it is determined that the drawing and rendering of the shooting preview interface in the camera application are completed, the gallery application destroys the initialization settings, which can avoid the situation of lag when the gallery application plays the second switching animation due to frame loss.

[0315] In other embodiments, the destruction initialization setting of the gallery application may also be executed simultaneously with the gallery application playing the second switching animation, or the destruction initialization setting of the gallery application may be executed before the gallery application plays the second switching animation. This application does not make any limitation on this.

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

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

[0318] When it is determined that the second switching animation is not played out, the camera application may 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 obtained, and play the unplayed animation frames in the second switching animation.

[0319] Exemplarily, if the gallery application finishes playing Figure 7D the animation frame 7002 as shown, the drawing and rendering of the shooting preview interface are completed. At this time, the gallery application cannot continue to play Figure 7E the animation frame 7003 shown in Figure 7F and the animation frame 7004 shown in Figure 7G If the animation frames 7003 and 7004 are not continued to be played and directly switched to display Figure 7G the user interface 7005 shown, the user will visually feel a jump from the animation frame 7002 to the display of the user interface 7005. The image contents of the animation frame 7002 and the user interface 7005 are quite different, bringing the user an unnatural effect of image content jump and switching.

[0320] To avoid this situation, when the drawing and rendering of the shooting preview interface are completed, but the second switching animation is not played out, and at this time the gallery application cannot play the remaining animation frames. To ensure that the remaining animation frames in the second switching animation can be played out, so as to naturally and smoothly switch from the second switching animation to the display of the shooting preview interface in the camera application, the camera application can continue to draw and play the remaining animation frames to ensure a natural and smooth jump from the gallery application to the camera application and display the shooting preview interface in the camera application.

[0321] For example, the camera application may obtain the animation elements and animation parameters of the (m + 1)-th frame to the n-th frame of the second switching animation, draw and render the (m + 1)-th frame to the n-th frame of the second switching animation, and play the (m + 1)-th frame to the n-th frame of the second switching animation.

[0322] Exemplarily, m may be 2 and n may be 4, then Figure 7C the animation frame 7001 shown in Figure 7DThe animated frame 7002 shown in [the figure] is drawn and played by the gallery application. Figure 7E The animated frame 7003 shown in [the figure], Figure 7F The animated frame 7004 shown in [the figure] is drawn and played by the camera application. This ensures a smooth jump from the gallery application to the camera application and the display of the shooting preview interface in the camera application.

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

[0324] In the case where it is determined that the second switching animation has finished playing, then Figure 7C The animated frame 7001 shown in [the figure], Figure 7D The animated frame 7002 shown in [the figure], Figure 7E The animated frame 7003 shown in [the figure], Figure 7F The animated frame 7004 shown in [the figure] are all drawn and played by the gallery application. The camera application can directly display the large - image preview interface of the gallery application. For example, the camera application can display Figure 7G The user interface 7005 shown [in the figure]. In this case, the moment when the gallery application finishes playing the second switching animation and the moment when the camera application finishes drawing and rendering the shooting preview interface can be the same, or 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.

[0325] In S812, after the camera application finishes playing the unplayed animated frames in the second switching animation, that is, after playing the (m + 1)-th to the n-th animated frames in the second switching animation, the camera application can display the shooting preview interface. For example, the camera application can display Figure 7G The user interface 7005 shown [in the figure]. 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.

[0326] In some embodiments, the image content of the last animated frame in 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: pictures, picture sizes, picture transparencies, etc.

[0327] The reason is that when the drawing and rendering of the camera preview interface are completed, the gallery application determines that the second switching animation has also finished playing. If the moment when the gallery application finishes playing the second switching animation is before the completion moment of the camera application's drawing and rendering of the camera preview interface, the gallery application needs to stay and display the last animation frame in the second switching animation until the drawing and rendering of the camera preview interface are completed, and then the electronic device 100 switches to display the camera preview interface of the camera application. If the image parameters of the last animation frame in the second switching animation are quite different from those of the camera preview interface of the camera application, there will be an effect of image mutation and lag in the user's vision, resulting in a poor user experience. Based on this, the image parameters of the last animation frame in the second switching animation can be set to be the same as those of the image content of the camera preview interface in the camera application. In the case where the gallery application finishes playing the second switching animation before the completion moment of the camera application's drawing and rendering of the camera preview interface, the user will not feel the image switching, thus improving the user experience.

[0328] Figure 9 Fig. 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 gallery application to the camera application.

[0329] When jumping from the gallery application to the camera application, since the camera application has been started and is 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.

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

[0331] When the activity of the camera application is in the on start() state, the camera application also needs to perform initialization settings to enable the gallery application to run normally and implement related functions, such as operating to turn on the camera, load plugins, allocate streams, start streams, etc.

[0332] When the activity of the camera application is in the onStart() 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.

[0333] Optionally, when the activity of the camera application is in the onStart() state, the camera application also needs to send the drawing and rendering progress of the shooting preview interface to the gallery application. In one possible implementation, the drawing and rendering progress of the shooting preview interface can be a message indicating that the drawing and rendering of the shooting preview interface is completed. After the camera application completes the drawing and rendering of the shooting preview interface, the camera application sends a message indicating 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 indicating whether the drawing and rendering of the shooting preview interface is completed or not, and the drawing and rendering progress of the shooting preview interface can be sent to the gallery application irregularly / periodically / at a certain time interval.

[0334] 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 also needs to enter the onPause() state from the onResume() state. When the activity of the gallery application is in the onPause() state, the gallery application needs to grayscale the large - image preview interface so that the gallery application no longer responds to various click operations, swipe operations, etc. of the user on the large - image preview interface. The gallery application also needs to draw and play the second switching animation and wait for the camera application to complete the drawing and rendering of the shooting preview interface. The activity of the gallery application needs to continuously be in the onPause() state until waiting for the camera application to complete the drawing and rendering of the shooting preview interface. Only then will the activity of the gallery application enter the next state.

[0335] Optionally, when the activity of the gallery application is in the onPause() state, the gallery application can bind a specific service in the gallery application to the onStart() state callback of the activity of the bound camera application. Since the onStart() state callback of the activity of the camera application is in the foreground running state, binding a specific service in the gallery application to the onStart() state callback of the activity of the camera application makes the electronic device 100 think that the gallery application is also in the foreground running, ensuring that the CPU scheduling priority of the gallery application does not decrease. This enables the gallery application to possibly draw and render multiple animation frames in the second switching animation in a timely manner, avoiding frame loss and lag.

[0336] Optionally, when the activity of the gallery application is in the onPause() state, the gallery application can also perform other operations, which are not limited in this application.

[0337] Optionally, Figure 9 In , step 2 and step 5 can be executed simultaneously, or step 2 can be executed before step 5. Step 5 does not need to wait for step 2 to complete before execution.

[0338] In Figure 9 after the camera application draws and renders the shooting preview interface, the activity of the gallery application can switch from the onPause() state to the onStop() state. When the activity of the gallery application is in the onStop() state, the gallery application needs to destroy the initialization settings, such as releasing the rendering library, stopping querying the database, releasing plugins, etc., to save the power consumption of the electronic device 100.

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

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

[0341] When the activity of the gallery application is in the onStop() state, the large - image preview interface of the gallery application is not visible.

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

[0343] In Figure 9In [the above], after the camera application finishes drawing and rendering the shooting preview interface and the second switching animation finishes playing, the activity of the camera application can switch from the on start() state to the on resume() state. When the activity of the camera application is in the on resume() state, the camera application can display the shooting preview interface within the window provided by the activity of the camera application, for example, display Figure 7G the user interface 7005 shown.

[0344] It should be noted that Figure 9 the step numbers in [the above] do not represent the execution order of each step, and this application does not limit Figure 9 the execution order of each step in [the above] either.

[0345] IV. Closing the camera application.

[0346] In some embodiments, after the electronic device 100 receives a user operation to open the camera application, the electronic device 100 can also receive a user operation to close the camera application.

[0347] Figure 10 shows a schematic diagram of the state change process of the activity of the camera application when the electronic device 100 closes the camera application based on a user operation.

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

[0349] In response to the activity of the camera application being in the on pause() state, the camera application grays out the displayed shooting preview interface, so that the camera application cannot respond to various click operations, swipe operations, etc. performed by the user on the shooting preview interface.

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

[0351] After that, the activity of the camera application can switch from the on pause() state to the on stop() state.

[0352] In response to the activity of the camera application being in the on stop() state, the camera application needs to destroy the initialization settings, such as closing the camera, releasing the plug-in, stopping the stream allocation, stopping the stream start, etc.

[0353] In response to the activity of the camera application 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 saved in the running memory of the camera application.

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

[0355] After that, the activity of the camera application can switch from the on stop() state to the on destroy() state.

[0356] In response to the activity of the camera application being in the on destroy() state, the camera application needs to destroy the activity of the camera application. After destroying the activity of the camera application, the camera application stops displaying the shooting preview interface. Optionally, the camera application also needs to destroy the process of the camera application, release the running memory space of the camera application, etc., to shut down the camera application.

[0357] Figure 11 It is a schematic flowchart of a method for inter-application interaction provided by this application.

[0358] S1101. The first application displays the first user interface.

[0359] Exemplarily, the first application can be a camera application, and the first user interface can be Figure 4A the shooting preview interface shown.

[0360] Exemplarily, the first application can be a gallery application, and the first user interface can be Figure 7A the user interface 5005 shown, and the first user interface can also be Figure 4E the user interface shown.

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

[0362] Exemplarily, when the first application is a camera application, the first operation can be a click operation on Figure 4A the review control 104 shown.

[0363] Exemplarily, when the first application is a gallery application, the first operation can be a click operation on Figure 7A the return option 5007 shown, and the first operation can also be a long click and pull down operation on Figure 7B the picture 5006 shown, and the first operation can also be a long click and pull down operation on Figure 4E the picture shown.

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

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

[0366] Exemplarily, 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.

[0367] Exemplarily, 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.

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

[0369] S1104. Render a second user interface in the second application.

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

[0371] Exemplarily, when the second application is a gallery application, the second user interface may be Figure 4E the large - picture preview interface shown. In some embodiments, the second user interface may also be Figure 4F the large - picture editing interface shown.

[0372] Exemplarily, when the second application is a camera application, the second user interface may be Figure 7G the shooting preview interface shown.

[0373] S1105. Determine whether the second user interface is rendered completely.

[0374] S1106. When the second user interface is rendered completely, the first application stops playing the first animation; the second application displays the second user interface.

[0375] Through this method, when the electronic device receives a user operation to jump to the second application, the first application can play an animation, and the second application renders the second user interface to be displayed, without waiting for the second user interface to be drawn and rendered in the second application before playing the first animation. This shortens the latency of the electronic device in playing the first animation, solves the problem of slow response of the electronic device to the user operation of jumping to the second application, saves the user's waiting time, and improves the user's visual experience.

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

[0377] That is to say, when the electronic device receives a user operation to jump to the second application, the first application can play an animation, and at the same time the second application renders the second user interface to be displayed, without waiting for the second user interface to be drawn and rendered in the second application before playing the first animation.

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

[0379] Optionally, after the first application stops playing the first animation, the first application can send the playback progress of the first animation to the second application, so that the second application can confirm whether to continue playing the first animation.

[0380] When the first animation has been played, the second application does not need to continue playing the first animation and directly switches to display the second user interface. When the second user interface has not been played, the second application needs to continue playing the unplayed animation frames in the first animation, and after playing the unplayed animation frames in the first animation, the second application switches to display the second user interface. In this way, it can be ensured that the first animation is played and then the electronic device switches to display the second user interface, and it can be ensured that the switch from the first animation to the display of the second user interface is smooth.

[0381] In a possible implementation, when the second user interface has not been rendered completely, the method further includes: the first application confirms whether the first animation has been played; if the first animation has not been played, the first application renders the unplayed animation frames in the first animation and plays the unplayed animation frames. When the first animation has been played, the first application displays the third user interface, and the third user interface includes the last animation frame in the first animation.

[0382] Exemplarily, the third user interface may be Figure 4E the user interface shown.

[0383] 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 second user interface is rendered.

[0384] 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 may continue to play the first animation.

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

[0386] In this way, when the first animation has been played and the second user interface has not been rendered, the electronic device needs to continuously display the last animation frame in the first animation. Setting the image content of the last animation frame in the first animation to be the same or similar to the image content of the second user can ensure that the electronic device smoothly switches from the last animation frame in the first animation to displaying the second user interface without screen jumping.

[0387] In a possible implementation, after the first application receives a 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.

[0388] In this way, on the one hand, when the electronic device needs to use the second application, the electronic device can create a process of the second application, that is, start the second application, ensuring that the electronic device can normally use the second application. Compared with the solution of immediately creating a process of the second application when the electronic device starts the first application, it can save the memory space of the electronic device and avoid resource waste. On the other hand, when the process of the second application has not been created before, when the first application receives a user operation, the electronic device creates a process of the second application. Since the first application still needs to play the first animation, the electronic device can create a process of the second application at the same time without waiting for the electronic device to create a process of the second application before starting to play the first animation. That is to say, the first application plays the first animation and the electronic device creates a process of the second application in parallel.

[0389] In a possible implementation, 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.

[0390] In this way, it is possible to achieve a jump from the camera application to the gallery application.

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

[0392] In a possible implementation, the second user interface does not include controls in the gallery. In this way, it can be ensured that the image content of the last animation frame in the first animation is the same as or similar to the image content of the second user interface.

[0393] In a possible implementation, after the second application displays the second user interface, the method further 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.

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

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

[0396] 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 task items: closing the camera, releasing the plugin, stopping the stream allocation, and stopping the stream start.

[0397] In this way, when it is determined that the rendering of the second user interface is completed, the first application destroys the initialization settings, which can avoid the occurrence of stuttering when the first application plays the first animation due to frame loss.

[0398] This 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 Figure 11 an application interaction method as shown.

[0399] This application provides a computer-readable storage medium, including instructions. When the instructions run on an electronic device, the electronic device executes Figure 11 an application interaction method as shown.

[0400] This application provides a chip system, which includes one or more processors, and the processors are used to call computer instructions to enable the electronic device to execute Figure 11 an application interaction method as shown.

[0401] The present application provides a computer program product containing instructions, which, when the computer program product runs on an electronic device, causes the electronic device to execute Figure 11 an inter-application interaction method as shown.

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

[0403] Figure 12 A schematic diagram of the hardware structure of the electronic device 100 is shown.

[0404] The following takes the electronic device 100 as an example to specifically illustrate the embodiment. It should be understood that Figure 12 the shown electronic device 100 is only an example, and the electronic device 100 may have more or fewer components than Figure 12 those shown, may combine two or more components, or may have different component configurations. Figure 12 The various components shown may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0405] 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, a headphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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.

[0406] It can 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 in the figures, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0407] 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), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0408] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0409] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0410] 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, etc.

[0411] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, enabling the processor 110 to communicate with the touch sensor 180K through the I2C bus interface to implement the touch function of the electronic device 100.

[0412] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple groups of I2S buses. The processor 110 may be coupled to the audio module 170 through the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface to implement the function of answering a phone call through a Bluetooth headset.

[0413] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through the PCM bus interface. In some embodiments, the audio module 170 may also transmit an audio signal to the wireless communication module 160 through the PCM interface to implement the function of answering a phone call through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0414] The UART interface is a general-purpose serial data bus 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 generally 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 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through Bluetooth headphones.

[0415] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.

[0416] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the 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.

[0417] The USB interface 130 is an interface that complies with the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used for data transmission 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 AR devices, etc.

[0418] It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present invention is only illustrative and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

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

[0420] 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 the inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as the battery capacity, the number of battery cycles, and the battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0421] 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 modulation and demodulation processor, and the baseband processor, etc.

[0422] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

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

[0424] The modulation and demodulation processor may include a modulator and a demodulator. Among them, 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. Subsequently, the demodulator 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 transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor may be an independent device. In other embodiments, the modulation and demodulation processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.

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

[0426] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with the 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, etc. The GNSS may include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), BeiDou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).

[0427] Electronic device 100 implements a display function through a GPU, display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, connected to 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, which execute program instructions to generate or change display information.

[0428] 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 panel can also be made of an organic light-emitting diode (OLED), 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 1.

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

[0430] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera sensor. The optical signal is converted into an electrical signal, and the camera sensor transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also optimize the noise and brightness of the image through algorithms. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0431] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the sensor. The sensor can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The sensor converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it 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 standard RGB, YUV, etc. formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0432] 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, etc.

[0433] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0434] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as learning from the transmission pattern between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, voice recognition, text understanding, etc.

[0435] 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 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.

[0436] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes 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 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

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

[0438] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.

[0439] The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or hands-free calls through the speaker 170A.

[0440] The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be listened to by bringing the receiver 170B close to the human ear.

[0441] The microphone 170C, also known as the "microphone" or "transmitter", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak by bringing the 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 some other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also implement a noise reduction function. In some 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 sound source, and implement functions such as directional recording.

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

[0443] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor may include at least two parallel plates having conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, the instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.

[0444] 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., the x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the angle of jitter of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and enables the lens to offset the jitter 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 scenarios.

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

[0446] 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 leather 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 according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip, features such as automatic flip unlocking are set.

[0447] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0448] A distance sensor 180F for measuring distance. The electronic device 100 can measure distance by 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 rapid focusing.

[0449] 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 the photodiode to detect the 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 when the user holds the electronic device 100 close to the ear for a call, so as to automatically turn off the screen to achieve the purpose of power saving. The proximity light sensor 180G can also be used for automatic unlocking and locking of the holster mode and pocket mode.

[0450] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.

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

[0452] 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 in order 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 avoid abnormal shutdown of the electronic device 100 caused by low temperature. In other some embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0453] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and together with the display screen 194, they form a touch screen, also known as the "touch control screen". The touch sensor 180K is used to detect touch operations acting on it or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from where the display screen 194 is located.

[0454] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals of the vibrating bone mass of the human vocal part. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulsation signals. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone to form a bone conduction earphone. The audio module 170 can analyze the voice signal based on the vibration signals of the vibrating bone mass acquired by the bone conduction sensor 180M to implement the voice function. The application processor can analyze the heart rate information based on the blood pressure pulsation signals acquired by the bone conduction sensor 180M to implement the heart rate detection function.

[0455] The button 190 includes a power-on button, volume buttons, etc. The button 190 can be a mechanical button or a touch button. The electronic device 100 can receive button inputs and generate key signal inputs related to the user settings and function control of the electronic device 100.

[0456] The motor 191 can generate vibration prompts. The 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 playing, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0457] The indicator 192 can be an indicator light and can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0458] The SIM card interface 195 is used to connect the SIM card.

[0459] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, taking the Android system with a layered architecture as an example, the software structure of the electronic device 100 will be exemplarily described.

[0460] Figure 13 It is the software structure block diagram of the electronic device 100 in the embodiments of the present invention.

[0461] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0462] The application layer may include a series of application packages.

[0463] As Figure 13 shown, the application packages may include applications such as a camera, a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth, music, a video, a short message, etc.

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

[0465] As Figure 13 shown, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, etc.

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

[0467] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and answered calls, browsing history and bookmarks, a phone book, etc.

[0468] The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.

[0469] The telephone manager is used to provide the communication function of the electronic device 100. For example, the management of call states (including connection, disconnection, etc.).

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

[0471] The notification manager enables applications to display notification information in the status bar. It can be used to convey informative messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application, or a notification that appears in the form of a dialog window on the screen. For example, it can prompt text information in the status bar, emit a prompt sound, vibrate the electronic device, and blink the indicator light, etc.

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

[0473] The core libraries contain two parts: one part is the functional functions that the Java language needs to call, and the other part is the core libraries of Android.

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

[0475] The system libraries can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.

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

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

[0478] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0479] The 2D graphics engine is the drawing engine for 2D drawing.

[0480] The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a 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; It is determined 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 second application finishes playing the unplayed animation frames, 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 to 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 to 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 to 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, wherein 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 the 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 the controls in the gallery.

11. The method according to any one of claims 7-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 plugin, 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 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 the method according to 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 according to 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 according to any one of claims 1-11.

Citation Information

Cited By

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

    EP4730123A1

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

    WO2025153005A1