Method for switching applications and electronic device

By transmitting real-time displacement data of sliding gesture operations across applications and hanging the application to be started in a fully transparent state in the background when switching applications, the problem of screen splitting during application switching is solved, and smooth connection and unified and smooth motion effects are achieved.

CN118426884BActive Publication Date: 2025-04-01HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410404226.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-08
Publication Date
2025-04-01
Estimated Expiration
2043-11-08

AI Technical Summary

Technical Problem

When the prior art is switched on application, it leads to a sense of splitting and innate naturalness in the picture, affecting the user's usage perception.

Method used

By transmitting real-time displacement data of sliding gesture operations across applications, smooth connection of dynamic effects is achieved, and the application to be started is first hung in the background in a fully transparent state when switching applications, reducing response time.

Benefits of technology

It realizes the unified smoothness and smoothness of the dynamic effects during application switching, avoids the sense of splitting the picture and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118426884B_ABST
    Figure CN118426884B_ABST
Patent Text Reader

Abstract

The present application provides a method for switching applications and an electronic device, the method comprising: running and displaying a first page of a first application on an electronic device; executing an animation of exiting the first application and starting a second application in response to a user's sliding gesture operation on the first page; when it is detected that the distance slid from the starting point by the sliding gesture operation is greater than or equal to a false touch distance threshold, performing the following operations: pulling up the second application in the background of the electronic device, making the second application exist in a fully transparent state, and executing an exit animation of the first application; when it is detected that the distance slid from the starting point by the sliding gesture operation is greater than or equal to a first distance threshold, sending the real-time displacement parameter of the sliding gesture operation on the first page to the second application; and executing the startup animation of the second application based on the received real-time displacement parameter. This solution achieves the harmonious unification of the two animations and the smooth connection of the animations by allowing the two applications to share the displacement parameters.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application submitted to the State Intellectual Property Office on November 8, 2023, with application number 202311476752.0 and application name "Method and electronic device for switching applications". Technical Field

[0002] The present application relates to the technical field of electronic devices, and in particular to a method for switching applications and an electronic device. Background Art

[0003] Launching applications by touching and clicking icons has become very common, and both launching and exiting applications are equipped with corresponding animations.

[0004] In traditional solutions, when switching between two applications, the exit animation of one application and the startup animation of the other application are played by the two applications respectively, which easily creates a sense of fragmentation in the screen. For example, when opening the search application by pulling down from the desktop application, not only is the screen fragmented and unnatural, but there may also be overlapping and chaotic screens, which affects the user's experience.

[0005] Therefore, how to achieve a more unified and smoother animation process when switching applications is a technical problem that needs to be solved urgently. Summary of the invention

[0006] The present application provides a method for switching applications and an electronic device, which can achieve a more unified and smoother dynamic effect process when switching applications.

[0007] In a first aspect, a method for switching applications is provided, the method comprising: running a first application on an electronic device and displaying a first page of the first application; in response to a user's sliding gesture operation in the first page starting from any point in an area where gesture sliding can be performed, executing an animation of exiting the first application and an animation of starting a second application, the sliding gesture operation being used to trigger the process of exiting the first application and starting the second application; during the execution of the animation of exiting the first application and starting the second application, when it is detected that the distance slid by the sliding gesture operation from the starting point is greater than or equal to a false touch distance threshold, performing the following operations: pulling up the second application in the background of the electronic device and making the second application exist in a fully transparent state, and executing the exit animation of the first application; during the execution of the animation of exiting the first application and starting the second application, when it is detected that the distance slid by the sliding gesture operation from the starting point is greater than or equal to a first distance threshold, sending a real-time displacement parameter of the sliding gesture operation on the first page to the second application, and executing the startup animation of the second application based on the received real-time displacement parameter, the first distance threshold being set according to the sum of the sliding distance required for the exit animation of the first application and the false touch distance threshold.

[0008] In the technical solution of the present application, the real-time displacement data of the sliding gesture operation is transmitted across applications to another application to achieve smooth connection of the animation effect, and the application to be started is first hung in the background in a fully transparent state, which can shorten the response time of the second application to the sliding gesture operation, which is equivalent to preparing in advance. In this way, as soon as the exit animation of the first application ends, the startup animation of the second application can be started immediately, achieving seamless connection, so that the playback of the animation effect is uniform, smooth and smooth during the entire process of switching applications.

[0009] In combination with the first aspect, in certain implementations of the first aspect, when the scheme also includes the step of synchronously starting to establish a communication channel for cross-process connection between the first application and the second application while launching the second application in the background, the step includes, during the execution of the animation of exiting the first application and the animation of starting the second application, when it is detected that the distance slid from the starting point by the sliding gesture operation is greater than or equal to the first distance threshold, sending the real-time displacement parameters of the sliding gesture operation on the first page to the second application, and executing the startup animation of the second application based on the received real-time displacement parameters. It can include: when the communication channel is successfully established, sending the real-time displacement parameters to the second application through the communication channel, so that the second application executes the startup animation of the second application based on the received real-time displacement parameters; or, when the communication channel is not successfully established, determining to execute the startup animation of the second application according to preset parameters based on the distance slid from the starting point by the sliding gesture operation, or switching to executing the reverse animation of the exit animation of the first application.

[0010] In this implementation, two possibilities are taken into account: the communication channel is established successfully or not. If it is established successfully, the real-time displacement parameters can be transmitted through the channel to achieve seamless continuation of the animation effect. If it is not established successfully, the actual sliding distance will be used to decide whether to continue to complete the startup animation according to the preset parameters or to terminate the startup and restore the first application to the original page display state.

[0011] It should also be understood that the reverse animation refers to the reverse execution of the animation that has been executed, so the startup animation and the exit animation cannot be directly understood as the reverse effects of each other. For example, this is equivalent to canceling the exit of the first application, rather than restarting the first application, so it is more appropriate to call it the reverse animation of executing the exit animation of the first application. Although the process presentation is similar to the startup animation, the process is different. For example, the desktop is a relatively special application, and generally, startup animations are rarely set. Generally, it is displayed immediately after booting. Or, some electronic devices will play an animation related to the product model, and such animation will obviously not be played when the exit is canceled. In short, for applications where the startup animation and exit animation are in an opposite relationship, they can be regarded as each other's reverse animation, but there are many applications where the startup animation and exit animation are not in an opposite relationship, and the animation types may be different. In this case, it is obviously more accurate to describe them as reverse animations.

