Method for reloading display interface and electronic device
By determining the target activity area based on the two activity areas before rotation during the process of reloading the display interface of the electronic device, the problem of interface failure after rotation is solved, and the effect of normal display and interaction of all interfaces after rotation is achieved.
Patent Information
- Application Number
- CN202311253202.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2043-09-26
AI Technical Summary
When the automatic rotation function of the electronic device is turned on, when the running application displays multiple interfaces at the same time, and the display interface is reloaded after rotation, a certain interface becomes invalid and interactive operations cannot be performed.
During the process of reloading the display interface, the target activity area is determined based on the overall activity area composed of the two activity areas before rotation, thereby avoiding misjudgment and filling of the area, and ensuring that all interfaces can be effectively displayed and interacted after rotation.
It effectively avoids the problem of interface failure, improves user experience, ensures that all interfaces can interact normally after rotation, and improves the use efficiency of electronic devices.
Smart Images

Figure CN117519865B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic devices, and in particular to a method for reloading a display interface and an electronic device. Background Art
[0002] After the automatic rotation function is turned on for electronic devices such as mobile phones or tablet computers, the display interface needs to be reloaded after rotation occurs, that is, the display interface needs to be rotated to be consistent with the rotation direction of the electronic device.
[0003] In traditional electronic devices, for a running application, only one interface will be displayed at a time. When rotation occurs, the interface will be reloaded and displayed according to the display requirements after rotation. However, with the development of technology, foldable screen electronic devices have emerged, which has made the screens that can be presented by electronic devices larger. Therefore, even if multiple interfaces are displayed at the same time, it can meet the user's usage needs, and it will not be unclear because the display area of the interface is too small. Therefore, an application can open and display multiple interfaces at the same time when running, and each interface can be interacted with. For example, a shopping application can open both the home page and the next level interface at the same time, giving users a better experience.
[0004] However, this also brings new problems. In actual usage scenarios, it is found that when an electronic device displays two interfaces of a running application at the same time, when the automatic rotation function is turned on, after the rotation occurs, although the display angles of the two interfaces are rotated to be consistent with the rotation direction of the electronic device, one of the two interfaces can no longer be interacted with. In other words, the electronic device will not respond when any control in one of the interfaces is clicked.
[0005] Therefore, in a scenario where a running application displays multiple interfaces at the same time, how to avoid the appearance of invalid interfaces when the display interface is reloaded after rotation is a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present application provides a method and electronic device for reloading a display interface, which can avoid the occurrence of an invalid interface when reloading the display interface after rotation in a scenario where a running application displays multiple interfaces at the same time, thereby improving the user experience.
[0007] In a first aspect, a method for reloading a display interface is provided, the method comprising: simultaneously displaying a first interface and a second interface of a running first application on a screen of an electronic device, the second interface being displayed under the triggering of a first control in the first interface; when it is detected that the electronic device is rotated, starting a process of reloading the display interface; in the process of reloading the display interface, determining a target active area based on an overall active area consisting of an active area of the first interface and an active area of the second interface before rotation; in the process of reloading the display interface, reloading the display interface based on the target active area.
[0008] In the technical solution of the present application, the target active area is mainly determined by combining the whole formed by the two active areas before rotation, thereby avoiding that one of the active areas is mistakenly regarded as a part that needs to be filled and becomes invalid after being filled.
[0009] Different from the conventional solution, in the embodiment of the present application, the target activity area (i.e., the target activity area) is determined based on the overall activity area composed of the two activity areas before the rotation, thereby preventing the previous activity area from being misjudged as an area that needs to be filled in the letterbox mode, thereby avoiding the generation of an invalid interface.
[0010] In letterbox mode, when filling, the activity area will be determined first, and then the determined activity area will be displayed in the center, and the parts on both sides of the screen except the activity area will be filled with letterbox-left and letterbox-right respectively. When there is no AE mode, this method will not cause problems, because in the traditional non-AE mode display scenario, there is only one activity area at each time. If a new activity area is started, it will directly cover the previous activity area. Therefore, in letterbox mode, the value of the activity area read is the value of the last activity area started before rotation. However, after the birth of AE mode, in AE mode and letterbox mode, the value of the last activity area started is still read, which causes the previously started activity area to be omitted. Combined with this, the value of the activity area of the second interface is read, but the activity area of the first interface is omitted, resulting in the failure of the first interface after the display interface is reloaded.
[0011] In the embodiment of the present application, in the letterbox mode, when filling, the target active area is determined based on the overall active area before rotation, thereby avoiding omission of the active area of the first interface and also avoiding the problem of failure of the first interface after rotation.
[0012] In combination with the first aspect, in certain implementations of the first aspect, in the process of reloading the display interface, determining the target active area based on the overall active area composed of the active area of the first interface and the active area of the second interface before rotation may include: determining whether the display mode of the electronic device is the parallel window AE mode; when the display mode is determined to be the AE mode, determining the target active area based on the overall active area before rotation; or, when the display mode is determined to be not the AE mode, determining the target active area based on the active area of the last display interface of the first application before rotation.
[0013] In this implementation method, the judgment of AE mode is added. Only in AE mode will the target activity area be determined based on the overall activity area. For non-AE mode, the original determination method is retained, and the activity area of the last display interface is determined as the target activity area. Here, the activity area of the last display interface is the activity area of the second interface.
[0014] It should be noted that although the steps shown above have shown that the first application displays two interfaces at the same time and has two active areas, after the process of reloading the display interface is started, it is still necessary for this process to obtain the current display mode and determine whether the current display mode is AE mode before deciding which method to use to determine the target active area. In other words, it is necessary to decide which area variable to read as the corresponding value of the target active area.
[0015] In combination with the first aspect, in certain implementations of the first aspect, in the process of reloading the display interface, determining the target active area based on the overall active area composed of the active area of the first interface and the active area of the second interface before rotation may include: determining whether the display mode of the electronic device is a multi-window display mode; when the display mode is determined to be a multi-window display mode, executing the step of determining whether the display mode of the electronic device is an AE mode; or, when it is determined that the display mode is not a multi-window display mode, determining the target active area based on the active area of the first display interface after the first application is started before rotation.
[0016] It should be noted that AE mode is a display mode in the multi-window display mode, so before determining the AE mode, another layer of multi-window display mode determination can be added. In other words, first determine whether it is a multi-window display mode. Only if it is a multi-window display mode will the AE mode determination and target activity area determination be further performed. For non-multi-window display mode (that is, single-window display mode), there is no need to perform AE mode determination. Such two-level determination can make the screening results for the AE mode more accurate, and the results for determining the target activity area for different modes are also more refined, which can achieve a more refined display while avoiding the invalid interface.
[0017] In combination with the first aspect, in certain implementations of the first aspect, the above method also includes: detecting whether the first application includes a preset display area; when the first application includes a preset display area, in the process of reloading the display interface, reloading the display interface according to the preset display area; or, when the first application does not include a preset display area, in the process of reloading the display interface, executing the steps of determining the target active area according to the overall active area and reloading the display interface according to the target active area.
[0018] For some applications, if it supports automatic matching of screen size, when reloading the display interface, there will be a storage unit for storing the preset value, that is, the application that supports automatic matching of screen size includes a preset display area. In this case, there is no need to perform the subsequent steps of determining the target active area and reloading the interface according to the target active area, but directly load the interface according to the preset display area. Therefore, in this implementation, a determination is added as to whether the running application includes a preset display area. If so, the interface is reloaded according to the preset display area. If not, it is determined and reloaded based on the target active area. In this way, for applications with preset display areas, the execution steps can be simplified, but it should be understood that in the absence of this determination, even for applications with preset display areas, even if the subsequent steps are executed, it will not bring bad effects, and the invalid interface can still be avoided. This implementation only screens out the necessary applications that do not execute the subsequent steps, thereby achieving more refined display control and simplifying the execution steps of these applications.
[0019] In combination with the first aspect, in certain implementations of the first aspect, in the process of reloading the display interface, determining the target active area based on the overall active area composed of the active area of the first interface and the active area of the second interface before rotation may include: detecting whether the first application includes a preset display area; when it is determined that the first application does not include the preset display area, determining whether the display mode of the electronic device is a multi-window display mode; when it is determined that the display mode is a multi-window display mode, determining whether the display mode of the electronic device is a parallel window AE mode; when it is determined that the display mode is an AE mode, determining the target active area based on the overall active area before rotation.
[0020] In this implementation, all three judgments are made, and the target active area is determined based on the overall active area before rotation only when the preset display area is not included and the display mode is a multi-window display mode, and the display mode is specifically an AE mode. Compared with the above situation where only some of the three judgments are made, the display process is more precisely controlled while avoiding the appearance of the failure interface, and the impact of the present application solution on other scenes is fully avoided.
[0021] In an example of this implementation, the method further includes: when it is determined that the display mode is not the AE mode, determining the target active area according to the active area of the last display interface of the first application before the rotation. In this example, a fallback is performed for non-AE modes.
[0022] In another example of this implementation, the method further includes: when it is determined that the display mode is not a multi-window display mode, determining the target active area according to the active area of the first display interface of the first application after startup before the rotation. In this example, a fallback is performed for non-multi-window display modes.
[0023] In another example of this implementation, the method further includes: when the first application includes a preset display area, in the process of reloading the display interface, reloading the display interface according to the preset display area. In this example, a fallback is performed for applications that support automatic matching of screen sizes, that is, applications that include a preset display area.
[0024] In combination with the first aspect, in certain implementations of the first aspect, in the process of reloading the display interface, determining the target active area based on the overall active area composed of the active area of the first interface and the active area of the second interface before rotation can include: proportionally scaling the overall active area so that the scaled active area matches the rotated screen of the electronic device, thereby obtaining the target active area.
[0025] In this appearance mode, a solution is given to obtain the target active area by scaling the entire active area before rotation. Because the width and height of the screen are swapped before and after rotation, the height or width of the entire active area after rotation may exceed the screen size, or both are much smaller than the screen size, so it can be adapted to the rotated screen by scaling.
[0026] In combination with the first aspect, in certain implementations of the first aspect, in the process of reloading the display interface, determining the target active area based on the overall active area composed of the active area of the first interface and the active area of the second interface before rotation can include: reading the size of the total display area from a storage unit that stores the size of the total display area of the screen, the total display area including the active area of the first interface and the active area of the second interface; and obtaining the size of the target active area after proportionally scaling the size of the total display area.
[0027] For electronic devices, the size of each active area will be saved, but there may be electronic devices with an overlay mechanism that only store one active area, so in this case there is no way to read the sizes of both active areas and then perform an overlay operation to get the overall active area. However, after analysis, it was found that electronic devices also have specific storage units to store the size of the overall display area (total display area), and the overall display area will include these two active areas, or in other words, the size of the overall display area when there are only two active areas is the total screen area occupied by these two active areas. Therefore, the size of the total display area can be directly read from the storage unit that stores the size of the total display area of the screen, and then the total display area can be scaled proportionally to get the target active area.
[0028] If the electronic device can store the sizes of multiple active areas, it can first read the value of the active area of the first interface and the value of the active area of the second interface, and then use the sum of the two as the value of the target active area. It should be understood that in this example, the values refer to width and height. The sum of the width of the active area of the first interface and the width of the active area of the second interface is the width of the target active area, and the sum of the height of the active area of the first interface and the height of the active area of the second interface is the height of the target active area. This method increases the calculation steps and requires the ability to obtain the values of the two active areas.
[0029] In combination with the first aspect, in some implementations of the first aspect, the method further includes: when the automatic rotation function is turned on, when it is detected that the electronic device is rotated, starting a process of reloading the display interface.
[0030] In other words, an execution condition is added to the steps of detecting rotation and reloading, which will only be executed when the automatic rotation function is turned on. Because if the automatic rotation function is not turned on, even if the electronic device is rotated, it will not trigger the process of reloading the display interface, and there is no need to re-adapt the screen size for display.
[0031] In a second aspect, a device for executing a transition effect of reloading a display interface is provided, the device comprising a unit composed of software and / or hardware for executing any one of the methods of the first aspect.
[0032] 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.
[0033] 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.
[0034] Optionally, the chip also includes a memory, and the memory is electrically connected to the processor.
[0035] Optionally, the chip may also include a communication interface.
[0036] 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.
[0037] 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
[0038] Figure 1 It is a schematic diagram of reloading the display interface in letterbox mode.
[0039] Figure 2 This is a schematic diagram of the AE mode.
[0040] Figure 3 This is a schematic diagram of reloading the display interface in AE mode in the traditional solution.
[0041] Figure 4 It is a schematic diagram of a reloading display interface according to an embodiment of the present application.
[0042] Figure 5It is a schematic flowchart of a method for reloading a display interface according to an embodiment of the present application.
[0043] Figure 6 It is a schematic flow chart of a method for determining a numerical value of a target activity area according to an embodiment of the present application.
[0044] Figure 7 It is a schematic flowchart of a method for reloading a display interface according to an embodiment of the present application.
[0045] Figure 8 It is a schematic diagram of a device for executing reloading of a display interface according to an embodiment of the present application.
[0046] Fig. 9 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0047] The scheme of the embodiment of the present application is introduced below with reference to the accompanying drawings.
[0048] In order to facilitate understanding of the solution of the embodiment of the present application, first combine Figure 1 and Figure 2 Two display-related working modes of electronic devices are introduced.
[0049] Figure 1 This is a schematic diagram of reloading the display interface in letterbox mode. Figure 1 As shown, application A is running on electronic device A. It can be seen from interface 101 that interface A1 of application A is displayed in vertical direction. After the automatic rotation function is turned on, when the user rotates electronic device A, the background system needs to reload the display interface so that the display direction of the interface meets the user's usage requirements after rotation.
[0050] For applications that support automatic matching of electronic device screen size, after rotation, interface A1 will cover the entire screen, but this will also cause the displayed picture to be stretched and deformed, which is not conducive to viewing. Therefore, many applications do not support automatic matching of electronic device screens for display, but must be displayed according to the specific aspect ratio of the application, and the interface will be displayed using letterbox mode, so that the situation shown in interface 102 appears, that is, interface 102 shows the display situation in letterbox mode. In letterbox mode, other areas outside the interface display area of the application will be filled. Since the interface will be displayed at the maximum height and the interface will be displayed in the center to better meet the user's usage needs, only the left and right blanks of the interface need to be filled, that is, as shown in interface 102, the interface A1 part of the middle application A is the activity area, the left side is the left filling area (letterbox-left), and the right side is the right filling area (letterbox-right). The filling area is to recreate a layer for filling, which can be understood as covering a new layer on the filling area. This new layer can set parameters such as transparency and blur.
[0051] In short, many applications do not adapt their display interfaces to electronic devices of different sizes, but instead display them in a specific aspect ratio. When the aspect ratio of the application is incompatible with the ratio of its container, it will be opened in letterbox mode, resulting in the appearance of interface 102, where the application's own display area is the activity area, and the system will create two layers to fill in the other non-display areas. These two layers are letterbox-left and letterbox-right, and these two layers can set parameters such as transparency and blur.
[0052] Figure 2 It is a schematic diagram of the parallel window (activity embedding, AE) mode. Parallel windows can also be called parallel windows, parallel windows, parallel windows, parallel windows or parallel windows. The AE mode can be understood as a display mode in which the same application will display multiple interfaces at the same time when running.
[0053] It should be noted that in an embodiment of the present application, the AE mode is a display mode in the multi-window display mode. In the multi-window display mode, there will be multiple windows on the same screen. The multi-window display mode may also include a split-screen display mode, a pop-up display mode, or other multi-window modes may appear in the future. For the split-screen display mode and the pop-up display mode, different windows display the interfaces of different applications, and the operations on the interfaces between different windows will not affect each other. For example, for the split-screen mode with two split screens, the two split screens are the interfaces of two separately running applications. When an interactive operation is performed on the interface of one of the windows, the interface display of the other window will not be affected, because these are windows of two independently running applications. However, in the AE mode, the two display interfaces are in a parallel relationship, that is, the two interfaces are two levels of interfaces of the same application, so operations on any interface can trigger the background response of the application.
[0054] In other words, in order to make full use of the display area of the large screen, the AE mode was born to enable multiple activities in the same application to display interfaces at the same time. For traditional candy-bar phones, if you start Activity1 first and then Activity2, Activity2 will cover Activity1, that is, after Activity2 starts, the user can only see Activity2. In the AE mode of the large screen, if you start Activity1 first and then Activity2, after Activity2 starts, the user can see two interfaces in the two areas of Activity1 and Activity2 at the same time. Figure 2 Provide explanation.
[0055] Figure 2 Interface 201 and interface 202 in the figure show a possible display process of AE mode. In interface 201, application B in electronic device B has been started. Activity1 is started first in AE mode. Interface B1 of application B is displayed in Activity1 area. Assuming that the user clicks on control M in interface B1 in Activity1, interface B2 can be loaded. For traditional candy-bar phones, interface B2 will cover interface B1. However, in AE mode, interface B1 and interface B2 will be displayed synchronously. Therefore, when the user clicks on control M, the situation shown in interface 202 will appear. In interface 202, the screen of electronic device B includes two activity areas, namely Activity1 and Activity2. Interface B1 of application B is displayed in Activity1 area, and interface B2 of application B is displayed in Activity2 area.
[0056] Figure 2Interface 203 and interface 204 in the figure show a possible display process of AE mode. In interface 203, application C in electronic device C has been started. Activity 3 is started first in normal display mode. Interface C1 of application C is displayed in Activity 3 area. Assuming that the user clicks control M in interface C1 in Activity 3, interface C2 can be loaded. For traditional straight-screen phones, interface C2 will cover interface C1. However, in the example here, after clicking control M, when loading interface C2, AE mode will be triggered to start, so that interface C1 and interface C2 are displayed synchronously. Therefore, when the user clicks control M, the situation shown in interface 204 will appear. In interface 204, the screen of electronic device C includes two activity areas, namely Activity 3 and Activity 4. Interface C1 of application C is displayed in Activity 3 area, and interface C2 of application C is displayed in Activity 4 area.
[0057] It should be understood that Figure 2 The instructions illustrate two possible AE mode solutions. In practice, there may be other situations. For example, the size relationship between the two activity areas may be different. Figure 2 The example in the figure is that Activity1 is smaller than Activity2, but in reality the two can be equal, or Activity1 can be larger than Activity2, and they will not be listed one by one.
[0058] It should also be understood that AE mode is a display mode that came into being with the development of technology, the emergence of foldable screens, and the increase in screen size, which allows for more display content. For traditional small-screen candy-bar phones, although AE mode can also be used, because the screen is too small, both interfaces are very small and users cannot see the content in the interface clearly. Therefore, AE mode is currently mainly used in electronic devices with larger screens. Figure 1 The letterbox mode is rarely used on electronic devices with small screens, but it is widely used regardless of the screen size.
[0059] Figure 3 This is a schematic diagram of reloading the display interface in AE mode in the traditional solution. Figure 3As shown in the middle interface 301, the application D is running in AE mode on the screen of the electronic device D. At this time, the interface D1 is displayed in Activity1, and the interface D2 is displayed in Activity2. When the automatic rotation function is activated, assuming that the electronic device D is rotated to the direction shown in the interface 302, the system needs to reload the display interface, and since the application D does not support automatic adaptation of the screen size, the letterbox mode is triggered to fill the non-activity area. However, for the traditional solution, there is only one activity at each moment, so when filling in the letterbox mode, only Activity2 is continued to be displayed as an activity, but Activity1 is regarded as the left filling area, and a new layer is created to cover the original Activity1 area. Here, the new layer is taken as a transparent layer as an example, and the right filling area is normally filled with a transparent layer in the letterbox mode, and since there is no underlying picture here, the transparent layer is the black screen background.
[0060] At this time, assuming that the user clicks control Q in interface D1 in interface 302, there will be no response, because the area where interface D1 is located is filled as letterbox-left, so after clicking, the result shown in interface 303 is presented, without any response, that is, there is no change compared with interface 302.
[0061] It should also be understood that if a non-transparent solid color layer is filled, the left filled area in interface 302 may be a solid color, and the screen of interface D1 may not be clearly visible, but interface D1 can still be classified as an invalid interface.
[0062] against Figure 3 The problem shown, that is, in a scenario where a running application displays multiple interfaces at the same time, an invalid interface appears when the display interface is reloaded after rotation. The embodiment of the present application provides a new solution for reloading the display interface. By determining the target activity area according to multiple activity areas in the process of reloading the display interface, the problem of the Activity1 area being incorrectly filled is solved, thereby avoiding Activity1 from becoming an invalid interface.
[0063] Figure 4 is a schematic diagram of a reload display interface in an embodiment of the present application. Figure 3 Compared with the traditional solution shown, Figure 4 In the example, we still take the running of application D on the electronic device as an example. Figure 4As shown in the middle interface 401, the application D is running in AE mode on the screen of the electronic device D. At this time, the interface D1 is displayed in Activity1, and the interface D2 is displayed in Activity2. When the automatic rotation function is activated, assuming that the electronic device D is rotated to the direction shown in the interface 402, the system needs to reload the display interface, and because the application D does not support automatic adaptation of the screen size, the letterbox mode is triggered to fill the non-activity area. The solution of the embodiment of the present application is adopted here, so when filling in the letterbox mode, when determining the target activity area, Activity1 and Activity2 are both used as activities, that is, Activity1 and Activity2 are treated as a whole, so the re-determined target activity area includes Activity1 and Activity2, so that the determined left filling area and right filling area no longer affect any activity area.
[0064] At this time, assuming that the user clicks control Q in interface D1 in interface 402, interface D3 will be further opened, as shown in interface 404. However, it should be understood that the further opened interface D3 may also be displayed in Activity 2, which depends on the independent setting of the manufacturer of the electronic device and does not affect the implementation effect of the solution of the embodiment of the present application.
[0065] Figure 5 is a schematic flow chart of a method for reloading a display interface according to an embodiment of the present application. Figure 5 Each step is described below.
[0066] S501: Displaying a first interface and a second interface of a running first application simultaneously on a screen of an electronic device.
[0067] The second interface is displayed under the triggering of the first control in the first interface.
[0068] It can be seen from step S501 that the electronic device is running the first application in AE mode, but it should be understood that this does not mean that there is no need to judge the AE mode in the subsequent process of reloading the display interface, and this judgment step, in the embodiment of the present application, needs to be executed under the trigger of starting the process of reloading the display interface, because there is no need to judge whether it is AE mode if there is no need to reload.
[0069] The electronic device may be a mobile phone, a foldable screen mobile phone, a tablet computer, or other electronic device that supports AE mode and automatic rotation function.
[0070] The first application may be any application. However, it should be understood that for applications that support automatic adaptation to the screen size, there will be no problem of incorrect filling, so this application is mainly aimed at applications that do not support automatic adaptation to the screen size.
[0071] S502: When it is detected that the electronic device is rotated, a process of reloading the display interface is started.
[0072] When the electronic device is rotated, the display interface can be reloaded, so the start of this process can be triggered.
[0073] In one implementation, the method further includes: when the automatic rotation function is turned on, upon detecting that the electronic device is rotated, starting a process of reloading the display interface.
[0074] In other words, an execution condition is added to the steps of detecting rotation and reloading, which will only be executed when the automatic rotation function is turned on. Because if the automatic rotation function is not turned on, even if the electronic device is rotated, it will not trigger the process of reloading the display interface, and there is no need to re-adapt the screen size for display.
[0075] S503: In the process of reloading the display interface, determine a target active area according to the overall active area consisting of the active area of the first interface and the active area of the second interface before rotation.
[0076] Different from the conventional solution, in the embodiment of the present application, the target activity area (i.e., the target activity area) is determined based on the overall activity area composed of the two activity areas before the rotation, thereby preventing the previous activity area from being misjudged as an area that needs to be filled in the letterbox mode, thereby avoiding the generation of an invalid interface.
[0077] In letterbox mode, when filling, the activity area is determined first, and then the determined activity area is displayed in the center, and the parts on both sides of the screen except the activity area are filled with letterbox-left and letterbox-right respectively. When there is no AE mode, this method will not cause problems, because in the traditional non-AE mode display scenario, there is only one activity area at each time. If a new activity area is started, it will directly cover the previous activity area. Therefore, in letterbox mode, the value of the activity area read is the value of the last activity area started before rotation, so what appears is Figure 1However, after the AE mode appears, in the AE mode, in the letterbox mode, the value of the last activated activity area is read, which causes the previously activated activity area to be omitted. In this case, the value of the activity area of the second interface is read, but the activity area of the first interface is omitted, resulting in the failure of the first interface after the display interface is reloaded.
[0078] In the embodiment of the present application, in the letterbox mode, when filling, the target active area is determined based on the overall active area before rotation, thereby avoiding omission of the active area of the first interface and also avoiding the problem of failure of the first interface after rotation.
[0079] In one implementation, step S503 may include:
[0080] Determine whether the display mode of the electronic device is the parallel window AE mode; when the display mode is determined to be the AE mode, determine the target active area based on the overall active area before rotation; or, when the display mode is determined not to be the AE mode, determine the target active area based on the active area of the last display interface of the first application before rotation.
[0081] In this implementation method, the judgment of AE mode is added. Only in AE mode will the target activity area be determined based on the overall activity area. For non-AE mode, the original determination method is retained, and the activity area of the last display interface is determined as the target activity area. Here, the activity area of the last display interface is the activity area of the second interface.
[0082] It should be noted that although the steps shown above have shown that the first application displays two interfaces at the same time and has two active areas, after the process of reloading the display interface is started, it is still necessary for this process to obtain the current display mode and determine whether the current display mode is AE mode before deciding which method to use to determine the target active area. In other words, it is necessary to decide which area variable to read as the corresponding value of the target active area.
[0083] In one implementation, step S503 may include:
[0084] Determining whether the display mode of the electronic device is a multi-window display mode;
[0085] When the display mode is determined to be the multi-window display mode, executing the step of determining whether the display mode of the electronic device is the AE mode; or,
[0086] When it is determined that the display mode is not the multi-window display mode, the target active area is determined according to the active area of the first display interface of the first application after being started before the rotation.
[0087] As mentioned above, AE mode is a display mode in the multi-window display mode, so before determining the AE mode, another layer of multi-window display mode determination can be added, that is, first determine whether it is a multi-window display mode, and only if it is a multi-window display mode will the AE mode determination and target activity area determination be further performed, while for non-multi-window display mode (that is, single-window display mode), there is no need to perform AE mode determination. Such two-level determination can make the screening results for the AE mode more accurate, and the results for determining the target activity area for different modes are also more refined, and a more refined display is achieved on the basis of avoiding the invalid interface.
[0088] In another implementation, the method further includes:
[0089] detecting whether the first application includes a preset display area;
[0090] When the first application includes a preset display area, in the process of reloading the display interface, the display interface is reloaded according to the preset display area; or,
[0091] When the first application does not include a preset display area, in the process of reloading the display interface, the steps of determining a target active area according to the overall active area and reloading the display interface according to the target active area are performed.
[0092] For some applications, if it supports automatic matching of screen size, when reloading the display interface, there will be a storage unit for storing the preset value, that is, the application that supports automatic matching of screen size includes a preset display area. In this case, there is no need to perform the subsequent steps of determining the target active area and reloading the interface according to the target active area, but directly load the interface according to the preset display area. Therefore, in this implementation, a determination is added as to whether the running application includes a preset display area. If so, the interface is reloaded according to the preset display area. If not, it is determined and reloaded based on the target active area. In this way, for applications with preset display areas, the execution steps can be simplified, but it should be understood that in the absence of this determination, even for applications with preset display areas, even if the subsequent steps are executed, it will not bring bad effects, and the invalid interface can still be avoided. This implementation only screens out the necessary applications that do not execute the subsequent steps, thereby achieving more refined display control and simplifying the execution steps of these applications.
[0093] In another implementation, step S503 may include:
[0094] detecting whether the first application includes a preset display area;
[0095] When it is determined that the first application does not include the preset display area, determining whether the display mode of the electronic device is a multi-window display mode;
[0096] When it is determined that the display mode is the multi-window display mode, determining whether the display mode of the electronic device is the parallel window AE mode;
[0097] When it is determined that the display mode is the AE mode, the target activity area is determined according to the overall activity area before the rotation.
[0098] In this implementation, all three judgments are made, and the target active area is determined based on the overall active area before rotation only when the preset display area is not included and the display mode is a multi-window display mode, and the display mode is specifically an AE mode. Compared with the above situation where only some of the three judgments are made, the display process is more precisely controlled while avoiding the appearance of the failure interface, and the impact of the present application solution on other scenes is fully avoided.
[0099] In an example of this implementation, the method further includes: when it is determined that the display mode is not the AE mode, determining the target active area according to the active area of the last display interface of the first application before the rotation. In this example, a fallback is performed for non-AE modes.
[0100] In another example of this implementation, the method further includes: when it is determined that the display mode is not a multi-window display mode, determining the target active area according to the active area of the first display interface of the first application after startup before the rotation. In this example, a fallback is performed for non-multi-window display modes.
[0101] In another example of this implementation, the method further includes: when the first application includes a preset display area, in the process of reloading the display interface, reloading the display interface according to the preset display area. In this example, a fallback is performed for applications that support automatic matching of screen sizes, that is, applications that include a preset display area.
[0102] In one implementation, step S503 may include: scaling the entire active area in proportion so that the scaled active area matches the rotated screen of the electronic device, thereby obtaining the target active area.
[0103] In this case, a solution is given to obtain the target active area by scaling the entire active area before rotation. Because the width and height of the screen are swapped before and after rotation, the height or width of the entire active area after rotation may exceed the screen size, or both may be much smaller than the screen size. Therefore, it can be adapted to the rotated screen by scaling. For example, for the above Figure 1-Figure 4 In the examples above, the screen is rotated from portrait to landscape, and the example is to reduce the size. Figure 1-Figure 4 In the example, if the screen is rotated from landscape to portrait, it may be necessary to zoom in. In other cases, it may be necessary to zoom in when the screen is rotated from portrait to landscape, and to zoom out when the screen is rotated from landscape to portrait. However, no matter zooming in or out, the above implementation can be used to achieve the purpose by scaling proportionally.
[0104] In one implementation, step S503 may include:
[0105] Reading the size of the total display area from a storage unit storing the size of the total display area of the screen, where the total display area includes the active area of the first interface and the active area of the second interface;
[0106] After scaling the size of the total display area in proportion, the size of the target active area is obtained.
[0107] For electronic devices, the size of each active area will be saved, but there may be electronic devices with an overlay mechanism that only store one active area, so in this case there is no way to read the sizes of both active areas and then perform an overlay operation to get the overall active area. However, after analysis, it was found that electronic devices also have specific storage units to store the size of the overall display area (total display area), and the overall display area will include these two active areas, or in other words, the size of the overall display area when there are only two active areas is the total screen area occupied by these two active areas. Therefore, the size of the total display area can be directly read from the storage unit that stores the size of the total display area of the screen, and then the total display area can be scaled proportionally to get the target active area.
[0108] If the electronic device can store the sizes of multiple active areas, it can first read the value of the active area of the first interface and the value of the active area of the second interface, and then use the sum of the two as the value of the target active area. It should be understood that in this example, the values refer to width and height. The sum of the width of the active area of the first interface and the width of the active area of the second interface is the width of the target active area, and the sum of the height of the active area of the first interface and the height of the active area of the second interface is the height of the target active area. This method increases the calculation steps and requires the ability to obtain the values of the two active areas.
[0109] S504: In the process of reloading the display interface, reload the display interface according to the target active area.
[0110] exist Figure 5 In the scheme shown, the target active area is determined mainly by combining the whole formed by the two active areas before rotation, thereby avoiding that one of the active areas is mistakenly regarded as a part that needs to be filled and becomes invalid after being filled.
[0111] Figure 6 It is a schematic flow chart of a method for determining a numerical value of a target activity area according to an embodiment of the present application. Figure 6 It can be regarded as an example of step S502 and step S503, wherein step S601 can be regarded as an example of step S502, and steps S602-S608 can be regarded as an example of step S503.
[0112] S601: Start a process of reloading a display interface.
[0113] S602, determine whether the value of the preset display area is empty, and if the determination result is yes, proceed to step S603, and if the determination result is no, proceed to step S606.
[0114] The preset display area here is the preset display area of the running application. When the application supports automatic adaptation to the screen size, this preset display area corresponds to the entire screen area.
[0115] For example, a specific storage unit may store this value. When reading a value from this specific storage unit, if it is empty, it means there is no value, that is, this application does not include the preset display area. When reading a value from this specific storage unit, if a value is read, then the read value is the value of the preset display area.
[0116] S603, determining whether the display mode is a multi-window display mode, and if so, proceeding to step S604, and if not, proceeding to step S607.
[0117] As mentioned above, the AE mode is one of the multi-window display modes, and the multi-window display mode may also include other situations where multiple windows are displayed simultaneously, such as a split-screen display mode and a pop-up display mode.
[0118] S604, determining whether the display mode is the AE mode, and if so, proceeding to step S605, and if not, proceeding to step S608.
[0119] S605: Determine the total display area value as the initial value corresponding to the target active area.
[0120] That is, in the AE mode, the value of the total display area before rotation is used as the initial value of the target active area. Then, the initial value corresponding to the target active area is proportionally scaled to match the screen after rotation to obtain the above target active area.
[0121] S606: Determine the target active area as a preset display area value.
[0122] That is to say, when the value of the preset display area is not empty (ie, there is a value of the preset display area), the preset display area is directly determined as the above-mentioned target active area.
[0123] S607: Determine the root activity area value as the initial value corresponding to the target activity area.
[0124] That is to say, in the case of non-multi-window mode, the value of the first display interface active area after the application is started before rotation is used as the initial value of the target active area. After that, the initial value corresponding to the target active area is proportionally scaled to match the rotated screen to obtain the above target active area. It should be understood that the first interface is not necessarily the first display interface.
[0125] S608: Determine the current active area value as the initial value corresponding to the target active area.
[0126] The active area when the rotation occurs is the current active area. After that, the initial value corresponding to the target active area is proportionally scaled to match the rotated screen to obtain the target active area. It should be understood that in the embodiment of the present application, the second interface is taken as the last display interface before the rotation.
[0127] Figure 7 It is a schematic flowchart of a method for reloading a display interface according to an embodiment of the present application. Figure 7 It can be seen as Figure 5 An example of the method shown is shown below. Figure 7Each step is described below.
[0128] S701. After detecting the rotation, the sensor reports the rotation event to the window management system (WMS). S701 can be regarded as an example of the process of detecting whether the electronic device is rotated in step S502.
[0129] S702. WMS notifies any application (WhatsApp, that is, the running application) of changes in the screen display status.
[0130] Any application here can be expressed as, and can be regarded as an example of the above-mentioned first application.
[0131] The change of the screen display state may include changing the horizontal screen to the vertical screen or changing the vertical screen to the horizontal screen.
[0132] S703. WhatsApp notifies the framework-side WMS that the display strategy is: do not change the aspect ratio when the screen rotates.
[0133] That is to say, the situation where automatic matching of the screen size is not supported may correspond to the situation where the preset display area is empty in step S602.
[0134] S704 , the WMS calculates the non-display area of the application, creates a corresponding layer, and instructs the display module (surfaceflinger) to perform fill display.
[0135] The non-display area is the area outside the target active area, and can also be understood as the area to be filled in the letterbox mode.
[0136] It should be understood that when calculating the non-display area here, the non-display area is the portion of the entire display screen minus the target active area, which is the portion that will be filled. Since the target active area here is no longer determined based on the last activity as in the traditional solution, but is determined based on two activities displayed at the same time, the target active area is accurate, and the non-display area is also accurate, thus avoiding the problem of a certain activity being mistaken for the non-display area, thereby avoiding the failure of the interface of the activity.
[0137] 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.
[0138] Figure 8 is a schematic diagram of a device for reloading a display interface according to an embodiment of the present application. Figure 8 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, touch-screen laptops, etc.
[0139] The device 2000 can be used to execute any of the above methods for reloading the display interface. For example, the display unit 2001 can be used to execute step S501, and the processing unit 2002 can be used to execute steps S502-S504. For another example, the processing unit 2002 can be used to execute Figure 6 The device 2000 can also be used to perform Figure 4 The process shown and can be used to perform Figure 7 The steps shown.
[0140] 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.
[0141] Fig. 9 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. Fig. 9As 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.
[0142] 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.
[0143] For example, Fig. 9 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.
[0144] 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.
[0145] 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.
[0146] 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 camera 993 communicate through the CSI interface to realize the shooting function of the electronic device 900. The processor 910 and the display screen 994 communicate through the DSI interface to realize the display function of the electronic device 900.
[0147] 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.
[0148] 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.
[0149] 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] The acceleration sensor 980E can detect the magnitude of the acceleration of the electronic device 900 in all directions (generally three axes). When the electronic device 900 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0154] 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.
[0155] The key 990 includes a power key, a volume key, etc. The key 990 may be a mechanical key or a touch key. The electronic device 900 may receive key input and generate key signal input related to user settings and function control of the electronic device 900.
[0156] 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.
[0157] 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.
[0158] An embodiment of the present application also provides an electronic device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein when the processor executes the computer program, the electronic device can implement the steps in any of the above methods.
[0159] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by an electronic device, the steps in the above-mentioned method embodiments can be implemented.
[0160] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by an electronic device, the steps in the above-mentioned method embodiments can be implemented.
[0161] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, 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. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and 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, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0162] 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.
[0163] 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.
[0164] 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.
[0165] 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.
[0166] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0167] 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.
[0168] 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.
[0169] 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.
[0170] 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 reloading a display interface, characterized in that: include: Simultaneously displaying a first interface and a second interface of a running first application on a screen of the electronic device, wherein the second interface is displayed under the triggering of a first control in the first interface; When it is detected that the electronic device is rotated, starting a process of reloading the display interface; In the process of reloading the display interface, when it is detected that the first application is an application that does not support automatic adaptation to the screen size, a letterbox mode is triggered to perform an operation of filling the inactive area; In the process of reloading the display interface, before performing the operation of filling the inactive area, determining the target active area according to the overall active area composed of the active area of the first interface and the active area of the second interface before the rotation; In the process of reloading the display interface, the display interface is reloaded according to the target active area, and the reloaded display interface includes a portion corresponding to the target active area and a filling portion corresponding to the inactive area; In the process of reloading the display interface, before performing the operation of filling the inactive area, determining the target active area according to the overall active area composed of the active area of the first interface and the active area of the second interface before the rotation, includes: Detecting whether the first application includes a preset display area; When the first application includes a preset display area, in the process of reloading the display interface, the display interface is reloaded according to the preset display area; When it is determined that the first application does not include a preset display area, determining whether the display mode of the electronic device is a multi-window display mode; When it is determined that the display mode is not the multi-window display mode, determining the target active area according to an active area of a first display interface of the first application after being started before the rotation; When it is determined that the display mode is the multi-window display mode, determining whether the display mode of the electronic device is the parallel window AE mode; When it is determined that the display mode is the AE mode, determining the target activity area according to the overall activity area before the rotation; When it is determined that the display mode is not the AE mode, the target active area is determined according to the active area of the last display interface of the first application before the rotation.
2. The method according to claim 1, characterized in that In the process of reloading the display interface, before performing the operation of filling the inactive area, determining the target active area according to the overall active area composed of the active area of the first interface and the active area of the second interface before the rotation, includes: The overall active area is scaled in proportion so that the scaled active area matches the rotated screen of the electronic device, thereby obtaining the target active area.
3. The method according to claim 1, characterized in that In the process of reloading the display interface, before performing the operation of filling the inactive area, determining the target active area according to the overall active area composed of the active area of the first interface and the active area of the second interface before the rotation, includes: Reading the size of the total display area from a storage unit storing the size of the total display area of the screen, wherein the total display area includes the active area of the first interface and the active area of the second interface; After scaling the size of the total display area in proportion, the size of the target active area is obtained.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When the automatic rotation function is turned on, after detecting that the electronic device is rotated, the process of reloading the display interface is started.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 4.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by an electronic device, the method according to any one of claims 1 to 4 is implemented.
7. A chip comprising a processor, the processor being used to read and execute a computer program stored in a memory, characterized in that: When the computer program is executed by the processor, the electronic device where the chip is located can implement the method according to any one of claims 1 to 4.