[0012] In one example, when the communication channel is not successfully established, the step of determining whether to execute the startup animation of the second application according to preset parameters based on the distance slid from the starting point by the sliding gesture operation, or switching to executing the reverse animation of the exit animation of the first application may include: when the distance slid from the starting point by the sliding gesture operation is greater than or equal to the second distance threshold, executing the startup animation of the second application according to the preset parameters of the startup animation of the second application, the second distance threshold is greater than the first distance threshold and less than the third distance threshold, and the third distance threshold is determined based on the sum of the distance required for the second application to execute the startup animation and the first distance threshold; or, when the distance slid from the starting point at the end of the sliding gesture operation is less than the second distance threshold and greater than the first distance threshold, switching to executing the reverse animation of the exit animation of the first application. In this example, when the connection is not established successfully, if the swiping distance is long enough, it means that either the swiping is too fast to establish the connection, or there are other problems that make it impossible to establish the connection in a short time. In other words, it is expected that the connection will not be established even after the sliding is completed, so you should not wait for it to be established. Therefore, the startup animation will be executed according to the preset parameters, which is equivalent to continuing to start according to the backup plan. If the swiping distance is not long enough, the startup of the second application will be terminated and the page of the first application will be restored, that is, the reaction effect of the exit animation of the first application will be executed. It should also be understood here that because the premise is that the establishment is not successful, and the second distance threshold is greater than the first distance threshold, it means that after the exit animation of the first application ends, a certain distance (from the first distance threshold to the second distance threshold) is waited for, but it cannot wait forever, so at this time it is decided whether to continue to start the second application or restore to the first application according to the sliding distance. For the second case, if the distance is not enough and the establishment is not successful, it means restoring to the first application. At this time, since the exit animation of the first application has been completed, and the second application has not started to execute the startup animation because it has not been successfully established, the reverse animation is only the reverse animation of the exit animation of the first application, and there is no reverse animation of the startup animation of the second application.

[0013] In another example, the above-mentioned step of sending the real-time displacement parameters to the second application through the communication channel when the communication channel is successfully established, so that the second application executes the startup animation of the second application based on the received real-time displacement parameters, may include: after the communication channel is successfully established, when it is detected that the sliding gesture operation ends, according to the progress of the startup animation executed by the second application, determining to continue to execute the startup animation of the second application according to the real-time displacement parameters last transmitted to the second application, or switching to executing the reverse animation of the executed part of the startup animation of the second application and continuing to execute the reverse animation of the exit animation of the first application. In this example, under the premise that the connection is successfully established, the displacement parameters can be shared in real time so that the startup animation of the second application can be seamlessly continued to play (executed). If the sliding is still on until the startup animation of the second application is finished, the startup animation can be executed continuously. However, if the sliding is ended before the startup animation of the second application is finished (that is, the hand is raised and the sliding gesture operation is finished), the animation will still be interrupted. Therefore, the situation can be subdivided more finely at this time. If the second application has executed a considerable part of the startup animation when the sliding ends, the startup animation of the second application can continue to execute. However, since there is no update of the real-time displacement parameters, the subsequent execution function should continue to execute with reference to the last real-time displacement parameters. If the second application has also executed a part when the sliding ends, but not much, the reverse animation of the executed part of the startup animation of the second application can be executed, and after executing this part, the reverse animation of the exit animation of the first application can be executed, thereby restoring to the display page (first page) of the first application.

[0014] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: when it is detected that the distance slid from the starting point at the end of the sliding gesture operation is less than the first distance threshold and greater than the false touch distance threshold, the reverse animation of the executed part of the exit animation of the first application is executed. In this implementation, the slid distance is not enough to wait until the exit animation of the first application is finished. At this time, the startup animation of the second application has not started, and there is no need to consider the channel establishment result, so the reverse animation of the executed part of the exit animation can be directly executed. As mentioned above, although the reverse animation is similar to the startup animation, it is not the same as the startup animation. For example, it is not a complete exit animation here, so it is more reasonable to call it a reverse animation. In this case, since the distance is not enough to wait for the startup animation of the second application to play, the second application will not be started, and the state of the first page of the first application must be restored.

[0015] In combination with the first aspect, in some implementations of the first aspect, the method further includes: adjusting the animation parameters of the exit animation of the first application and / or the startup animation of the second application according to the processing capacity of the electronic device and / or the preconfigured rules; the preconfigured rules include a variety of electronic device models and the corresponding animation parameters of each model. There are many kinds of application switching animations, and there are also cases where multiple animations are superimposed, and the more complex the animations, the higher the software and hardware requirements for the electronic device. Therefore, the animations when switching applications can be customized for different electronic devices by layering animations. For example, when the processing capacity of the electronic device is high, complex and diverse animations can be used, and the change step size of each animation can be smaller, so that the change process has a more infinite feeling. When the processing capacity of the electronic device is low, a simple and single animation can be used, and the change step size of the animation can be larger, so that the change process is subdivided more roughly to prevent the execution process from jamming. You can also set the animation parameters according to the model of the electronic device, that is, make a table, or establish pre-configuration rules for different models and their corresponding animation parameters (equivalent to the form of switch control). As long as the model of the electronic device is determined, the corresponding animation parameters can be executed.

[0016] In one example, the animation parameter includes at least one of the number of animations, the type of animation, and the change step of the animation.

[0017] In another example, the processing capability of the electronic device is positively correlated with the number of the animation effects; the processing capability of the electronic device is negatively correlated with the change step size of the animation effects.

[0018] In another example, the animation types include position shifting effects, blurring effects, and transparent effects.

[0019] In one implementation, the first application is a desktop or a negative one screen, and the second application is a search page.

[0020] In an example of this implementation, the method further includes: when the startup animation of the second application is executed, displaying the home page of the search page, and loading a keyboard input pop-up window on the home page of the search page.

[0021] The sliding gesture operation is a press-and-slide gesture operation. During the sliding process, the finger keeps pressing the screen. Once the hand is lifted so that the finger is no longer pressing the screen, the sliding ends. The electronic device can match different response actions according to the sliding distance. The sliding direction can include sliding up, sliding down, sliding left, sliding right, etc.

[0022] In one implementation, the sliding direction of the sliding gesture operation is downward.

[0023] In a second aspect, a device for executing a switching application is provided, the device comprising a unit composed of software and / or hardware for executing any one of the methods of the first aspect.

[0024] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device is enabled to implement any one of the methods of the first aspect.

[0025] In a fourth aspect, a chip is provided, comprising a processor, wherein the processor is used to read and execute a computer program stored in a memory, and when the computer program is executed by the processor, the electronic device in which the chip is located can implement any one of the methods of the first aspect.

[0026] Optionally, the chip also includes a memory, and the memory is electrically connected to the processor.

[0027] Optionally, the chip may also include a communication interface.

[0028] According to a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by an electronic device, any one of the methods according to the first aspect can be implemented.

[0029] In a sixth aspect, a computer program product is provided, which includes a computer program, and when the computer program is executed by an electronic device, it can implement any one of the methods of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a schematic diagram of the traditional solution's animation execution process of switching from the desktop to the search page.

[0031] Figure 2 It is a schematic flowchart of a method for switching applications in an embodiment of the present application.

[0032] Figure 3 It is a schematic diagram of the principle of a method for switching applications in an embodiment of the present application.

[0033] Figure 4 It is a schematic diagram of the principle of playing a dynamic effect as the sliding distance changes in an embodiment of the present application.

[0034] Figure 5 It is a schematic flowchart of another switching application in an embodiment of the present application.

[0035] Figure 6 It is a schematic flowchart of another execution process of switching applications in an embodiment of the present application.

[0036] Figure 7 and Figure 8 It is a schematic diagram of an execution process of switching applications in an embodiment of the present application.

[0037] Fig. 9 It is a schematic diagram of a device for switching applications according to an embodiment of the present application.

[0038] Fig.10 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0039] The scheme of the embodiment of the present application is introduced below with reference to the accompanying drawings.

[0040] Figure 1 This is a schematic diagram of the traditional solution's animation execution process of switching from the desktop to the search page. Figure 1 This article mainly gives an example of the situation where the screen is not harmonious and smooth when the animation of two applications is executed when switching between applications. In this example, we take the example of switching from the desktop application to the search application. Figure 1 As shown, in the desktop page shown in interface 101, there are some icons, and the user can click the application icon on the desktop to enter the corresponding application. It should also be understood that the desktop is actually an application, which is used to manage these icons and display various information. Assuming that the user presses and slides down anywhere on the desktop, that is, performs a sliding gesture operation, or a pull-down operation, it can trigger the start of the search page. The search page is also an application, so this process is the process of switching from one application to another.

[0041] The user starts from point A in interface 101 and presses and slides down in the direction indicated by the arrow on the interface to trigger the start of the search page. First, in order to prevent accidental touches, a distance range will be set. Only when this limit is exceeded will it be considered that there is an intention to switch. Here, point B corresponds to the example of this distance limit value. That is, when the sliding distance is between AB, the electronic device will not start the search page. It starts from point B and confirms that it is not an accidental touch before starting the search page. When starting the search page, the desktop application needs to be exited. Therefore, during the switching process of this application, the desktop will make the desktop page blur and gradually transparent, and may also make the downward icon push the screen. The dynamic effect, and the search page will also make the page from transparent to opaque, and the dynamic effect of the picture gradually moving down to display on the screen. As shown in interface 103, it is the displacement and de-transparency dynamic effect of the search application (app), which makes the picture of the search page gradually deepen and be pushed into the screen. At the same time, the desktop app also has a transparent dynamic effect, and the picture gradually becomes completely transparent, so that it is no longer visible to the naked eye until the desktop picture is completely transparent. Assuming that the position corresponding to the execution of the two animation effects is point C shown in interface 103, then when the user stops sliding down after point C and lifts his finger, the screen shown in interface 104 will be presented. In interface 104, the screen of the desktop app has disappeared, and only a completely opaque search page is left.

[0042] It can be seen from interface 103 that there is a situation where two animations are "fighting" because the animations of the two applications are executed independently, the desktop executes the exit animation, and the search executes the startup animation, resulting in a poor look and feel of the entire switching process, and the picture is not harmonious and smooth.

[0043] In view of the above problems, an embodiment of the present application proposes a new method for switching applications, which realizes the harmonious unification of two animation effects by allowing the two applications to share displacement parameters.

[0044] Figure 2 is a schematic flow chart of a method for switching applications in an embodiment of the present application. Figure 2 Each step is described below.

[0045] S201: Run a first application on an electronic device and display a first page of the first application.

[0046] The electronic device may be any type of touch screen electronic device such as a mobile phone, a tablet computer, a touch screen laptop computer, etc., as long as it can perform sliding gesture operations and respond to and run applications.

[0047] The first application may be able to start another application by sliding gestures on its running page. In the embodiment of the present application, for ease of understanding, the first application is mainly taken as a desktop application or a negative screen. The first page may be the homepage or other page of the first application. When the first application is a desktop application, the first page may be a desktop page including many application icons. Desktop applications may include one or more pages to facilitate user icon management. When the first application is a negative screen, the negative screen may include desktop cards for multiple services, which can be regarded as an application for managing cards. Cards are equivalent to the advancement of icons. In addition to having the same function of starting applications as icons, some necessary information can also be directly displayed, such as weather, time, exercise steps, etc., so that users can see these necessary information without opening the application. When the first application is a negative screen, the first page may be a page including these service cards. The negative screen can be opened by switching pages by swiping left or right on the desktop page, and the right swipe gesture is more common.

[0048] In one implementation, the first application is a desktop or a negative one screen, and the second application is a search page.

[0049] In an example of this implementation, the method further includes: when the startup animation of the second application is executed, displaying the home page of the search page, and loading a keyboard input pop-up window on the home page of the search page.

[0050] S202. In response to a sliding gesture operation performed by the user on the first page starting from any point in the sliding gesture area, an animation of exiting the first application and an animation of starting the second application are executed, and the sliding gesture operation is used to trigger the process of exiting the first application and starting the second application.

[0051] The area where gesture sliding can be performed can be the area without controls containing special functions, such as removing the top area used to slide down to pull out a quick-launch function list or message notification, such as removing the bottom area used to slide up to pull out application snapshots saved in the background, etc.

[0052] The sliding gesture operation is a press-and-slide gesture operation. During the sliding process, the finger keeps pressing the screen. Once the hand is lifted so that the finger is no longer pressing the screen, the sliding ends. The electronic device can match different response actions according to the sliding distance. The sliding direction can include sliding up, sliding down, sliding left, sliding right, etc.

[0053] In one implementation, the sliding direction of the sliding gesture operation is downward.

[0054] When an application is exited, the exit animation will be executed, which can also be understood as the corresponding animation when exiting the application. When an application is launched, the launch animation will also be executed, which can also be understood as the corresponding animation when launching the application.

[0055] When a sliding gesture operation is detected, the application switching can be triggered, which here means exiting the first application and starting the second application.

[0056] An application may include many processes, and startup and shutdown also depend on processes, which can be called startup process and shutdown (exit or end) process respectively.

[0057] S203. During the execution of the animation of exiting the first application and the animation of starting the second application, when it is detected that the distance slid by the sliding gesture operation from the starting point is greater than or equal to the false touch distance threshold, the following operations are performed: pull up the second application in the background of the electronic device and make the second application exist in a fully transparent state, and execute the exit animation of the first application.

[0058] Since the electronic device is a touch screen, touching the screen may have a corresponding response. For example, touching the fingerprint control can be used to start the screen, and any sliding after turning the screen off can start the desktop application. When holding an electronic device, it is inevitable to touch the electronic device. In order to avoid unnecessary responses to false touches, a false touch distance threshold can be set. Only when the sliding distance is greater than or equal to the false touch distance threshold will it be considered that the user is indeed performing a sliding gesture operation. It should also be understood that sliding also involves the sliding direction. Which application will be opened and how to switch to the next application will also depend on the preset sliding direction. For example, switching from the desktop or the negative one screen to the search page, the most common way is to slide down, that is, pull down.

[0059] The false touch distance threshold may be set by the manufacturer of the electronic device according to the actual performance of the electronic device, or may be set according to industry technical standards, etc., and there is no limitation. In one example, the false touch distance threshold is 20 pixels (dp).

[0060] In the traditional solution of switching to search on the desktop, when it is detected that the sliding distance exceeds the false touch distance threshold, the desktop application will start to execute the exit animation at the same time, and the search application will also start to execute the startup animation at the same time, resulting in the intersection of the two animations and the problem of unsmooth screen.

[0061] In the embodiment of the present application, it is hoped that the entire animation effect will be played more smoothly, so the exit animation of the previous application is executed first, and then the startup animation of the second application is executed. In order to make the entire execution process more compact and seamless, the next application can be pulled up when the exit animation of the previous application is started, which is equivalent to preparing the second application first. Once the previous exit animation ends, the startup animation will be executed quickly to achieve seamless connection. In addition, in order to prevent the screen of the second application from interfering with the previous exit animation, it is first allowed to exist in a fully transparent and invisible state (the user cannot see this screen).

[0062] In one implementation, launching the second application may be performed by starting an animation (startActivity) module.

[0063] In another implementation, when it is detected that the sliding distance exceeds the false touch distance threshold, the above method also includes: while pulling up the second application in the background, synchronously starting to establish a communication channel for a cross-process connection between the first application and the second application. In this implementation, the cross-process connection is also synchronously established, which is also a preparation for the execution of subsequent steps, because the exit animation of the next application can be executed after the startup animation of the previous application is executed. In order to make the connection better, it is necessary for the second application to also know the sliding distance, and the establishment of a cross-process connection is to enable the subsequent transmission of displacement parameters. For security reasons, different applications on electronic devices are often isolated from each other. Starting an application and exiting an application will correspond to one or more processes to execute respectively, and these processes are isolated between applications. Therefore, in the above implementation, data sharing between applications is achieved by requesting to establish a cross-process connection between two applications.

[0064] In one example, the communication channel for the cross-process connection here is binder communication. Since binder communication is a medium that many applications may use for cross-application communication, it is not suitable for always connecting, that is, long-term connection, but it is established when it is used, and it is closed when it is used up. It can be understood that it is necessary to request to establish a connection every time it is needed. Therefore, for the scenario of this application, there may be too short a time or insufficient sliding distance to establish a good connection. For example, the user quickly slides a long enough distance, and there is not enough time to establish a good connection. For example, after the user slides a certain distance to start to establish a channel, he raises his hand after sliding a distance that is not long enough, resulting in no need to establish a connection again, or, resulting in insufficient time to establish a good connection. These situations will lead to failure to establish a successful connection. It should also be understood that in the embodiment of the present application, the failure of the communication channel to establish a successful connection (that is, the cross-process connection failed, or it is called the failure to successfully establish a cross-process connection) mainly refers to sliding too fast or sliding too short, resulting in insufficient time, and there is no time to establish a good connection. Another possibility is that other processes are already calling the same communication channel to establish connections between other applications, but this situation will not occur under normal circumstances, because when the electronic device is processing the process of switching the current application, there are other ongoing processes in the background that need to occupy the communication channel. The possibility is very low, unless there is confusion, it will not be designed in this way. Similarly, the failure to establish due to a fault is also less likely. Even the latter two possibilities will only bring about the result of an established fact, that is, if the connection is not completed by the time or distance reserved for the connection, then it will be handled according to another processing logic. In short, the solution of the present application, although it mainly considers that the sliding is too fast and there is not enough time to connect, the connection failure caused by other reasons will still be included in the execution steps of the solution of the present application, and will not cause the inability to proceed to subsequent steps.

[0065] S204. During the execution of the animation of exiting the first application and the animation of starting the second application, when it is detected that the distance slid from the starting point of the sliding gesture operation is greater than or equal to the first distance threshold, the real-time displacement parameters of the sliding gesture operation on the first page are sent to the second application, and based on the received real-time displacement parameters, the startup animation of the second application is executed, and the first distance threshold is set according to the sum of the sliding distance required for the exit animation of the first application and the false touch distance threshold.

[0066] In one implementation, when the scheme also includes the step of synchronously starting to establish a cross-process communication channel between the first application and the second application while launching the second application in the background, step S204 may include: when the communication channel is successfully established, sending the real-time displacement parameter to the second application through the communication channel, so that the second application executes the startup animation of the second application based on the received real-time displacement parameter; or, when the communication channel is not successfully established, determining to execute the startup animation of the second application according to the preset parameters according to the distance slid from the starting point by the sliding gesture operation, or switching to execute the reverse animation of the exit animation of the first application. In this implementation, the two possibilities of successful and unsuccessful establishment of the communication channel are considered. If the communication channel is established successfully, the real-time displacement parameter can be transmitted through the channel to achieve seamless connection of the animation. If the communication channel is not established successfully, it will be determined whether to continue to complete the startup animation according to the preset parameters or terminate the startup and restore the first application to the original page display state according to the actual sliding distance.

[0067] It should also be understood that the reverse animation refers to the reverse execution of the animation that has been executed, so the startup animation and the exit animation cannot be directly understood as the reverse effects of each other. For example, this is equivalent to canceling the exit of the first application, rather than restarting the first application, so it is more appropriate to call it the reverse animation of executing the exit animation of the first application. Although the process presentation is similar to the startup animation, the process is different. For example, the desktop is a relatively special application, and generally, startup animations are rarely set. Generally, it is displayed immediately after booting. Or, some electronic devices will play an animation related to the product model, and such animation will obviously not be played when the exit is canceled. In short, for applications where the startup animation and exit animation are in an opposite relationship, they can be regarded as each other's reverse animation, but there are many applications where the startup animation and exit animation are not in an opposite relationship, and the animation types may be different. In this case, it is obviously more accurate to describe them as reverse animations.

[0068] In one example, when the communication channel is not successfully established, the step of determining whether to execute the startup animation of the second application according to preset parameters based on the distance slid from the starting point by the sliding gesture operation, or switching to executing the reverse animation of the exit animation of the first application may include: when the distance slid from the starting point by the sliding gesture operation is greater than or equal to the second distance threshold, executing the startup animation of the second application according to the preset parameters of the startup animation of the second application, the second distance threshold is greater than the first distance threshold and less than the third distance threshold, and the third distance threshold is determined based on the sum of the distance required for the second application to execute the startup animation and the first distance threshold; or, when the distance slid from the starting point at the end of the sliding gesture operation is less than the second distance threshold and greater than the first distance threshold, switching to executing the reverse animation of the exit animation of the first application. In this example, when the connection is not established successfully, if the swiping distance is long enough, it means that either the swiping is too fast to establish the connection, or there are other problems that make it impossible to establish the connection in a short time. In other words, it is expected that the connection will not be established even after the sliding is completed, so you should not wait for it to be established. Therefore, the startup animation will be executed according to the preset parameters, which is equivalent to continuing to start according to the backup plan. If the swiping distance is not long enough, the startup of the second application will be terminated and the page of the first application will be restored, that is, the reaction effect of the exit animation of the first application will be executed. It should also be understood here that because the premise is that the establishment is not successful, and the second distance threshold is greater than the first distance threshold, it means that after the exit animation of the first application ends, a certain distance (from the first distance threshold to the second distance threshold) is waited for, but it cannot wait forever, so at this time it is decided whether to continue to start the second application or restore to the first application according to the sliding distance. For the second case, if the distance is not enough and the establishment is not successful, it means restoring to the first application. At this time, since the exit animation of the first application has been completed, and the second application has not started to execute the startup animation because it has not been successfully established, the reverse animation is only the reverse animation of the exit animation of the first application, and there is no reverse animation of the startup animation of the second application.

[0069] In another example, the above-mentioned step of sending the real-time displacement parameters to the second application through the communication channel when the communication channel is successfully established, so that the second application executes the startup animation of the second application based on the received real-time displacement parameters, may include: after the communication channel is successfully established, when it is detected that the sliding gesture operation ends, according to the progress of the startup animation executed by the second application, determining to continue to execute the startup animation of the second application according to the real-time displacement parameters last transmitted to the second application, or switching to executing the reverse animation of the executed part of the startup animation of the second application and continuing to execute the reverse animation of the exit animation of the first application. In this example, under the premise that the connection is successfully established, the displacement parameters can be shared in real time so that the startup animation of the second application can be seamlessly continued to play (executed). If the sliding is still on until the startup animation of the second application is finished, the startup animation can be executed continuously. However, if the sliding is ended before the startup animation of the second application is finished (that is, the hand is raised and the sliding gesture operation is finished), the animation will still be interrupted. Therefore, the situation can be subdivided more finely at this time. If the second application has executed a considerable part of the startup animation when the sliding ends, the startup animation of the second application can continue to execute. However, since there is no update of the real-time displacement parameters, the subsequent execution function should continue to execute with reference to the last real-time displacement parameters. If the second application has also executed a part when the sliding ends, but not much, the reverse animation of the executed part of the startup animation of the second application can be executed, and after executing this part, the reverse animation of the exit animation of the first application can be executed, thereby restoring to the display page (first page) of the first application.

[0070] For example, assuming that the startup animation of the second application includes an animation with a transparency alpha value gradually changing from 0 to 1, then, for example, when the progress of the executed startup animation is that the alpha value is greater than or equal to 0.4, the gradual change of the alpha value from 0.4 to 1 can be continued according to the last real-time displacement parameter. If the progress of the executed startup animation is that the alpha value is less than 0.4, the gradual change of the alpha value from 0.4 to 0 (that is, the reverse animation of the executed progress) is first executed, and then the reverse animation of the exit animation of the first application is executed. It should be understood that in this example, the animation type and specific value are for the convenience of understanding the solution, and there is no limitation. For example, 0.4 can also be 0.5 or other suitable values.

[0071] In another implementation, the method further includes: when it is detected that the distance slid from the starting point at the end of the sliding gesture operation is less than the first distance threshold and greater than the false touch distance threshold, the reverse animation of the executed part of the exit animation of the first application is executed. In this implementation, the slid distance is not enough to wait until the exit animation of the first application is finished. At this time, the startup animation of the second application has not started, and there is no need to consider the channel establishment result, so the reverse animation of the executed part of the exit animation can be directly executed. As mentioned above, although the reverse animation is similar to the startup animation, it is not the same as the startup animation. For example, it is not a complete exit animation here, so it is more reasonable to call it a reverse animation. In this case, since the distance is not enough to wait for the startup animation of the second application to be played, the second application will not be started, and the state of the first page of the first application will be restored.

[0072] It should be understood that in the present application, it is basically impossible for the sliding gesture operation to continue when the startup animation of the second application is completed. Because from the false touch threshold to the first distance threshold, that is, during the execution of the exit animation of the first application, it must be executed with the hand. Only when the exit animation of the first application is completed and the startup animation of the second application is executed, it may be too late to follow the hand because the communication channel for the connection is not established. As long as it is established, it will definitely follow the hand. However, when the establishment fails, if the distance is enough, the startup animation will be executed directly according to the preset parameters of the second application. If the distance is not enough, it will exit. Therefore, it is impossible for the animation of the second application to end and the sliding operation to continue.

[0073] There are many kinds of dynamic effects for application switching, and there are also cases where multiple dynamic effects are superimposed. The more complex the dynamic effects are, the higher the software and hardware requirements for electronic devices. Therefore, the dynamic effects when switching applications can be customized for different electronic devices by means of layered dynamic effects. For example, when the processing power of an electronic device is high, complex and diverse dynamic effects can be used, and the change step size of each dynamic effect can be smaller, so that the change process has a more infinite feeling. When the processing power of an electronic device is low, a simple and single dynamic effect can be used, and the change step size of the dynamic effect can be larger, so that the change process is subdivided more roughly to prevent the execution process from being stuck. You can also set the dynamic effect parameters according to the model of the electronic device, that is, make a table, or establish pre-configured rules for different models and their corresponding dynamic effect parameters (equivalent to the form of switch control). As long as the model of the electronic device is determined, the matching dynamic effect parameters can be executed.

[0074] In another implementation, the above method also includes: adjusting the animation parameters of the exit animation of the first application and / or the startup animation of the second application according to the processing capability of the electronic device and / or pre-configuration rules; the pre-configuration rules include multiple models of electronic devices and corresponding animation parameters for each model.

[0075] The motion effect parameters may include at least one of the number of motion effects, the type of motion effect, and the change step length of the motion effect. The number of motion effects may be, for example, one or more. The types of motion effects may include, for example, bit shift effects, blur effects, and transparent effects. The change step length of the motion effect can be understood as the segmentation of the entire motion effect. For example, for bit shift effects, the change step length is the distance of one advancement (movement). For example, assuming that the length of a screen is m and the step length is 0.1m, then 10 advancements are required to complete the entire bit shift effect, and if the step length is 0.5m, then only 2 advancements are required. Obviously, the more subdivisions, the better the look and feel, but the higher the requirements for the processing power of the electronic device or the hardware and software configuration. There is no limit to the numerical value of this example.

[0076] exist Figure 2 In the scheme shown, the real-time displacement data of the sliding gesture operation is transmitted across applications to another application to achieve smooth transition of the animation effect, and the application to be launched is first hung in the background in a fully transparent state, which can shorten the response time of the second application to the sliding gesture operation, which is equivalent to preparing in advance. In this way, as soon as the exit animation of the first application ends, the startup animation of the second application can be started immediately, achieving seamless connection, so that the playback of the animation effect is uniformly smooth and smooth during the entire process of switching applications. In short, by allowing the displacement parameters to be shared between the two applications, the harmonious unity of the two animation effects is achieved, and the smooth transition of the animation effects is achieved.

[0077] Figure 3 It is a schematic diagram of the principle of a method for switching applications in an embodiment of the present application. Figure 3 Taking the switching from application A to application B as an example, process A1 represents the exit process of application A, and process B1 represents the start process of application B. Application A may be, for example, a desktop application, and application B may be, for example, a search application.

[0078] S301. After detecting that the safety distance has been exceeded, the process B1 is preloaded by starting the animation (startActivity), but the application B is in a fully transparent and invisible state.

[0079] The safety distance can be regarded as an example of the above-mentioned threshold of false touch distance. The purpose of startActivity is to preload the process B1 of application B, that is, to start application B before the exit animation of application A is completed. However, in order to prevent screen interference, application B will be made completely transparent and invisible, so as to achieve the effect of accelerating startup.

[0080] S302: Establish binder communication between process A1 and process B1 to transmit displacement information.

[0081] Binder communication is a common communication method for applications to communicate with each other, but it is not suitable for maintaining long connections, so each switch must re-apply for connection establishment, so there is a possibility of connection failure. For example, the user slides too fast and slides a long enough distance quickly, and there is no time to establish a connection. For example, the user slides a short distance and then lifts his hand, which also results in insufficient time to establish a connection, resulting in a failure to establish a connection (failed to establish a connection). Therefore, when the connection fails, you can continue to use startActivity to pass the fallback animation information (that is, the startup animation executed according to the preset parameters).

[0082] The displacement information here can be understood as the real-time displacement parameter of the sliding operation.

[0083] When executing the startup animation of application B, it can also be based on the processing capability of the electronic device and / or preparation rules (for example, setting different animation modes and switches of different animation modes on the cloud side). For mid- and low-end electronic devices, the processing capability of the electronic devices is relatively weak, and light animations (animations that require lower processing capabilities of the electronic devices, for example, one animation can be reduced and only one animation can be used, or the change gradient or change step of the animation can be adjusted) to adapt to different electronic devices and achieve layered animations.

[0084] S303: When the binder communication fails to be established, the fallback animation information is delivered through startActivity.

[0085] Figure 4 It is a schematic diagram of the principle of playing a dynamic effect as the sliding distance changes in an embodiment of the present application. Figure 4 Let’s still take pulling down on the desktop to switch to search as an example.

[0086] like Figure 4 As shown, point A is the touch starting point, and segment AB is the distance for preventing accidental touches. The unit can be expressed in dp, and the specific distance can be set according to the actual situation of the electronic device.

[0087] The BC segment is the hand sliding distance. Taking 50dp as an example, during this distance, the desktop wallpaper will gradually blur, the opacity (alpha) will gradually increase from 0 to 0.9, and the icon (used to represent the gesture touch point) will dynamically drop down along the vertical axis (Y axis) of the screen.

[0088] If the process connection communication channel between the two applications is not established successfully within this distance, the icon continues to move down with the hand, the desktop wallpaper continues to be blurred, and the opacity remains unchanged at 0.9.

[0089] Within this distance, even if the process connection communication channel between the two applications is successfully established, the search startup animation will not be played. Instead, the search startup animation will be played after 50dp. This is because during this distance, the desktop exit animation needs to be played first.

[0090] In the CD segment, taking the distance of 60dp as an example, it is the playback period of the search start animation. After the process connection communication channel between the two applications is successful and exceeds 50dp (if calculated from the starting touch point, it is the AC segment, which is 50dp plus the length of the AB segment), the search start animation is executed.

[0091] The search app moves to the preset position within this 60dp, and the alpha gradually increases from 0 to 1. The desktop animation also executes the animation with the alpha gradually increasing from 0.9 to 1 within the 10dp distance after successful binding.

[0092] In some implementations, after the communication channel is successfully established during the hand-following sliding, the slide continues. When the distance of continued sliding makes the alpha value of the search (second application) greater than or equal to 0.4 (it can also be other preset opacity thresholds, such as 0.5 or 0.6, etc.), even if the sliding is stopped, the search (second application) is started; or, when the distance of continuing to slide until the hand is raised does not make the alpha value of the search (second application) not less than 0.4, the reverse animation of the search startup animation is executed, and the reverse animation of the desktop exit animation is executed.

[0093] When continuing to complete the startup of the second application, the startup animation can be continued according to the displacement parameters transmitted last time.

[0094] In other implementations, if the communication channel is not established successfully during the hand-following sliding, but the distance exceeding the false touch distance threshold exceeds 70dp (that is, 50dp of the BC segment plus 20dp of the CD segment after C in the CE segment), if the binding is not successful at this time, the bottom-line solution is used, and the startup animation of the second application is played according to the preset parameters of the search (second application), and the homepage of Soso is entered; or, if the communication channel is not established successfully during the hand-following sliding, and the distance exceeding the false touch distance threshold does not exceed 70dp, the reverse animation of the startup animation of the search is executed, and the reverse animation of the exit animation of the desktop is executed. That is, for fast sliding, if there is no time to establish a connection and the sliding is completed and the distance slid is sufficient, then the startup animation of the second application can be played directly according to the preset parameters of the second application.

[0095] It should also be understood that the 70dp wait is when the connection is not established successfully when it reaches C. If the connection has been established at or before C, there is no need to wait for the 20dp of CD segment. Therefore, when the connection is established at C, the search start animation will be executed. When it is found that the connection has not been established at C, it will continue to wait for 20dp. If it has not been established at D, it will stop waiting and directly follow the above judgment logic to see whether to continue playing the start animation or execute the reverse animation.

[0096] When the search homepage is displayed, that is, when the alpha value is 1, the keyboard input pop-up window can be displayed when the hand is raised. You can also cancel the keyboard input pop-up window when the alpha value of the search page is less than 0.4 by moving the hand up.

[0097] Figure 5 It is a schematic flowchart of another switching application in an embodiment of the present application. Figure 5 It can be seen as Figure 2 An example of the method shown. Figure 5 Take the first application as the desktop, the second application as the search, the position corresponding to the false touch distance threshold as position A1, the position corresponding to the first distance threshold as A2, the exit animation of the desktop as the position movement effect and the blur animation, and the startup animation of the search as the position movement effect and the removal of transparency animation.

[0098] S501. Pull down on the desktop to enter the search application. When the desktop detects that it has slid down a certain distance and reaches position A1, it pulls up the search in advance and starts to establish a cross-process connection at the same time. During this period, the search should be fully transparent and invisible.

[0099] The cross-process connection here is an example of a communication channel of the cross-process connection between the two applications mentioned above. In one example, the cross-process connection here can be binder communication.

[0100] S502, after reaching position A1, the gesture continues to slide down, and the desktop moves and blurs until reaching position A2, at which point the desktop animation ends.

[0101] If the slide is stopped before reaching position A2, the desktop will perform position shifting and deblurring effects in the opposite direction.

[0102] If the communication channel is successfully established during this sliding period, the search startup animation will not be executed first, but the desktop animation will be executed after completion.

[0103] S503. After reaching position A2, the gesture continues to slide down, and the desktop transmits real-time displacement data to the search engine. The search engine performs corresponding animation based on the displacement data transmitted from the desktop, and the alpha value gradually increases from 0 to 1, while blurring the background.

[0104] At position A2, if the connection is established successfully, step S503 is executed.

[0105] If the connection fails at position A2, the user continues to slide down until the distance reserved for the bound service is exceeded (for example, Figure 4 If the connection fails to be established after the 70dp touch distance (that is, the 50dp of the BC segment plus the 20dp after C), the alpha value of the search at this time will be used to determine whether to continue to use the bottom-up animation to start the search or to use the opposite animation of the start animation. Figure 4 Related content.

[0106] In some implementations, it is also possible to dynamically determine whether the bit shift effect needs to be deleted based on the processing power of the electronic device and / or the configuration rules, thereby achieving the effect of layered animation. For example, if the processing power is weak, the bit shift effect will not be executed, and only the transparency animation will be executed; or, if the processing power is strong, both will be executed. For another example, it may be that in the pre-configuration rules, it is determined according to the model of the electronic device whether the bit shift effect is supported, so that the bit shift effect is retained or deleted. They are not listed one by one.

[0107] Figure 6 It is a schematic flowchart of another execution process of switching applications in an embodiment of the present application. Figure 6 In the example, the switching between application A and application B is taken, and the false touch distance threshold is 20dp, the first distance threshold is 70dp, and the startup animation effect of application B is the position movement effect and the de-transparency animation effect.

[0108] S601: When the user starts to slide on the interface of application A but does not exceed 20dp, application A does not respond.

[0109] S602: When the user continues to slide on the interface of application A after exceeding 20dp, application A starts to perform animation according to the distance.

[0110] In other words, application A makes the exit animation.

[0111] S603: At application A, application B is launched through startActivity in a non-backup animation mode, and application B is set to a fully transparent initial state.

[0112] S604: Bind the communication service between application A and application B, that is, establish binder communication between the two applications.

[0113] When the user continues sliding for 70dp and then lets go, the distance value is 0, which means the exit animation of App A ends.

[0114] S605 , the screen of application A continues to move downward, which is equivalent to the bit shift effect continuing to execute.

[0115] S606: When the binding is successful, application A records the displacement startSearchY at this time.

[0116] S607 , application A transmits the real-time displacement to application B (move(startSearchY, currentY)).

[0117] S608 . Application B performs alpha display of the interface according to the passed SerchDistance value.

[0118] It should be understood that S607 and S608 are performed continuously until they are terminated by the trigger of subsequent steps, such as the completion of the animation playing or the end of sliding by raising the hand.

[0119] S609. When the displacement (y-searchY) is greater than 0 from successful binding to hand raising, the alpha of application A is gradually increased to 1.

[0120] S610: When the alpha value of the screen of application A becomes 1, the downward movement stops, which is equivalent to stopping the bit movement effect.

[0121] S611. When the displacement (y-searchY) is less than or equal to 0 from successful binding to hand raising, application A plays the animation in reverse according to y-searchY.

[0122] Figure 7 and Figure 8 It is a schematic diagram of an execution process of switching applications in an embodiment of the present application. Figure 7 The example of a breakthrough is still the switch from desktop to search. Figure 7As shown in the middle interface 701, starting from point A on the desktop, press and hold and slide down. When sliding to the position of B1, the search (second application) is pulled up in the background and exists in a fully transparent state, and the connection between the processes of the two applications begins to be established, as shown in interface 702. B1 is the position corresponding to the false touch distance threshold, that is, the sliding distance is greater than or equal to the section from A to B1, which is not considered to be a false touch, but a sliding down to switch applications. When you slide over B1 and continue to slide down, the desktop exit animation will start to play. Here, the desktop gradually becomes transparent and the position movement effect is taken as an example. It is assumed that when sliding to B2, the desktop is already transparent, and you can see that the icon has also moved down a distance as a whole, as shown in interface 703. When you continue to slide down to the B3 position, the desktop exit animation ends, and you need to start playing the search startup animation, as shown in interface 704. At this time, there are no other elements on the desktop background (already transparent and exited), but only a blurred desktop background. B3 can be regarded as the position corresponding to the first distance threshold.

[0123] When sliding past B3 and continuing to slide down, it is necessary to check whether the connection has been established. If it has been connected, the desktop transmits the real-time displacement to the search through the established connection, and then the search executes the startup animation based on the real-time displacement, as shown in interface 705. The displacement effect and the transparency removal animation of the search at position B4 cause the page to be pushed into the screen for display, and the picture gradually deepens. Assuming that the alpha value is less than 0.4 at this time, the user raises his hand, and the reverse animation of the executed part of the startup animation of the search will be executed. As shown in interface 707, the alpha value is smaller, and the part of the picture on the screen is also smaller, until it gradually stops displaying, and then the reverse animation of the desktop's exit animation will be played until the interface 701 is displayed again. Assuming that you are still sliding down at B4, you can see that the entire search page is displayed on the screen as shown in interface 706, which means that the startup animation of the search has been played.

[0124] Other dynamic effect changes caused by raising hands and / or channel establishment will not be listed one by one.

[0125] from Figure 7 and Figure 8 As can be seen from the example, the entire animation execution process is continuous and unified, smoother, and no Figure 1 The middle interface 103 shows the situation of "overlapping screens and fighting".

[0126] The above mainly introduces the method of the embodiment of the present application in conjunction with the accompanying drawings. It should be understood that although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence, these steps are not necessarily performed in sequence in the order shown in the figure. Unless clearly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the various embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a part of the steps or stages in other steps. The device of the embodiment of the present application is introduced below in conjunction with the accompanying drawings.

[0127] Fig. 9 Schematic diagram of a device for switching applications in an embodiment of the present application. Fig. 9 As shown, the device 2000 includes a display unit 2001 and a processing unit 2002. The device 2000 can be integrated in electronic devices such as mobile phones, tablet computers, and notebook computers.

[0128] The device 2000 can be used to execute any of the above-mentioned methods for switching applications. For example, the display unit 2001 can be used to execute step S201, and the processing unit 2002 can be used to execute steps S202-S204. For another example, the device 2000 can also be used to execute Figures 3 to 6 The device 2000 can also be used to perform Figure 7 and Figure 8 The process shown.

[0129] In one implementation, the apparatus 2000 may further include a storage unit for storing relevant data. The storage unit may be integrated in any one of the above units, or may be a unit independent of all the above units.

[0130] Fig.10 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. Fig.10As shown, the electronic device 900 may include a processor 910, an external memory interface 920, an internal memory 921, a universal serial bus (USB) interface 930, a charging management module 940, a power management module 941, a battery 942, an antenna 1, an antenna 2, a mobile communication module 950, a wireless communication module 960, an audio module 970, a speaker 970A, a receiver 970B, a microphone 970C, an earphone interface 970D, a sensor module 980, a button 990, a motor 991, an indicator 992, a camera 993, a display screen 994, and a subscriber identification module (SIM) card interface 995, etc. Among them, the sensor module 980 may include a pressure sensor 980A, a gyroscope sensor 980B, an air pressure sensor 980C, a magnetic sensor 980D, an acceleration sensor 980E, a distance sensor 980F, a proximity light sensor 980G, a fingerprint sensor 980H, a temperature sensor 980J, a touch sensor 980K, an ambient light sensor 980L, a bone conduction sensor 980M, etc.

[0131] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 900. In other embodiments of the present application, the electronic device 900 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0132] For example, Fig.10 The processor 910 shown may include one or more processing units, for example, the processor 910 may include an application processor (AP), a modem processor, a graphics processor (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.

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

[0134] The processor 910 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 910 is a cache memory. The memory may store instructions or data that the processor 910 has just used or cyclically used. If the processor 910 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 910, and thus improves the efficiency of the system.

[0135] In some embodiments, the MIPI interface can be used to connect the processor 910 with peripheral devices such as the display screen 994 and the camera 993. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. The processor 910 and the display screen 994 communicate through the DSI interface to realize the display function of the electronic device 900.

[0136] In some embodiments, the GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. The GPIO interface can be used to connect the processor 910 with the camera 993, the display screen 994, the wireless communication module 960, the audio module 970, the sensor module 980, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0137] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 900. In other embodiments of the present application, the electronic device 900 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0138] The electronic device 900 implements the display function through a GPU, a display screen 994, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 994 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 910 may include one or more GPUs, which execute program instructions to generate or change display information.

[0139] The display screen 994 is used to display images, videos, etc. The display screen 994 includes a display panel. In some embodiments, the electronic device 900 may include 1 or N display screens 994, where N is a positive integer greater than 1.

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

[0141] The pressure sensor 980A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 980A can be set on the display screen 994. There are many types of pressure sensors 980A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 980A, the capacitance between the electrodes changes. The electronic device 900 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 994, the electronic device 900 detects the touch operation intensity according to the pressure sensor 980A. The electronic device 900 can also calculate the touch position according to the detection signal of the pressure sensor 980A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can 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, an 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, an instruction to create a new short message is executed.

[0142] The touch sensor 980K is also called a "touch panel". The touch sensor 980K can be set on the display screen 994, and the touch sensor 980K and the display screen 994 form a touch screen, also called a "touch screen". The touch sensor 980K is used to detect touch operations acting on or near it. The touch sensor can pass 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 994. In other embodiments, the touch sensor 980K can also be set on the surface of the electronic device 900, which is different from the position of the display screen 994.

[0143] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0144] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0145] The embodiment of the present application also provides an electronic device, which includes: one or more processors, a memory, and a computer program stored in the memory and executable on the one or more processors, wherein the one or more processors execute the computer program so that the electronic device can implement the steps in any of the above methods. The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by the electronic device, the steps in each of the above method embodiments can be implemented.

[0146] The computer-readable medium may include at least: any entity or device capable of carrying computer program codes to a camera / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disk. In some jurisdictions, according to legislation and patent practice, a computer-readable medium cannot be an electric carrier signal or a telecommunication signal.

[0147] The present application embodiment provides a computer program product, which includes a computer program, and when the computer program is executed by an electronic device, the steps in the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form.

[0148] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0149] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

[0151] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0152] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0153] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0154] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0155] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0156] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for switching applications, characterized in that: include: Displaying a first page of a first application; In response to a sliding gesture operation on the first page, executing an animation of exiting the first application and an animation of starting a second application; During the execution of the animation of exiting the first application and the animation of starting the second application, the following operations are performed: When it is detected that the distance slid from the starting point of the sliding gesture operation is greater than or equal to the false touch distance threshold, the second application is started in the background of the electronic device, and the second application is made to exist in a fully transparent state, a cross-process communication channel is established between the first application and the second application, and an exit animation of the first application is executed; The exit animation of the first application includes a position shifting effect and a blurring effect, and the change step length of the exit animation of the first application, the position shifting effect of the first application, and the blurring effect of the first application are determined according to the processing capability of the electronic device where the first application is located; After detecting that the distance is greater than or equal to the false touch distance threshold, continuing to execute the exit animation of the first application, so that the screen of the first page is gradually blurred according to the change step size of the blur animation of the first application, and the gradually blurred first page gradually exits the screen of the electronic device along the sliding direction of the sliding gesture operation along the change step size of the displacement effect, and when continuing to detect that the distance is greater than or equal to the first distance threshold and the communication channel is successfully established, sending the real-time displacement parameter of the sliding gesture operation on the first page to the second application through the communication channel, and starting to execute the startup animation of the second application based on the received real-time displacement parameter, the first distance threshold is greater than the false touch distance threshold; The startup animation of the second application includes a position shifting effect and a de-transparentizing animation. The startup animation of the second application, and the change step length of the position shifting effect of the second application and the de-transparentizing animation of the second application are determined according to the processing capability of the electronic device where the second application is located. When the startup animation of the second application starts to be executed, the first page is completely blurred and completely exits the screen. After the startup animation of the second application begins to be executed, the second page of the second application gradually appears on the screen according to the change step length of the de-transparent animation of the second application, and the second page gradually moves to the screen along the sliding direction of the sliding gesture operation according to the change step length of the position movement effect of the second application, and the second page is the startup page of the second application; The sliding gesture operation ends at the first moment after the start of the startup animation of the second application, and if the execution progress of the startup animation of the second application at the first moment meets the preset condition, the remaining startup animation of the second application continues to be executed according to the real-time displacement parameters transmitted to the second application at the first moment; or, When the sliding gesture operation ends at the first moment after the start of the startup animation of the second application, and the execution progress of the startup animation of the second application at the first moment does not meet the preset conditions, the reverse animation of the executed part of the startup animation of the second application is executed according to the change step of each animation in the startup animation of the second application, and the reverse animation of the exit animation of the first application is continuously executed according to the change step of each animation in the exit animation of the first application.

2. The method according to claim 1, characterized in that After detecting that the distance is greater than or equal to the first distance threshold, the method further includes: When the communication channel is not established successfully, it is determined according to the distance whether to execute the startup animation of the second application according to preset parameters, or to switch to executing the reverse animation of the exit animation of the first application.

3. The method according to claim 2, characterized in that When the communication channel is not successfully established, determining, according to the distance, to execute the startup animation of the second application according to preset parameters, or to switch to executing the reverse animation of the exit animation of the first application, includes: When it is detected that the distance is greater than or equal to a second distance threshold, executing the startup animation of the second application according to the preset parameters of the startup animation of the second application, and the second distance threshold is greater than the first distance threshold; or When it is detected that the distance at the end of the sliding gesture operation is less than the second distance threshold and greater than the first distance threshold, the reverse animation of the exit animation of the first application is executed.

4. The method according to claim 1, characterized in that: After detecting that the distance is greater than or equal to the false touch distance threshold, the method further includes: When it is detected that the distance at which the sliding gesture operation ends is less than the first distance threshold and greater than the false touch distance threshold, the reverse animation of the executed part of the exit animation of the first application is executed.

5. The method according to claim 1, characterized in that The method further comprises: According to the processing capability of the electronic device and / or pre-configured rules, the animation parameters of the exit animation of the first application and / or the startup animation of the second application are adjusted; the pre-configured rules include multiple electronic device models and corresponding animation parameters for each model.

6. The method according to claim 5, characterized in that The motion effect parameters include at least one of the number of motion effects, the type of motion effect, and the change step of the motion effect.

7. The method according to claim 6, characterized in that The processing capability of the electronic device is positively correlated with the number of the animation effects; the processing capability of the electronic device is negatively correlated with the change step size of the animation effects.

8. The method according to any one of claims 1 to 7, characterized in that The first application is a desktop or a negative one screen, and the second application is a search page.

9. The method according to claim 8, characterized in that The method further comprises: When the startup animation of the second application is executed, the home page of the search page is displayed, and a keyboard input pop-up window is loaded on the home page of the search page.

10. The method according to any one of claims 1 to 7, characterized in that The sliding direction of the sliding gesture operation is downward.

11. An electronic device, characterized in that: The electronic device comprises: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method according to any one of claims 1 to 10.

12. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Display processing method and device of searching functional block in page

    CN105426086A

  • Display control method and terminal

    CN111712787A