Window layout method in multi-window scenario, and device and storage medium

By using layout templates to automatically adjust window positions in multi-window scenarios, the problem of tedious manual adjustments by users is solved, resulting in more efficient and aesthetically pleasing multi-window display.

WO2026129122A1PCT designated stage Publication Date: 2026-06-25HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-12-16
Publication Date
2026-06-25

AI Technical Summary

Technical Problem

In multi-window scenarios, users need to manually adjust the display positions of multiple windows to avoid obstruction, which is cumbersome and makes it difficult to achieve satisfactory display results.

Method used

This paper provides a window layout method for multi-window scenarios. By displaying a layout template, the electronic device automatically adjusts the layout of multiple windows, taking into account factors such as window application attributes and display time, and reasonably arranges the position of the windows in the layout template.

Benefits of technology

It improves the efficiency and display effect of multi-window layout, simplifies user operation, and provides a more ideal multi-window display solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024139775_25062026_PF_FP_ABST
    Figure CN2024139775_25062026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a window layout method in a multi-window scenario, and a device and a storage medium. When a plurality of application windows are opened on an electronic device, selection of a layout template is supported, and after the layout template is selected, the electronic device may automatically adjust a layout of the plurality of currently opened windows according to the style of the layout template selected by a user, thereby improving the efficiency of adjusting the layout of the plurality of windows and a display effect after layout adjustment. Moreover, on the basis of the window layout method in a multi-window scenario provided in the present application, when the electronic device adjusts the layout of the plurality of currently opened windows according to the style of the layout template, a plurality of factors such as an orientation attribute of an application displayed in each window, a display duration of each window and an operation time of each window may further be taken into consideration, so as to cause the plurality of windows to rationally correspond to a plurality of sub-regions in the layout template, thereby achieving a more ideal display effect.
Need to check novelty before this filing date? Find Prior Art

Description

A window layout method, device, and storage medium for multi-window scenarios Technical Field

[0001] This application relates to the field of terminal devices, and in particular to a window layout method, device and storage medium in a multi-window scenario. Background Technology

[0002] With the continuous development of electronic device technology, smartphones, tablets, and other smart electronic devices have become indispensable products in people's daily lives, work, and entertainment. To enhance the user experience, smart electronic devices offer larger displays. The demand for users to simultaneously use multiple windows on electronic devices continues to rise. For example, users may want to watch videos or shop online while chatting; they may also need to take notes and look up words while attending online classes. However, when users open multiple windows simultaneously, they may obstruct each other's view. If users want to adjust the display positions of multiple windows on the screen, they need to do so manually. Furthermore, users often need to go through cumbersome operations to achieve a satisfactory result. Summary of the Invention

[0003] This application provides a window layout method in a multi-window scenario, which can display a layout template. When a user opens multiple windows and selects a layout template, the electronic device can automatically adjust the layout of the currently opened multiple windows according to the style of the layout template selected by the user, thereby improving the efficiency of adjusting the layout of multiple windows and the display effect after the layout is adjusted.

[0004] Furthermore, according to the window layout method in the multi-window scenario provided in this application, when the electronic device adjusts the layout of the currently opened multiple windows according to the style of the layout template, it can also consider various factors such as the horizontal and vertical attributes of the application displayed in the window, the window display time, and the operation time, so as to reasonably correspond the multiple windows to multiple sub-areas in the layout template, thereby achieving a more ideal display effect.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] In a first aspect, a window layout method is provided, the method comprising: displaying a first interface, the first interface comprising a first value of windows, the first value of windows corresponding to a second value of applications, the second value being less than or equal to the first value, the second value of applications not including the first application, and the first value of windows being all vertical windows;

[0007] While maintaining the display of the first value window, in response to an operation performed on the icon of the first application, the first window of the first application is displayed, and the first window of the first application is a landscape window;

[0008] In the case of displaying the first value window and the first window of the first application:

[0009] In response to the first operation, at least one layout template icon is displayed, the at least one layout template icon includes the icon of the first layout template and the icon of the second layout template, the first layout template icon includes the icon of the horizontal sub-region, the second layout template icon does not include the icon of the horizontal sub-region, the number of sub-region icons included in the first layout template icon is a third value, the number of sub-region icons included in the second layout template icon is a fourth value, the third value and the fourth value are both less than or equal to the first value, and the third value and the fourth value are both integers greater than or equal to 3;

[0010] When a second operation of selecting the first layout template is detected, in response to the second operation, a second interface is displayed. The second interface includes a first display area, a second window of the first application, and a second window of the second application. The second window of the first application is a horizontal window. The second application is one of a second value of applications. The second application is different from the first application. The first display area includes the identifiers of at least two applications. The at least two applications are applications other than the first and second applications among the second value of applications.

[0011] When a third operation of selecting the second layout template is detected, in response to the third operation, a third interface is displayed. The third interface includes a second display area, a second window of the third application, and a second window of the fourth application. The second windows of the third application and the second windows of the fourth application are vertical windows. The third application is one of the second value of applications, and the fourth application is one of the second value of applications. Both the third application and the fourth application are different from the first application. The second display area includes the identifiers of at least two applications. The at least two applications are applications other than the third application and the fourth application in the second value of applications. The at least two applications include the first application.

[0012] The above method enables one-click layout of multiple currently open windows. When the number of currently open windows exceeds the number of sub-regions of the layout template selected by the user, the electronic device, after layout according to the template, may not display all the windows opened before layout, but instead display the identifiers of multiple applications in the same display area, thus facilitating the user to subsequently select one of the multiple applications for display.

[0013] At this point, the electronic device needs to determine which applications should be prioritized for display in the window, and which applications should be displayed in a display area as identifiers for other applications.

[0014] In one possible scenario, the first application mentioned above can be a landscape application, which can be displayed in a landscape window by default when opened; the second application mentioned above can all be portrait applications or all be compatible applications.

[0015] In one possible scenario, since landscape applications display better in landscape windows, when a layout template contains landscape sub-regions, the electronic device prioritizes displaying the windows of landscape applications within those sub-regions, resulting in a better layout. When the layout template does not contain landscape sub-regions, the electronic device prioritizes displaying landscape applications as identifiers within the same display area as other applications. Thus, when the number of sub-regions in the layout template is less than the number of windows opened before layout, the electronic device prioritizes applications that display better within the user-selected layout template, displaying them independently in windows, while other applications are displayed as identifiers, providing a better overall layout.

[0016] In one possible implementation, the third and fourth values ​​mentioned above are 3, the icons of the first layout template include the icons of the first vertical sub-region, the first horizontal sub-region, and the second horizontal sub-region, and the icons of the second layout template include the icons of the second vertical sub-region, the third vertical sub-region, and the fourth vertical sub-region.

[0017] The second interface includes a first vertical sub-area and a first horizontal sub-area. The second window of the second application is displayed in the first vertical sub-area. The second window of the second application is a vertical window. The second window of the first application is displayed in the first horizontal sub-area. The icon of the first vertical sub-area corresponds to the first vertical sub-area. The icon of the first horizontal sub-area corresponds to the first horizontal sub-area. The icon of the second horizontal sub-area corresponds to the first display area.

[0018] The third interface includes a second vertical sub-area and a third vertical sub-area. The second window of the third application is displayed in the second vertical sub-area, and the second window of the fourth application is displayed in the third vertical sub-area. Both the second windows of the third and fourth applications are vertical windows. The second and third vertical sub-areas do not overlap. The icons of the second and third vertical sub-areas correspond to the icons of the second and third vertical sub-areas, respectively, and the icons of the fourth vertical sub-area correspond to the second display area.

[0019] The correspondence between the sub-regions and their icons refers to the fact that the relative position of the sub-region on the electronic device's display screen is the same as the relative position of its icon within the layout template's icons. For example, in one possible scenario, the icon of the second vertical sub-region is displayed to the left of the icon of the third vertical sub-region, and the icon of the third vertical sub-region is displayed to the left of the icon of the fourth vertical sub-region. Therefore, the second vertical sub-region is displayed to the left of the third vertical sub-region, and the third vertical sub-region is displayed to the left of the second display area.

[0020] In this scenario, when adjusting the layout of an opened window according to a layout template, the window can be displayed according to the template's style, prioritizing the display of application windows that match the horizontal or vertical orientation of the sub-areas within the layout template. For example, if a horizontal sub-area exists in the layout template, and the resulting interface also has a horizontal sub-area, then the windows of horizontal applications can be prioritized for display in that sub-area. In another possible scenario, when all the aforementioned applications are vertical applications, the above approach prioritizes displaying the windows of horizontal applications in the corresponding horizontal sub-areas, resulting in a better display effect compared to displaying vertical windows in horizontal sub-areas. When the layout template only contains vertical sub-areas, the resulting interface also only contains vertical sub-areas. In this case, displaying the windows of horizontal applications in the vertical sub-areas would not produce a good display effect. Therefore, the windows of vertical applications or compatible applications can be prioritized for display in the vertical sub-areas, while the windows of horizontal applications are not displayed. Instead, the identifiers of horizontal applications are displayed in the same display area as the identifiers of other applications.

[0021] In one possible implementation, a fourth interface is displayed before the first interface is displayed. The fourth interface includes a fifth window, and the fifth value is 2 smaller than the first value.

[0022] After the fourth interface is displayed, in response to the operation on the icon of the fourth application, the fifth interface is displayed, which includes the fifth window and the second window of the fourth application.

[0023] The first interface is displayed when the fifth interface is displayed, in response to an operation on the icon of the second application.

[0024] In one possible scenario, when an electronic device selects which application to display in a sub-area after adjusting the layout based on its horizontal and vertical orientation, the fourth application might have the same horizontal and vertical orientation as the second application. In this case, if the second application is the most recently opened application, its window can be prioritized for display in the unique vertical sub-area within the second layout template. This avoids displaying the user's most recently opened window as an identifier, as it might be the window the user currently intends to interact with.

[0025] In one possible implementation, the first window includes the first window of the fourth application and the first window of the second application, wherein the second application and the third application are the same application, and the method further includes:

[0026] After displaying the first interface and before responding to the first operation, the method further includes:

[0027] A fourth operation was detected that was applied to the first window of the fourth application, and the first window of the fourth application was displayed in response to an operation applied to the icon of the fourth application;

[0028] After the fourth operation is detected, a fifth operation is detected that acts on the first window of the second application, and the first window of the second application is displayed in response to the operation that acts on the icon of the second application;

[0029] After the fourth operation was detected, and before responding to the first operation, no operation on the first value window was detected except for the fifth operation.

[0030] In one possible scenario, the fourth application and the second application might have the same horizontal and vertical orientation, and neither could be a landscape application. Since the second layout template contains only one vertical sub-region, if the second application is the one the user has recently interacted with, it can be prioritized and displayed within that single vertical sub-region. This avoids displaying the user's most recently interacted window as an identifier, allowing the user to continue interacting with that window. Because the third layout template has two vertical sub-regions...

[0031] In one possible implementation, the first window includes the first window of the fourth application and the first window of the second application, wherein the second application and the third application are the same application, and the method further includes:

[0032] Before displaying the first interface, the fourth interface is displayed. The fourth interface includes a fifth window, and the fifth value is 1 less than the first value.

[0033] Displaying the first interface, specifically: in response to an operation on the icon of the fourth application, displaying the first interface;

[0034] After displaying the first interface and before responding to the first operation, the method further includes:

[0035] A fourth operation was detected acting on the first window of the second application, the first window of the second application being displayed in response to an operation acting on the icon of the second application; after the fourth operation was detected, but before responding to the first operation, no operation on the first window was detected.

[0036] In one possible implementation, the second application and the third application are the same application, and the method also includes:

[0037] After the fifth interface is displayed and before the first interface is displayed, a fourth operation is detected that is applied to the window of the fourth application.

[0038] After the fourth operation was detected, but before responding to the first operation, no operation on the first value window was detected.

[0039] In one possible implementation, in response to the selection of a first identifier, the window of the application corresponding to the first identifier is displayed in a second horizontal sub-region. The first identifier is one of the identifiers of at least two applications in the first display area, and the icon of the second horizontal sub-region corresponds to the second horizontal sub-region.

[0040] In one possible implementation, a sixth interface is displayed, which includes a seventh value of horizontal windows and an eighth value of vertical windows, the seventh value of horizontal windows and the eighth value of vertical windows corresponding to a ninth value of applications, the ninth value being less than or equal to the sum of the seventh and eighth values, the seventh value being greater than or equal to 1, and the eighth value being greater than or equal to 2.

[0041] When the sixth interface is displayed:

[0042] In response to the sixth operation, display the icon of at least one layout template, the icon of the at least one layout template including the icon of the third layout template, the icon of the third layout template including the number of icons of the tenth vertical sub-region, excluding the icons of the horizontal sub-region, the tenth value being less than the sum of the seventh and eighth values;

[0043] When the eighth value is less than the eleventh value, in response to the operation of selecting the third layout template, the seventh interface is displayed. The seventh interface includes eleven vertical sub-regions and a third display area. The eleventh value is 1 less than the tenth value. The third display area includes the identifiers of at least two applications. The at least two applications are applications in the ninth value of the applications. Among the eleven vertical sub-regions, there are eight vertical sub-regions displaying vertical windows and twelfth vertical sub-regions displaying horizontal windows. The sum of the twelfth value and the eighth value is the eleventh value.

[0044] When the eighth value is greater than or equal to the eleventh value, in response to the operation of selecting the third layout template, the seventh interface is displayed. The seventh interface includes eleven vertical sub-regions and a third display area. The eleventh value is 1 less than the tenth value. The third display area includes the identifiers of at least two applications, which are applications in the ninth value of the applications. In the eleventh vertical sub-region, each vertical sub-region displays a vertical window.

[0045] In one possible implementation, the identifiers of at least two applications include the identifier of a fifth application, which is a thumbnail of the window of the fifth application.

[0046] In one possible implementation, an eighth interface is displayed, which includes a thirteenth horizontal window and a fourteenth vertical window, the thirteenth horizontal window and the fourteenth vertical window correspond to a fifteenth application, and the sum of the thirteenth and fourteenth values ​​is greater than or equal to the fifteenth value.

[0047] When the eighth screen is displayed:

[0048] In response to the seventh operation, display the icon of at least one layout template, the icon of the at least one layout template including the icon of the fourth layout template, the icon of the fourth layout template including the icon of the thirteenth horizontal sub-region and the icon of the fourteenth vertical sub-region;

[0049] In response to the seventh operation of selecting the fourth layout template, the ninth interface is displayed. The ninth interface includes a thirteenth horizontal window and a fourteenth vertical window. The thirteenth horizontal window is displayed in the thirteenth horizontal sub-area, and the fourteenth vertical window is displayed in the fourteenth vertical sub-area. Each horizontal sub-area displays one horizontal window, and each vertical sub-area displays one vertical window.

[0050] In one possible implementation, a tenth interface is displayed, which includes the first window of the sixth application and the first window of the seventh application.

[0051] When the tenth screen is displayed:

[0052] In response to the eighth operation, display the icon of at least one layout template, the icon of the at least one layout template including the icon of the fifth layout template, the icon of the fifth layout template including the icon of the fifth vertical sub-region and the icon of the sixth vertical sub-region, the icon of the fifth layout template not including the horizontal sub-region;

[0053] In response to the selection of the fifth layout template, the eleventh interface is displayed. The eleventh interface is a horizontal interface and includes a fifth vertical sub-area and a sixth vertical sub-area. The second window of the sixth application is displayed in the fifth vertical sub-area, and the second window of the seventh application is displayed in the sixth vertical sub-area. The icons of the fifth vertical sub-area correspond to the icons of the fifth vertical sub-area, and the icons of the sixth vertical sub-area correspond to the icons of the sixth vertical sub-area.

[0054] In response to the ninth operation, the twelfth interface is displayed. The twelfth interface is a vertical interface and includes a third horizontal sub-area and a fourth horizontal sub-area. The third horizontal sub-area displays the third window of the sixth application, and the fourth horizontal sub-area displays the third window of the seventh application. The application interfaces displayed in the second window of the sixth application, the second window of the seventh application, the third window of the sixth application, and the third window of the seventh application are all horizontal interfaces. The content displayed in the first window of the sixth application, the second window of the sixth application, and the third window of the sixth application corresponds to the same interface of the sixth application. The content displayed in the first window of the seventh application, the second window of the seventh application, and the third window of the seventh application corresponds to the same interface of the seventh application.

[0055] In one possible implementation, after the twelfth interface is displayed, in response to the tenth operation, the eleventh interface is displayed, where the tenth operation is the operation of rotating the electronic device.

[0056] When the twelfth interface includes the first control, the tenth operation is an operation performed on the first control, or the tenth operation is an operation to rotate the electronic device.

[0057] In one possible implementation, a thirteenth interface is displayed, which includes the application windows of the sixteenth value, and the application windows correspond to the seventeenth value of applications, where the seventeenth value is less than or equal to the sixteenth value.

[0058] When the thirteenth screen is displayed:

[0059] In response to the eleventh operation, display the icon of at least one layout template, the icon of the at least one layout template including the icon of the sixth layout template, the icon of the sixth layout template including the icon of the eighteenth sub-region, the eighteenth value being greater than the sixteenth value;

[0060] When the selection of the sixth layout template is detected, the fourteenth interface is displayed. The fourteenth interface includes sixteenth sub-regions, and sixteenth windows are displayed in the sixteenth sub-regions. Each sub-region displays one window, and the sixteenth sub-region corresponds to the icon of the sixteenth sub-region in the eighteenth sub-region.

[0061] In one possible implementation, the fourteenth interface also includes a nineteenth display area, the sum of the nineteenth value and the sixteenth value equals the eighteenth value, the nineteenth display area is displayed in the nineteenth sub-area, the nineteenth sub-area corresponds to the icon of the nineteenth sub-area in the icon of the eighteenth sub-area, and the sixteenth window and the nineteenth display area correspond to different sub-areas.

[0062] In response to the twelfth operation applied to the ninth application, the first window of the ninth application is displayed in the fourth display area of ​​the nineteenth display area, while the first window of the ninth application is not included in the sixteenth window of the fourteenth interface.

[0063] In one possible implementation, a fifteenth interface is displayed, which includes a twentieth window. The fifteenth interface does not include a taskbar. In response to closing at least one window in the twentieth window, the taskbar is displayed. The display area of ​​the taskbar does not overlap with the display areas of the unclosed windows in the twentieth window. The taskbar includes application icons for multiple applications.

[0064] In one possible implementation, the first, fourth, fifth, sixth, seventh, eighth, tenth, thirteenth, and fourteenth interfaces also include a taskbar.

[0065] The ninth, eleventh, and twelfth interfaces do not include the taskbar;

[0066] Before responding to the selection of the first identifier, the second and third interfaces also include a taskbar;

[0067] After responding to the selection of the first identifier, the second and third interfaces do not include the taskbar.

[0068] In one possible implementation, the types of applications include landscape applications, portrait applications, and compatible applications, where a landscape application is an application that displays a landscape window in response to an operation on the application icon of a landscape application; a portrait application is an application that displays a portrait window in response to an operation on the application icon of a portrait application; and a compatible application is an application that displays a portrait window in response to an operation on the application icon of a compatible application.

[0069] In one possible implementation, in response to the second operation, a second interface is displayed, specifically as follows:

[0070] In response to the second operation, the first parameter is obtained. The first parameter includes the number of currently open windows and the window ID, the application type parameter of the application corresponding to the window, and the focus window queue. The currently open windows include a first value number of windows and the first window of the first application. The application corresponding to the window is a second value number of applications. The focus window queue is the order in which the currently open windows are determined to be the focus windows.

[0071] Based on the first parameter, determine the windows to be displayed in the M sub-regions of the first layout template to obtain the first window layout;

[0072] The second interface is displayed based on the layout of the first window.

[0073] In one possible implementation, based on the first parameter, the windows displayed in the M sub-regions of the first layout template are determined to obtain the first window layout, specifically as follows:

[0074] Based on the number of currently open windows in the first parameter as the twenty-first value, and based on the number of icons in the sub-regions included in the first layout template as the third value, it is determined that the number of currently open windows is greater than the number of icons in the sub-regions included in the first layout template. The twenty-first value of windows is the first value of windows included in the first interface and the first window of the first application. The twenty-first value is 1 greater than the first value.

[0075] If the number of currently open windows is greater than the number of icons in the sub-regions included in the first layout template, determine the value of M, which is 1 less than the third value;

[0076] The first window layout is obtained by identifying M windows out of the twenty-one windows as M sub-regions for display.

[0077] In one possible implementation, M windows out of the twenty-one windows are determined as M sub-regions for display, resulting in the first window layout, specifically:

[0078] Based on the application type parameter of the application corresponding to the twenty-first window and the focus window queue in the first parameter, determine the first order of the twenty-first window;

[0079] Based on the first order, determine the windows displayed in the M sub-regions of the first layout template to obtain the first window layout.

[0080] In one possible implementation, the first order of the twenty-first value windows is determined based on the application type parameter of the application corresponding to the twenty-first value window in the first parameter and the focus window queue, specifically as follows:

[0081] Arrange the twenty-first window in the order of horizontal application window, vertical application window, and compatible application window, with the horizontal application window in front of the vertical application window, and the vertical application window in front of the compatible application window.

[0082] If at least two windows correspond to the same application type, arrange at least two windows in the focus window queue in the order from the most recently focused to the earliest focused.

[0083] In one possible implementation, the horizontal and vertical attributes of the horizontal application are the same as and compatible with the horizontal and vertical attributes of the horizontal sub-region; the horizontal and vertical attributes of the horizontal application are different from and incompatible with the horizontal and vertical attributes of the vertical sub-region; the horizontal and vertical attributes of the vertical application are the same as and compatible with the horizontal and vertical attributes of the vertical sub-region; the horizontal and vertical attributes of the vertical application are different from and incompatible with the horizontal and vertical attributes of the horizontal sub-region; the horizontal and vertical attributes of the compatible application are different from and compatible with the horizontal and vertical attributes of the horizontal sub-region; and the horizontal and vertical attributes of the horizontal application are different from and compatible with the horizontal and vertical attributes of the vertical sub-region.

[0084] In one possible implementation, the windows displayed in the M sub-regions of the first layout template are determined according to a first order to obtain the first window layout, specifically as follows:

[0085] Read any one of the M sub-regions, determine the window displayed in the currently read sub-region according to the first rule, and obtain the matched window sub-region. The first rule includes: read the twenty-first window in the first order, and determine the first unmatched window whose horizontal and vertical attributes match the horizontal and vertical attributes of the currently read sub-region as the window that matches the currently read sub-region. The unmatched window is the window that does not match the sub-region.

[0086] The window to be displayed in the unmatched window sub-region is determined according to the second rule. The second rule includes: reading any sub-region in the unmatched window sub-region, reading the twenty-first window in the first order from the beginning, and determining the first unmatched window read as the window that matches the currently read sub-region. The unmatched window sub-region is the sub-region in M ​​sub-regions excluding the matched window sub-regions.

[0087] In one possible implementation, the first application is a horizontal application, the second and fourth applications are both vertical applications or both are compatible applications, the applications corresponding to the seventh horizontal window are all horizontal applications, and the applications corresponding to the eighth vertical window are all vertical applications or both are compatible applications.

[0088] In one possible implementation, in response to the first operation, the corresponding template configuration file is obtained according to the horizontal and vertical attributes of the current display interface. The template configuration file includes the styles of at least two layout templates. The styles include the number of sub-regions included in each of the at least two layout templates, the aspect ratio of each sub-region, and their relative positional relationships.

[0089] Based on the template configuration file, display icons for at least two layout templates.

[0090] It's understandable that layout template icons are displayed on the user interface. Each layout template icon corresponds to a specific layout template, and the style of the layout template can be set in the template configuration file. The layout template icon can indicate the style of the layout template; for example, the relative position of sub-region icons can indicate the relative position of sub-regions within the layout template. However, the layout template icon does not necessarily have to strictly conform to the style of the layout template.

[0091] When a user clicks the layout template icon, the user adjusts the window layout according to the style of the layout template corresponding to the icon.

[0092] In a second aspect, an electronic device is provided, the electronic device including a memory and one or more processors; the memory is coupled to one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors invoking the computer instructions to cause the electronic device to perform the method of any one of claims 1-26.

[0093] Thirdly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the device control method as claimed in any one of claims 1-26.

[0094] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method of any one of claims 1-26. Attached Figure Description

[0095] Figure 1A(a) is a schematic diagram of a landscape screen interface displayed on an electronic device according to an embodiment of this application;

[0096] Figure 1A(b) is a schematic diagram of another electronic device displaying a landscape interface provided in an embodiment of this application;

[0097] Figure 1A(c) is a schematic diagram of a vertical screen interface of an electronic device provided in an embodiment of this application;

[0098] Figure 1A(d) is a schematic diagram of another vertical screen interface of an electronic device provided in an embodiment of this application;

[0099] Figures 1A(e)-1A(h) are schematic diagrams of the electronic device provided in the embodiments of this application displaying a landscape interface in a locked state;

[0100] Figures 1A(i)-1A(l) are schematic diagrams of the electronic device provided in the embodiments of this application displaying a portrait screen interface in a locked state;

[0101] Figure 1B is a schematic diagram of an application interface of APP-1 provided in an embodiment of this application;

[0102] Figures 1C(a)-1C(c) are schematic diagrams of the interfaces for entering the floating window mode provided in the embodiments of this application;

[0103] Figure 1D is a schematic diagram of a floating window for displaying applications provided in an embodiment of this application;

[0104] Figures 1E-1L are schematic diagrams illustrating a set of processes for adjusting the layout of floating windows according to embodiments of this application;

[0105] Figure 1M is a schematic diagram of an interface layout provided in an embodiment of this application;

[0106] Figures 2A-2B(b) are schematic diagrams of a set of interfaces for entering the free floating window mode provided in the embodiments of this application;

[0107] Figures 2C-2G are schematic diagrams of an interface for opening an application in free floating window mode according to an embodiment of this application;

[0108] Figures 3A(a)-3B(b) are schematic diagrams of four template selection interfaces provided in the embodiments of this application;

[0109] Figure 3C is one of the schematic diagrams of the template selection interface displayed by the electronic device provided in the embodiment of this application in landscape mode;

[0110] Figure 3D is one of the schematic diagrams of the template selection interface displayed on the electronic device provided in the embodiment of this application in a portrait screen interface;

[0111] Figure 3E is a second schematic diagram of the template selection interface displayed by the electronic device provided in the embodiment of this application in a landscape mode.

[0112] Figure 3F is a second schematic diagram of the template selection interface displayed on the electronic device provided in the embodiment of this application in a portrait screen interface;

[0113] Figure 4A is a schematic diagram of an interface for a layout adjustment process provided in an embodiment of this application;

[0114] Figure 4B is a schematic diagram of another layout adjustment process provided in an embodiment of this application;

[0115] Figure 4C is a schematic diagram of an interface layout provided in an embodiment of this application;

[0116] Figure 4D is a schematic diagram of an interface layout provided in an embodiment of this application;

[0117] Figure 5A is a schematic diagram of another layout adjustment process provided in an embodiment of this application;

[0118] Figure 5B is a schematic diagram of an interface layout provided in an embodiment of this application;

[0119] Figure 5C is a schematic diagram of an interface layout provided in an embodiment of this application;

[0120] Figures 6A and 6B are schematic diagrams of another set of layout adjustment processes provided in the embodiments of this application;

[0121] Figure 6C is a schematic diagram of an interface layout provided in an embodiment of this application;

[0122] Figure 6D is a schematic diagram of an interface for opening an application provided in an embodiment of this application;

[0123] Figure 6E is a schematic diagram of an interface layout provided in an embodiment of this application;

[0124] Figures 7A-7E are schematic diagrams of a set of interfaces illustrating the process of selecting a layout template and then opening the application, as provided in the embodiments of this application.

[0125] Figures 8A-8D are schematic diagrams of a quick exchange window layout provided in an embodiment of this application;

[0126] Figure 9A is a schematic diagram of an interface for closing a window provided in an embodiment of this application;

[0127] Figure 9B is a schematic diagram of another interface for closing a window provided in an embodiment of this application;

[0128] Figure 9C is a schematic diagram of an interface provided in an embodiment of this application;

[0129] Figure 9D is a schematic diagram of an interface for hiding the taskbar provided in an embodiment of this application;

[0130] Figures 10A-10C are a set of schematic diagrams of an interface for one-click layout of an open window provided in an embodiment of this application;

[0131] Figures 10D-10E are another set of interface diagrams for one-click layout of opened windows provided in the embodiments of this application;

[0132] Figure 10F is a schematic diagram of an interface with an adjusted layout provided in an embodiment of this application;

[0133] Figure 10G is a schematic diagram of an interface layout provided in an embodiment of this application;

[0134] Figures 10H-10I are another set of interface diagrams for one-click layout of opened windows provided by embodiments of this application;

[0135] Figure 11A is a flowchart of a matching window and a template sub-region provided in an embodiment of this application;

[0136] Figures 11B(a)-11C are schematic diagrams illustrating the order of the five template sub-regions provided in the embodiments of this application;

[0137] Figures 12A and 12B are schematic diagrams of an interface for adjusting window layout provided in an embodiment of this application;

[0138] Figure 13 is a flowchart of another matching window and template sub-area provided in an embodiment of this application;

[0139] Figures 14A and 14B are schematic diagrams of another set of interfaces for adjusting window layout provided in the embodiments of this application;

[0140] Figure 14C is a schematic diagram of an interface layout provided in an embodiment of this application;

[0141] Figures 15A-15D are another set of schematic diagrams of the interface for adjusting the window layout provided in the embodiments of this application;

[0142] Figures 16A-16D are another set of schematic diagrams of the interface for adjusting the window layout provided in the embodiments of this application;

[0143] Figures 17A-17F are another set of schematic diagrams of the interface for adjusting the window layout provided in the embodiments of this application;

[0144] Figure 18A is a flowchart of another matching window and template sub-area provided in an embodiment of this application;

[0145] Figure 18B is a flowchart of another matching window and template sub-area provided in an embodiment of this application;

[0146] Figure 19 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0147] Figure 20 is a schematic diagram of the software structure of an electronic device provided in an embodiment of this application;

[0148] Figure 21 is one of the software module interaction timing diagrams provided in the embodiments of this application;

[0149] Figure 22 is a second timing diagram of software module interaction provided in an embodiment of this application;

[0150] Figure 23A is a schematic diagram of a layout template style provided in an embodiment of this application;

[0151] Figure 23B is a schematic diagram of another layout template style provided in the embodiments of this application;

[0152] Figure 24 is a flowchart of a method for determining window layout provided in this application;

[0153] Figure 25A is a flowchart of a method for sorting open windows provided in this application;

[0154] Figure 25B is a flowchart of another method for sorting open windows provided in this application;

[0155] Figure 26 is a flowchart of a matching window and template sub-region provided in this application. Detailed Implementation

[0156] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0157] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0158] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.

[0159] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0160] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0161] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.

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

[0163] The most common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be an icon, window, control, or other interface element displayed on the screen of an electronic device. Controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0164] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:

[0165] 1. Multiple windows

[0166] In the embodiments of this application, unless otherwise specified, a window refers to an interface element on an electronic device that displays the application interface of an application. Multiple windows refer to two or more windows. Multiple windows can display the application interfaces of different applications, or they can display the application interface of the same application. When multiple windows display the application interface of the same application, the content of the application interfaces displayed in the multiple windows can be the same or different. For example, an electronic device can display two windows of a "Notes" app. One window can display the main interface of the "Notes" app, and the other window can simultaneously display the main interface of the "Notes" app, or it can display the details page of the first note in the "Notes" app.

[0167] Windows can be displayed in full-screen or non-full-screen mode. When a window is displayed in full-screen mode, it covers the entire screen area of ​​the electronic device; when a window is displayed non-full-screen, it covers only a portion of the screen area. One way to display a window in non-full-screen mode is as a floating window.

[0168] In this context, the area on the display screen of an electronic device used for displaying images can be called the screen display area. When an electronic device includes multiple displays, it can correspondingly include multiple screen display areas. Optionally, in one possible implementation, all areas of the electronic device's display screen can be used to display images. In this case, the size of the screen display area is the same as the size of the display screen. In another possible implementation, the size of the screen display area can also be smaller than the size of the display screen.

[0169] 2. Layout

[0170] Layout refers to the display position on the screen display area of ​​an electronic device. It is understood that layout can simply be used to describe a display position on the screen display area of ​​an electronic device. For example, layout can be used to describe the display position of an object (e.g., a window) displayed on the screen display area, or it can be used to describe a display area on the screen display area. To facilitate understanding of the concepts in the embodiments of this application, the following uses the description of a window layout as an example to illustrate some concepts in the embodiments of this application. It is understood that the definitions of the following concepts also apply to describing a display area on the screen display area.

[0171] Window layout refers to the window's display position within the screen's display area. The display position can include the window's display coordinates on the electronic device's screen display area, and also its display size. The display position can be determined by the coordinates on the screen display area, or by a combination of both.

[0172] The display position can be determined as follows: A Cartesian coordinate system is established on the screen display area of ​​the electronic device. The display coordinates of the window on the screen display area can include the coordinates of at least one vertex of the window. The display size of the window on the screen of the electronic device can include the width and height of the window. When the electronic device displays a landscape interface, the width refers to the length of the display area in the direction parallel to the long side of the landscape display area, and the height refers to the length of the display area in the direction parallel to the short side of the landscape display area. Optionally, the window can be a rectangular window, in which case the width can be the length of the side of the window parallel to the long side of the landscape display area, and the height can be the length of the side of the display area parallel to the short side of the landscape display area. The width and height of the window can be calculated using the window's coordinates.

[0173] In this context, a landscape interface refers to an interface where, when the plane containing the electronic device's display screen is perpendicular to the ground, the longer side of the display area is parallel to the ground, as shown in Figures 1A(a) and 1A(b). As shown in Figure 1A(a), the electronic device displays a landscape interface 1a(a). The display area of ​​interface 1a(a) can be the entire area of ​​the screen display area 110, and the longer side of interface 1a(a) (the side parallel to the longer side of the electronic device, such as side AB)) is parallel to the ground. As shown in Figure 1A(b), the electronic device displays a landscape interface 1a(b). The display area of ​​interface 1a(b) can be a portion 110-1 of the screen display area 110, while another portion 110-2 of the screen display area 110 (shown as a diagonal line in the figure) may not display an interface. The longer side of interface 1a(a) (the side parallel to the shorter side of the electronic device, such as side AC)) is parallel to the ground. Optionally, in one possible implementation, the status bar 111 of the landscape interface is parallel to the long side of the display area of ​​the landscape interface.

[0174] A portrait screen interface refers to an interface where the shorter side of the display area is parallel to the ground when the plane on which the screen of an electronic device is located is perpendicular to the ground, as shown in interfaces 1a(c) and 1a(d) in Figures 1A(c) and 1A(d). As shown in Figure 1A(c), interface 1a(c) displayed by the electronic device is a portrait screen interface. The display area of ​​interface 1a(c) can be the entire area of ​​the screen display area 110, and the shorter side of interface 1a(c) (the side parallel to the shorter side of the electronic device (e.g., side AC)) is parallel to the ground. As shown in Figure 1A(d), interface 1a(d) displayed by the electronic device is a portrait screen interface. The display area of ​​interface 1a(d) can be a portion 110-3 of the screen display area 110, while another portion 110-4 of the screen display area 110 (shown as a diagonal line in the figure) may not display an interface. The shorter side of interface 1a(d) (the side parallel to the longer side of the electronic device (e.g., side AB)) is parallel to the ground. Optionally, in one possible implementation, the status bar 111 of the portrait screen interface is parallel to the short side of the display area of ​​the portrait screen interface. For example, two different Cartesian coordinate systems can be established according to the two different interface states of the electronic device. Specifically, in one possible implementation, when the electronic device displays a landscape screen interface, a Cartesian coordinate system as shown in Figure 1A(a) can be established on the screen display area 110 of the electronic device; when the electronic device displays a portrait screen interface, a Cartesian coordinate system as shown in Figure 1A(c) can be established on the screen display area 110 of the electronic device.

[0175] For example, when an electronic device displays a landscape interface, as shown in Figure 1A(a), the origin of a Cartesian coordinate system is the intersection point 118 of the extended lines of the top and left edges of the display area (which can be screen display area 110) of the landscape interface. The horizontal line passing through the origin is the X-axis, with its positive direction to the right. The vertical line passing through the origin is the Y-axis, with its positive direction downwards. The screen display area 110 can be the entire display area of ​​the electronic device. The display position of the window on the screen display area 110 can be determined on the Cartesian coordinate system shown in Figure 1A(a).

[0176] For example, when an electronic device displays a portrait-oriented interface, as shown in Figure 1A(c), the origin of a Cartesian coordinate system is the intersection point 119 of the extended lines of the upper and left edges of the display area (which can be screen display area 110) of the portrait-oriented interface. The horizontal line passing through the origin is the X-axis, with its positive direction to the right. The vertical line passing through the origin is the Y-axis, with its positive direction downwards. The screen display area 110 refers to the entire display area of ​​the electronic device. The display position of the window on the screen display area 110 can be determined in the Cartesian coordinate system shown in Figure 1A(c). It is understood that in the Cartesian coordinate system defined in this embodiment, the width can be the length of the window along the X-axis of the Cartesian coordinate system, and the height can be the length of the window along the Y-axis of the Cartesian coordinate system.

[0177] Understandably, the origin of a Cartesian coordinate system can be any vertex of the screen display area of ​​an electronic device. The X-axis and Y-axis can be any two mutually perpendicular horizontal lines passing through the origin. The positive direction of the X-axis can be from the origin to any end of the X-axis, and the positive direction of the Y-axis can be from the origin to any end of the Y-axis. The coordinates of the same point on the screen display area of ​​an electronic device differ in different Cartesian coordinate systems; therefore, this application does not limit the setting of the Cartesian coordinate system.

[0178] To facilitate understanding of the embodiments of this application, unless otherwise stated, the embodiments of this application use the two Cartesian coordinate systems shown in Figures 1A(a) and 1A(c) as examples to determine the window layout in the embodiments of this application. It can be understood that the orientation of the two Cartesian coordinate systems shown in Figures 1A(a) and 1A(c) is determined relative to the landscape and portrait interfaces displayed on the electronic device. Specifically, when the placement direction and angle of the electronic device relative to the ground change, the orientation and angle of the Cartesian coordinate system on the screen display area 110 relative to the ground also change accordingly. However, the relationship between the origin, X-axis, and Y-axis of the Cartesian coordinate system and the display area of ​​the landscape interface (which can be the screen display area 110) remains as shown in Figures 1A(a) and 1A(c). Whenever the electronic device displays a landscape interface, the Cartesian coordinate system on the screen display area 110 of the electronic device can be as shown in Figure 1A(a); whenever the electronic device displays a portrait interface, the Cartesian coordinate system on the screen display area 110 of the electronic device can be as shown in Figure 1A(c).

[0179] Understandably, electronic devices can automatically switch between landscape and portrait orientations when placed in different orientations and angles relative to the ground. When the display interface of an electronic device is locked, the device can display either a landscape orientation (as shown in Figures 1A(e)-1A(h)) or a portrait orientation (as shown in Figures 1A(i)-1A(l)) regardless of its orientation or angle relative to the ground. In Figures 1A(e)-1A(l), the plane formed by XOY is parallel to the ground.

[0180] Optionally, landscape and portrait modes can also be described as horizontal and vertical orientations. For example, landscape and portrait interfaces can also be referred to as horizontal and vertical interfaces.

[0181] Optionally, the definitions of landscape and portrait interfaces can also be applied to the definitions of the concepts of landscape and portrait. For example, an application interface opened on an electronic device also corresponds to a display area. Therefore, similar to the concepts of landscape and portrait interfaces displayed on an electronic device, an application's interface can also include both landscape and portrait interfaces. A landscape interface refers to an application interface where, when the plane of the electronic device's display is perpendicular to the ground, the longer side of the display area is parallel to the ground. A portrait interface refers to an application interface where, when the plane of the electronic device's display is perpendicular to the ground, the shorter side of the display area is parallel to the ground. It is understood that the application interface can also be displayed in a 1:1 aspect ratio.

[0182] Understandably, an application's interface can be displayed in a window. A window that displays the application interface horizontally can be called a horizontal window, and a window that displays the application interface vertically can be called a vertical window.

[0183] 3. Triggering Operation

[0184] Triggering operations can include, but are not limited to, one or more of the following: click, swipe, drag, press, voice, and button operations, etc. This application does not limit the type of triggering operation.

[0185] With the continuous development of electronic device technology, smartphones, tablets, and other smart electronic devices have become indispensable products in people's daily lives, work, and entertainment. Furthermore, to enhance user experience, the screen sizes of smart electronic devices are getting larger, and their portability and performance are also constantly improving. The demand for users to open and use multiple windows simultaneously on smart electronic devices continues to rise. For example, when students use electronic devices to attend online classes, they need to open educational applications or websites to play online course videos. At the same time, users often need to open note-taking applications to take notes while watching the videos. Additionally, users may need to open translation applications to look up words and translate. In this case, users may open and use three windows simultaneously on the electronic device. Similarly, while watching videos using video applications, users may also be using instant messaging applications. In this case, users need to open and use both the video application window and the messaging application window on the screen of the electronic device simultaneously to continue chatting while watching the video. For example, when creating a customized travel itinerary, users might need to simultaneously view navigation apps, travel guide sharing apps, and note-taking apps; when shopping, they might need to open and view different shopping apps simultaneously to compare prices for the same product across multiple platforms. Furthermore, in some scenarios, users might want to be able to view and operate multiple interfaces of the same application simultaneously, with these interfaces displayed in different windows. For instance, users might need to search for multiple pieces of content simultaneously. In this case, users might need to open multiple windows of the same browser-like application simultaneously, searching for different content in each window. Similarly, users might need to open multiple windows of the same note-taking app simultaneously to view multiple notes. It is understood that the above use cases are merely examples to help readers better understand the application scenarios of this application, which include, but are not limited to, the aforementioned multi-window scenarios.

[0186] In the aforementioned scenario, users need to open multiple windows simultaneously on their electronic devices and often need to view the content displayed in multiple windows at the same time. Therefore, users need to adjust the layout of these windows appropriately. For example, users need to ensure that the windows do not obstruct each other so that they can view the content displayed in different windows simultaneously. However, users often need to go through cumbersome operations to adjust the layout of the multiple windows to a satisfactory result.

[0187] The following, with reference to Figures 1A-1M, exemplarily describes one implementation method of adjusting the layout of multiple windows in a multi-window scenario using an electronic device in this application embodiment. It is understood that this application embodiment does not limit the type of electronic device. The electronic device can be a desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, smart home device, and / or smart city device.

[0188] This application uses a tablet as an example for illustration.

[0189] Figures 1A(a)-1M are schematic diagrams of the interface of a set of electronic devices provided in the embodiments of this application, showing how to open multiple windows and adjust the layout.

[0190] The interface 1a(a) shown in Figure 1A(a) is the user interface displayed by the electronic device after the user turns it on. The interface 1a(a) includes a screen display area 110.

[0191] The screen display area 110 can display the taskbar 113. The taskbar 113 can contain multiple icons, including application icons, folder icons (not shown in Figure 1A(a)), etc. The application icons in the taskbar 113 can be arranged according to the user's usage frequency and recent usage time. Alternatively, the application icons in the taskbar 113 can be fixed by the system and not updated according to the user's usage frequency and time; this embodiment of the application does not impose any limitations on this.

[0192] Optionally, in some embodiments of this application, the taskbar 113 may include a first part 113-1 and a second part 113-2. The first part 113-1 may display application icons that are fixed in place by the system, and the second part 113-2 may display application icons of recently opened applications.

[0193] The screen display area 110 can also display a status bar 111. In the conventional design of electronic devices, the status bar 111 typically includes a wireless fidelity (Wi-Fi) signal strength indicator, a battery status indicator, a time indicator, etc. In some scenarios, the status bar 111 may also include one or more signal strength indicators for mobile communication signals (also known as cellular signals) (not shown in Figure 1A(a)). Optionally, in the conventional design of electronic devices, the status bar 111 may also display icons of applications that currently have notification messages.

[0194] For example, in some embodiments of this application, the screen display area 110 displays by default the application icons corresponding to all or some of the applications installed on the electronic device, as shown in display area 112 of FIG1A(a). When the screen display area 110 only displays the application icons corresponding to some of the applications installed on the electronic device, the screen display area 110 may also display a page indicator 114, which can be used to indicate which page among multiple pages carrying multiple applications is currently displayed on the electronic device. Users can browse other pages by swiping the screen display area 110 left or right. Optionally, the page indicator 114 may also be replaced by a search box (not shown in FIG1A(a)), which can be used to provide the function of searching for applications on the electronic device. It is understood that in some embodiments of this application, the application icons in display area 112 may include all application icons in taskbar 113.

[0195] For example, in some embodiments of this application, the first part 113-1 of the taskbar 113 displays the application icon 115 of application APP-1, the application icon 116 of application APP-2, and the application icon 117 of application APP-3. The application types of APP-1, APP-2, and APP-3 are not limited here; for example, they can be instant messaging applications, video applications, shopping applications, etc.

[0196] After receiving and responding to a trigger operation on an application icon, the electronic device can launch the corresponding application. Specifically, upon receiving and responding to a trigger operation on an application icon, the electronic device runs the application corresponding to the application icon that received the trigger operation and displays the application interface of the corresponding application in the screen display area 110. For example, in some embodiments of this application, the electronic device receives and responds to a trigger operation on application icon 115 (e.g., a click operation as shown in FIG1A) and displays interface 1b as shown in FIG1B.

[0197] As shown in Figure 1B, the electronic device can open a full-screen window in the screen display area 110, displaying the application interface of application APP-1 corresponding to application icon 115. Optionally, a status bar 111 can be displayed above the application interface. Optionally, a control 120 can be provided above the application interface of APP-1, and the electronic device can receive and respond to the trigger operation of the control 120 to change the display mode or display position of the application interface of the opened application.

[0198] As shown in Figure 1B, when the electronic device displays the application interface in a full-screen window, the user interface will cover the icons and controls displayed in the screen display area 110.

[0199] To make it easier for users to open multiple windows and adjust the layout of the opened windows, in one possible implementation, the electronic device can also display the opened application interface in a floating window.

[0200] For example, in one possible implementation, the electronic device can provide an entry point to change the display mode of the application interface through the control 120 shown in FIG1B. For example, upon receiving and responding to a trigger operation on the control 120 (e.g., a click operation on the control 120 shown in FIG1B), the electronic device can display the interface 1c(a) shown in FIG1C(a). As shown in FIG1C(a), the electronic device can display a control bar 131 above the application interface of APP-1, wherein the control bar 131 may include a full-screen control 131-1, a split-screen control 131-2, and a floating window control 131-3. Specifically, upon receiving and responding to a trigger operation on the full-screen control 131-1, the electronic device can display the application interface in a full-screen window. Upon receiving and responding to a trigger operation on the split-screen control 131-2, the electronic device can display the application interface in a split-screen mode. Upon receiving and responding to a trigger operation on the floating window control 131-3, the electronic device can display the application interface in a floating window. Optionally, in one possible implementation, the electronic device can indicate the display mode of the current application interface by setting a control to a selected state (e.g., a certain color). For example, as shown in FIG1C(a), the application interface of APP-1 is displayed in a full-screen window, then the color of the full-screen control 131-1 is different from the colors of the split-screen control 131-2 and the floating window control 131-3. Exemplarily, the electronic device receives and responds to a trigger operation on the floating window control 131-3 (e.g., a click operation on the floating window control 131-3 shown in FIG1C(a)) and displays the application interface of application APP-1 in the floating window, as shown in the floating window 141 in FIG1D. It is understood that the layout of the floating window 141 in the screen display area 110 in FIG1D is only an example, and the floating window 141 may also be displayed in other locations in the screen display area 110 at other sizes.

[0201] In another possible implementation, the electronic device may also provide a side taskbar. Upon receiving and responding to a trigger operation on an application icon in the side taskbar, the electronic device may display the corresponding application's interface in a floating window by default. For example, in some embodiments of this application, upon receiving and responding to a trigger operation, the electronic device may display interface 1c(b) as shown in Figure 1C(b). For example, the trigger operation may be a swipe operation as shown in Figure 1A, i.e., swiping from the left edge of the screen towards the center.

[0202] Referring to Figure 1C(b), the electronic device can, by example, display a side taskbar 132. The side taskbar 132 can, by example, display some or all of the application icons installed on the electronic device. Optionally, the side taskbar 132 can also be displayed in other areas such as the right side or top of the screen display area 110; this application does not limit this. In one possible implementation, the electronic device receives and responds to a trigger operation on an application icon in the side taskbar 132 (e.g., a click operation on application icon 132-1 as shown in Figure 1C(b)). The electronic device can, by default, display the application interface of application APP-1 corresponding to application icon 132-1 in a floating window, as shown in the floating window 141 of Figure 1D.

[0203] Understandably, the electronic device can receive and respond to the trigger operation to display the side taskbar 132 not only on interface 1a shown in Figure 1A, but also on any other interface. For example, the electronic device can also receive the trigger operation to display the side taskbar 132 on interface 1b shown in Figure 1B.

[0204] In another possible implementation, exemplaryly, the electronic device may also provide a control center interface 133 as shown in FIG1C(c). Exemplarily, in some embodiments of this application, upon receiving and responding to a trigger operation, the electronic device may display interface 1c(c) as shown in FIG1C(c). Exemplarily, the trigger operation may be a swipe operation as shown in FIG1B, i.e., swiping from the top edge of the screen to the bottom of the screen.

[0205] Referring to Figure 1C(c), for example, the control center interface 133 can be displayed in the screen display area 110. Optionally, in order to improve the user experience, make the user interface more concise, and highlight the control center interface 133, a mask 134 can be set on the interface 1b to cover the interface 1b after the control center interface 133 is brought up.

[0206] Understandably, the electronic device can receive a trigger operation and display the control center interface 133 not only on interface 1b shown in Figure 1B, but also on any other interface. For example, the electronic device can also receive a trigger operation and display the control center interface 133 on interface 1a shown in Figure 1A.

[0207] As shown in Figure 1C(c), the control center interface 133 can display multiple controls. These controls can be used to control the electronic device, such as enabling the electronic device to perform a specific function or enter a certain state. The controls can also indicate the current state of the electronic device. For example, receiving and responding to a trigger operation on control 133-2, the electronic device can activate airplane mode. Receiving and responding to a trigger operation on control 133-3, the electronic device can activate Bluetooth. Optionally, the electronic device can also receive and respond to trigger operations on controls to set the controls to a selected state (e.g., a certain color), thereby indicating whether the electronic device has performed a certain function or entered a certain state. For example, the background color of control 133-2 indicates that airplane mode is not turned on, and the background color of control 133-3 indicates that Bluetooth is turned on. It is understood that the controls shown in Figure 1C(c) are only one example of controls that can be displayed in the control center interface 133, and the controls displayed in the control center interface 133 can be controls that perform any function. In some embodiments of this application, upon receiving and responding to a triggering operation (e.g., a click operation on any location in the overlay 134 other than the display location of the control center interface 133), the electronic device can hide the control center interface 133, thereby displaying the interface before the control center interface 133 was invoked.

[0208] For example, in some embodiments of this application, the electronic device may provide a control 133-1 in the control center interface 133. Upon receiving and responding to a trigger operation on the control 133-1, the electronic device may enter a specific mode, causing the electronic device to display the application interface of the opened application in a floating window by default (hereinafter referred to as the floating window mode for ease of description).

[0209] When the electronic device enters the floating window mode, it receives and responds to the trigger operation of the application icon 115 shown in FIG1A (for example, the click operation shown in FIG1A). The electronic device can display the application interface of the application APP-1 corresponding to the application icon 115 in the floating window by default, as shown in the floating window 141 in FIG1D.

[0210] As shown in Figure 1D, the floating window 141 may include a top operation bar 142, an application display area 143, and a bottom operation bar 144. The application display area 143 may display the application interface of the application APP-1 corresponding to the application icon 115.

[0211] For example, the top operation bar 142 of the floating window 141 may display a maximize control 145, a minimize control 146, and a floating window close control 147. Users can move the floating window's display position on the screen or change its size by operating the top operation bar 142 and the bottom operation bar 144.

[0212] In some embodiments of this application, when the electronic device enters the floating window mode and a floating window is already open, the user can continue to click on the application icons in the screen display area 110 to open more floating windows. For example, on interface 1d as shown in FIG1D, the electronic device can receive and respond to a trigger operation on application icon 116 (e.g., the trigger operation could be a click operation on application icon 116 as shown in FIG1D), displaying floating window 151 as shown in FIG1E. The application display area 152 of floating window 151 can display the application interface of application APP-2 corresponding to application icon 116. On interface 1d as shown in FIG1D, the electronic device can also receive and respond to a trigger operation on application icon 117 (e.g., the trigger operation could be a click operation on application icon 117 as shown in FIG1D), displaying floating window 155 as shown in FIG1E. The application display area 156 of floating window 155 can display the application interface of application APP-3 corresponding to application icon 117. The floating window 151 includes a top operation bar 153 and a bottom operation bar 154, and the floating window 155 includes a top operation bar 157 and a bottom operation bar 158.

[0213] It is understood that in some embodiments of this application, the multiple floating windows opened by the electronic device may also be different floating windows of the same application. For example, the electronic device may also receive and respond to multiple trigger operations on the application icon 115 shown in FIG1D (e.g., three click operations on the application icon 115), and display the floating windows 141, 151, and 155 shown in FIG1E respectively. Among them, the application display areas 143, 152, and 156 all display the application interface of the application APP-1 corresponding to the application icon 115.

[0214] Understandably, in one possible implementation, the electronic device can receive and respond to trigger operations on one or more application icons in the side taskbar 132 multiple times, even when not in floating window mode, to display the corresponding multiple application interfaces in the floating window. For example, the electronic device can receive and respond to trigger operations on application icons 132-1, 132-2, and 132-3 in the side taskbar 132 shown in Figure 1C(b), respectively, to display interface 1e as shown in Figure 1E.

[0215] Understandably, in one possible implementation, even when the electronic device is not in floating window mode, it can open multiple floating windows through multiple operations as shown in Figures 1B-1C(a). For example, the electronic device can first display the application interface in a full-screen window, and then, in response to the trigger operation acting on the floating window controls 131-3, display the application interface of the corresponding application in the floating window.

[0216] As shown in Figure 1E, the electronic device can display floating windows 141, 151, and 155 sequentially according to the order in which applications are opened. Under normal circumstances, the opened floating windows will be displayed randomly in the screen display area 110, with the floating window of a later-opened application possibly appearing on top of the floating window of an earlier-opened application. Therefore, the layout of the three floating windows may partially overlap, resulting in obstruction between the application display areas 143, 152, and 156. For example, part of application display area 143 may be obscured by application display area 152, and part of application display area 152 may be obscured by application display area 156, preventing the user from viewing the complete interface of all three windows simultaneously. Furthermore, floating windows 141, 151, and 155 do not fill the entire screen display area 110, failing to fully utilize the display area provided by the electronic device, resulting in poor display quality for the three windows.

[0217] Users can adjust the window layout to achieve a better display effect by manipulating the top and bottom operation bars in each floating window to change the display coordinates or size of the floating window on the screen.

[0218] Figures 1E-1L exemplify the process of adjusting the layout of a floating window by manipulating its top and bottom operation bars.

[0219] For example, in some embodiments of this application, the electronic device can receive and respond to a trigger operation on the top operation bar 157 of the floating window 155, changing the display coordinates of the floating window 155 from the coordinates shown in FIG1E to the coordinates shown in FIG1F. For example, referring to FIG1E and FIG1F, the trigger operation can be to press and drag the top operation bar 157 (as shown in FIG1E) (as shown in FIG1F), so that the floating window 155 follows the drag operation and moves a drag distance along the drag direction.

[0220] For example, in some embodiments of this application, the electronic device can also receive and respond to a trigger operation on the bottom operation bar 158 of the floating window 155, changing the size of the floating window 155 from the size shown in FIG. 1G to the size shown in FIG. 1H. For example, referring to FIG. 1G and FIG. 1H, the trigger operation can be to press and drag the rightmost side of the bottom operation bar 158 (as shown in FIG. 1G) (as shown in FIG. 1H), so that the lower right vertex of the floating window 155 follows the drag operation and moves a drag distance along the drag direction. The upper right vertex of the floating window 155 will also move accordingly, thereby changing the size of the floating window 155 accordingly. It is understood that when the size of the floating window changes, the display coordinates of the floating window will also change.

[0221] As shown in Figures 1E-1H, the layout of floating window 155 can be adjusted to the upper right corner of the screen and displayed in a larger size through two trigger operations. However, as shown in Figure 1H, the layouts of floating windows 141, 151, and 155 still partially overlap. Furthermore, since the display length of floating window 151 is greater than the display area below floating window 155, if the user wishes to display floating window 151 below floating window 155 to make the floating window layout more compact and fully utilize the screen's display space, the display size of floating window 151 needs to be adjusted first, as shown in Figures 1I-1J.

[0222] As shown in Figures 1I-1J, exemplarily, an electronic device can receive and respond to a trigger operation on the bottom operation bar 154 of the floating window 151, changing the size of the floating window 151 from the size shown in Figure 1I to the size shown in Figure 1J. For example, referring to Figures 1I and 1J, the trigger operation can be to press and drag the rightmost side of the bottom operation bar 154 (as shown in Figure 1I) (as shown in Figure 1J), causing the lower right corner of the floating window 151 to follow the drag operation and move a drag distance along the drag direction. The lower left corner of the floating window 155 will also move accordingly, thus changing the size of the floating window 151 accordingly.

[0223] Subsequently, exemplarily, the electronic device can receive and respond to a trigger operation on the top operation bar 153 of the floating window 151, changing the display coordinates of the floating window 151 from the coordinates shown in FIG1K to the coordinates shown in FIG1L. For example, referring to FIG1K and FIG1L, the trigger operation can be pressing and dragging the top operation bar 153 (as shown in FIG1K) (as shown in FIG1L), causing the floating window 151 to follow the drag operation and move a drag distance along the drag direction.

[0224] As can be understood, the location and process of the triggering operation shown in Figures 1E-1L are only examples. Users can also adjust the layout of the floating window by operating other positions of the floating window and other types of triggering operations.

[0225] Understandably, users can continue to adjust the layout of the floating windows on the interface 1l shown in Figure 1L until the layout of the floating windows meets their usage needs, for example, there is no obstruction between the various floating windows and they are arranged closely together, as shown in Figure 1M.

[0226] As shown in Figures 1A-1M, in multi-window scenarios, users need to perform multiple operations on the floating window to achieve a satisfactory window layout, which is cumbersome. Furthermore, users may be dissatisfied with the results of these adjustments. For example, after moving the window to new coordinates, the effect may not be ideal. In this case, the user needs to readjust the window's display position.

[0227] Therefore, this application provides a screen layout method for multi-window scenarios. Specifically, the electronic device can provide a layout template and receive trigger operations applied to the layout template. In response to the trigger operation applied to the layout template, the electronic device can automatically adjust the layout of multiple open windows according to the style of the layout template. Users can conveniently and quickly adjust the layout of multiple windows by clicking on the layout template to achieve a better display effect.

[0228] Typically, users need to open multiple windows before they can adjust the layout of multiple windows.

[0229] Optionally, in one possible implementation, to enable users to conveniently open multiple windows that need to be displayed simultaneously, this application embodiment provides another specific mode. When the electronic device enters this other specific mode, the electronic device displays the application interface of the opened application in a floating window by default, thereby enabling users to conveniently open multiple windows. For ease of explanation, this other specific mode will be referred to below as the free floating window mode.

[0230] Optionally, the electronic device can limit the number of floating windows displayed simultaneously to J when not in free floating window mode. When in free floating window mode, more than J floating windows can be displayed simultaneously. For example, when not in free floating window mode, the electronic device can limit the display to only two floating windows at a time. When the electronic device receives and responds to a trigger operation to display a third floating window, one of the two previously displayed floating windows will be closed. Optionally, after the floating window is closed, the application displayed in the floating window can be closed directly or run in the background. Optionally, when the floating window is closed and the application displayed in the floating window is running in the background, the application can be invoked via a floating ball. When the electronic device enters free floating window mode, three or more floating windows can be displayed simultaneously.

[0231] For example, Figures 2A-2G are schematic diagrams of a user interface for opening multiple windows in a free-floating window mode provided by an embodiment of this application.

[0232] For example, in one possible implementation, the electronic device can provide a free-floating window control. Upon receiving a trigger operation applied to the free-floating window control, the electronic device can enter free-floating window mode in response to the trigger operation.

[0233] For example, as shown in the user interface 2a of FIG2A, the electronic device can add a third part 210 to the taskbar 113. This may include a free-floating window control 211.

[0234] By displaying the free-floating window control in the taskbar, this application embodiment provides a more explicit entry point, making it easier for users to perceive the entry point of the free-floating window mode and enabling users to enter the free-floating window mode more conveniently.

[0235] Optionally, the icon of the free-floating window control 211 can be composed of three overlapping rectangles. Optionally, after the user long-presses the free-floating window control 211, a pop-up window will appear introducing the functions of the free-floating window control 211.

[0236] Optionally, in the interface 2a shown in Figure 2A, the taskbar 113 can be fixedly displayed at the bottom of the desktop display area, and can change according to whether the electronic device displays a landscape or portrait interface. The free-floating window control 211 can also be fixedly displayed in other positions of the screen display area 110, or can be displayed in other positions of the screen display area 110 in response to a trigger operation. For example, the free-floating window control 211 can be displayed in the taskbar that slides out from the left and right sides of the electronic device screen, or in the control center interface that pops up from the top of the electronic device (as shown in the control center interface 131 in Figure 1C). The free-floating window control 211 can also be on the physical buttons of the electronic device (triggered by long press / short press), and this embodiment of the application does not limit this.

[0237] When an electronic device receives a trigger operation applied to a free-floating window control (e.g., a click operation on free-floating window control 211 as shown in FIG. 2A), in response to the trigger operation, the electronic device can enter free-floating window mode and display interface 2c as shown in FIG. 2C. Optionally, the electronic device can also display a prompt indicating that it has entered free-floating window mode after entering free-floating window mode. For example, as shown in FIG. 2C, prompt 230 may optionally include "Free-floating window mode has been entered". Optionally, the electronic device can also set the free-floating window control to a selected state (e.g., display it in a specific color) to indicate that the electronic device is currently in free-floating window mode. For example, the color of free-floating window control 211 shown in FIG. 2C may be different from the color of free-floating window control 211 shown in FIG. 2A, thereby prompting the user that the electronic device is currently in free-floating window mode.

[0238] Optionally, in one possible implementation, during the switch to the free-floating window mode, to improve the user's visual experience and remind the user that the electronic device is switching modes, dynamic effects can be set during the switching process. For example, during the switch from Figure 2A to Figure 2C, the dynamic effects shown in Figures 2B(a) and 2B(b) can be displayed. Specifically, a mask can be set on interface 2a shown in Figure 2A to cover interface 2a, and dynamic effects can be set on the mask. As shown in interface 2b(a) in Figure 2B(a), an mask 220 is set on the original interface 2a, covering the screen display area 110. Simultaneously, an animation display area 221 is set in the center of the mask 220, and a switching animation 222 is displayed in the animation display area 221. For example, the switching animation 222 can be a corresponding animation design based on the icon of the free-floating window control 211, thereby reminding the user that they are switching to the free-floating window mode. For example, as shown in Figures 2B(a) and 2B(b), the switching animation 222 can be three partially overlapping rectangles arranged from the inside out, with the transparency of the three rectangles gradually decreasing from the inside out (as shown in Figure 2B(a)). The dynamic effect can be that the three rectangles move sequentially from the inside out, with the transparency of the outermost rectangle gradually increasing until it disappears completely (as shown in Figure 2B(b)). Simultaneously, as the outermost rectangle disappears, a new rectangle appears on the innermost side. After entering the free-floating window mode, the electronic device removes the overlay 220 and the switching animation 222 on the overlay 220, displaying the interface 2c shown in Figure 2C.

[0239] In one possible implementation, after an electronic device enters a floating window, it can display multiple application icons. Receiving and responding to trigger operations on the application icons, the electronic device can display the application interface of the opened application in the floating window by default, thereby improving the convenience of opening multiple windows.

[0240] As shown in interface 2c in Figure 2C, the electronic device can display all or part of the application icons installed on the electronic device in the screen display area 110, as shown in display area 233. Users can click on the application icons in display area 233 or the taskbar. For example, upon receiving and responding to a trigger operation on application icon 231 (e.g., a click operation on application icon 231 as shown in Figure 2C), the electronic device can display a floating window 240 as shown in Figure 2D. The application display area 241 of the floating window 240 can display the application interface of APP-1 corresponding to application icon 231. It is understood that application APP-1 can be either a system application built into the electronic device or a third-party application; this application does not impose any restrictions on this.

[0241] As shown in Figure 2D, when the electronic device displays the application interface of an opened application in a floating window, the floating window only occupies a portion of the screen display area 110, not the entire area. At this time, the taskbar 113 can continue to be displayed in the screen display area 110, thus facilitating the user to open more windows.

[0242] Optionally, in one possible implementation, when the electronic device enters the free-floating window mode, if at least one floating window is displayed in the screen display area 110, the screen display area 110 may only display the desktop background and the open window (floating window 240), without displaying other application icons outside the taskbar 113. As shown in Figure 2D, compared to the interface 2c before opening the floating window 240 as shown in Figure 2C, the screen display area 110 in Figure 2D only displays the desktop background, and does not display the application icons in the display area 233 shown in Figure 2C.

[0243] Optionally, in one possible implementation, when the electronic device is not in free-floating window mode, if at least one floating window is displayed in the screen display area 110, the screen display area 110 can continue to display application icons in areas other than the taskbar 113. For example, in the interface 1a(a) shown in FIG1A(a), the electronic device displays application icons in the display area 112. If the electronic device displays at least one floating window when not in free-floating window mode, as shown in FIG1D, the electronic device can continue to display application icons in the display area 112 on the interface shown in FIG1d.

[0244] In another possible implementation, the screen display area 110 can also display the display area 223 as shown in Figure 2C.

[0245] In the interface 2d shown in Figure 2D, the user can continue to open more windows. For example, upon receiving and responding to a trigger operation on application icon 242 (e.g., a click operation on application icon 242 as shown in Figure 2D), the electronic device can display a floating window 250 as shown in Figure 2E. The application display area 251 of the floating window 250 can display the application interface of APP-2 corresponding to application icon 242. Upon receiving and responding to a trigger operation on application icon 252 shown in Figure 2E (e.g., a click operation on application icon 252 as shown in Figure 2E), the electronic device can display a floating window 260 as shown in Figure 2F. The application display area 261 of the floating window 260 can display the application interface of APP-3 corresponding to application icon 252. Upon receiving and responding to a trigger operation on application icon 262 shown in Figure 2F (e.g., a click operation on application icon 262 as shown in Figure 2F), the electronic device can display the application interface of APP-4 corresponding to application icon 262 in a floating window 270 as shown in Figure 2G. This application does not limit the number of floating windows that can be opened by the electronic device.

[0246] For example, in one possible implementation, the application corresponding to the application icon triggered by the operation may not support opening as a floating window. In this case, after receiving and responding to the trigger operation on the application icon, the electronic device may not run the corresponding application and may display a prompt. Optionally, the prompt may be a text prompt, for example, the text prompt may be "This application does not support floating window display", or the text prompt may be "This application can only be opened in one window".

[0247] Optionally, in one possible implementation, as shown in Figures 2D-2F, the electronic device can center-align the floating windows within the screen display area 110 based on the number of open floating windows. When the number of open floating windows cannot be center-aligned without obstructing each other within the screen display area 110, the user can be prompted that other floating windows are displayed below the upper floating window by exposing a portion of the obscured floating window. As shown in Figure 2G, to prompt the user that other floating windows are displayed below floating window 270, a portion of the display area of ​​the lower floating window 250 can be exposed.

[0248] As shown in Figures 2E-2G, electronic devices can display multiple floating windows, each showing the interface of an application. To better browse multiple windows simultaneously, users can adjust their layout.

[0249] To improve the efficiency and effectiveness of users adjusting the layout of multiple windows, this application provides a layout template, which allows users to quickly and efficiently adjust the layout of multiple windows.

[0250] Optionally, in one possible implementation, the electronic device can provide a convenient entry point for the layout template. For example, the electronic device can provide a quick layout control in free-floating window mode. As shown in interface 2c of Figure 2C, after the electronic device enters free-floating window mode, the quick layout control 232 can be displayed in the third part 210 of the taskbar 113. Optionally, the electronic device can also provide a quick layout control in non-free-floating window mode. For example, the quick layout control 232 can be fixedly displayed in the taskbar 113, or fixedly displayed in another position in the screen display area 110, or displayed in another position in the screen display area 110 in response to a trigger operation. For example, it can be displayed in the taskbar that slides out from the left or right sides of the electronic device screen, or displayed in the control center interface that pops up from the top of the electronic device (as shown in control center interface 131 of Figure 1C). The quick layout control 232 can also be a physical button of the electronic device (triggered by long press / short press), which is not limited in this embodiment.

[0251] This application illustrates the use of quick layout controls in a free-floating window mode on an electronic device. In free-floating window mode, after opening multiple floating windows, users can conveniently and efficiently adjust the layout of these windows using the quick layout controls.

[0252] When an electronic device receives a trigger operation applied to a shortcut layout control, it can display a template selection interface in response to the trigger operation. For example, the template selection interface can be shown in Figures 3A(a)-3B(b).

[0253] Taking the template selection interface 310 shown in Figure 3A(a) as an example, each template selection interface may include a name 312, a text prompt 313, and a layout template selection area 314. For example, the name 312 of the template selection interface could be "Quick Layout". The text prompt 313 could be a function description, for example, "Click the following icon to quickly layout desktop windows". The layout template selection area 314 may include multiple layout templates, and each layout template may include at least two template sub-areas. Different layout templates may have different styles. The style of a layout template refers to the relative positional relationship of each template sub-area within the display area of ​​all template sub-areas. The relative positional relationship can also determine the relative size of each template sub-area. Optionally, a template sub-area can also be called a sub-area within a layout template.

[0254] The template selection interface can be displayed as shown in Figure 3C. For example, the electronic device can receive a trigger operation on the quick layout control 232 (e.g., a click operation on the quick layout control 232 as shown in Figure 2F) on the interface shown in Figure 2F. In response to the trigger operation, the electronic device can display the template selection interface 310 in the interface 3c shown in Figure 3C.

[0255] Optionally, in one possible implementation, the electronic device can provide different layout templates when displaying a landscape interface and a portrait interface. For example, when displaying a landscape interface, the electronic device can provide a template selection interface 310 as shown in Figure 3A(a), as shown in Figure 3C. When displaying a portrait interface, the electronic device can provide a template selection interface 311 as shown in Figure 3A(b), as shown in Figure 3D. The layout templates displayed in the layout template selection areas of template selection interfaces 310 and 311 have different styles, and the layout styles can be adapted to the different screen orientations of the electronic device.

[0256] Optionally, in one possible implementation, the electronic device can also provide different layout templates based on the number of windows that can be simultaneously displayed in the screen display area 110 while ensuring display quality. For example, if the screen display area 110 of the electronic device is small, or the electronic device has weak performance, the electronic device can provide a template selection interface as shown in Figures 3A(a) and 3A(b). In this layout template selection area, the displayed layout templates include a maximum of three template sub-areas. If the screen display area 110 of the electronic device is large, or the electronic device has strong performance, the electronic device can provide a template selection interface as shown in Figures 3B(a) and 3B(b). In this layout template selection area, the displayed layout templates can include a maximum of four template sub-areas. The template selection interface shown in Figures 3B(a) and 3B(b) can also be displayed according to the screen orientation of the electronic device. For example, when the electronic device displays a landscape interface, it can provide a template selection interface 320 as shown in Figure 3B(a), as shown in Figure 3E. When an electronic device displays a portrait-oriented interface, it can provide a template selection interface 321 as shown in Figure 3B(b), as shown in Figure 3F. The layout templates displayed in the layout template selection areas of template selection interfaces 320 and 321 have different styles.

[0257] It is understood that the template selection interface shown in Figures 3A(a)-3B(b) is only an example, and this application does not limit the specific number and style of the template selection interface and the layout templates displayed therein.

[0258] Understandably, electronic devices can receive and respond to trigger operations on quick layout controls on any interface displaying quick layout controls, thus displaying a template selection interface. Figures 3C-3F are for illustrative purposes only.

[0259] Understandably, the content displayed on the template selection interface of electronic devices is actually icons of multiple layout templates. Users can click on the layout template icon to use the corresponding layout template to arrange the opened window.

[0260] After the electronic device displays the template selection interface, it receives a trigger operation for any layout template on the template selection interface. In response to the trigger operation, the electronic device can arrange multiple open windows according to the style of the layout template.

[0261] For example, on the interface 3c shown in FIG3C, a trigger operation is received on the layout template 330 in the template selection interface 310 (e.g., a click operation on the layout template 330 shown in FIG3C). The electronic device can display the layout adjustment process shown in FIG4A-FIG4B and finally display the layout adjustment result shown in FIG8C.

[0262] As shown in Figure 3C, layout template 330 has three template sub-regions: template sub-region 331, template sub-region 332, and template sub-region 333. The layout template 330 is arranged such that, within the same rectangular display area, template sub-region 331 is displayed on the left, template sub-region 332 is displayed on the upper right, and template sub-region 333 is displayed on the lower right. The left and right sides of template sub-regions 332 and 333 can be aligned, and the top and bottom edges of the three template sub-regions can be aligned.

[0263] Upon receiving a trigger operation applied to the layout template 330 in the template selection interface 310 (e.g., a click operation on the layout template 330 as shown in Figure 3C), the electronic device can automatically adjust the layout of the currently open multiple windows according to the style of the layout template 330. Specifically, as shown in Figures 4A-4B, the electronic device can adjust the layout of the currently open floating windows 240, 250, and 260 from the layout shown in Figure 4A to the layout shown in Figure 4B. As shown in Figure 4B, the layout style of floating windows 240, 250, and 260 is the same as that of the layout template 330. Specifically, floating window 240 is displayed on the left side of the screen display area 110; floating windows 250 and 260 are displayed at the top and bottom positions on the right side of the screen display area 110, respectively. The left and right sides of floating windows 250 and 260 are aligned, and the top and bottom edges of the three floating windows are aligned.

[0264] After the electronic device adjusts the window layout according to the layout template, the application interface corresponding to each window can be redisplayed in the adjusted window, as shown in Figure 4C. As shown in Figure 4C, the three floating windows do not obstruct each other, and the display size of each floating window is reasonably distributed, allowing the user to browse the application interfaces in all three floating windows simultaneously. At the same time, the three floating windows are neatly and closely arranged, making full use of the display space of the screen display area 110 and achieving the best possible display effect on the screen display area 110. Optionally, after the layout adjustment is completed, the electronic device can also display a status bar 111 above the screen display area 110. Optionally, after the layout adjustment is completed, the electronic device can automatically hide the taskbar 113 to prevent the taskbar 113 from obscuring the application interface.

[0265] Because the display size of windows may change during window layout adjustments, the application corresponding to each window may need to redraw its interface. Optionally, before the application interface is fully drawn, the electronic device can display a mask and application icon on each window. After the application interface is redrawn, the mask and icon are removed, thus displaying the redrawn application interface in the window to avoid abrupt changes in the display and improve the display effect and user experience during window layout adjustments. For example, during the layout adjustment process shown in Figures 4A-4B, the electronic device can display masks 413, 414, and 415 on floating windows 240, 250, and 260, respectively, with the masks covering the entire floating window. Optionally, after the window is covered by a mask, the electronic device can also hide the window, i.e., not display it. The overlay 413 of floating window 240 can display the application icon 410 of application APP-1, the overlay 414 of floating window 250 can display the application icon 411 of application APP-2, and the overlay 415 of floating window 260 can display the application icon 412 of application APP-3. The application icons indicate the application displayed in the window. After the application redraws its new interface, the electronic device can display interface 4c as shown in Figure 4C. As shown in Figure 4C, each floating window can display the application interface of the corresponding application, and the size of the application interface is different from the size before the window layout adjustment (as shown in Figure 3C). Optionally, during the window layout adjustment process, the electronic device can also present the window layout change process in a dynamic effect. The overlay displayed on the window can also change dynamically accordingly, thereby achieving a smooth transition and preventing the displayed interface from abruptly changing from interface 4a as shown in Figure 4A to interface 4b as shown in Figure 4B.

[0266] It is understandable that, optionally, the electronic device may not display the layout adjustment process shown in Figures 4A-4B. Instead, on the interface 3c shown in Figure 3C, after receiving a trigger operation on the layout template 330, the device may directly display the interface 4b shown in Figure 4B in response to the trigger operation.

[0267] Understandably, if the trigger operation received by the electronic device applies to different layout templates, the result of adjusting the layout according to the style of different layout templates will also be different. For example, on interface 3c as shown in Figure 3C, the electronic device receives a trigger operation applied to layout template 334. In response to the trigger operation, the electronic device adjusts the layout of the three floating windows shown in Figure 3C according to the style of layout template 334, as shown in Figure 4D. As shown in Figure 4D, the relative positional relationship of the three floating windows in the screen display area 110 is the same as the relative positional relationship of each template sub-region in the display area displaying all template sub-regions in layout template 334. Compared to interface 3c as shown in Figure 3C, in interface 3d as shown in Figure 4D, the three floating windows are arranged more closely, each floating window has a larger display size, and the screen display area 110 is utilized more fully.

[0268] Optionally, in one possible implementation, a trigger operation is received that acts on the shortcut layout control. In response to the trigger operation, the electronic device can display a layout template with a corresponding number of template sub-regions, based on the number of currently open windows.

[0269] Optionally, the electronic device may also display layout templates with different numbers of template sub-regions for users to choose from based on their personal needs and preferences. Understandably, when the electronic device displays layout templates with different numbers of template sub-regions in the template selection interface, the number of template sub-regions in the layout template selected by the user may differ from the number of currently open windows.

[0270] In one possible implementation, the number of template sub-regions in the layout template selected by the user may be less than the number of currently open windows. The electronic device can display some of the currently open windows in the layout of some template sub-regions, and shrink and display other windows with undetermined layouts in another set of template sub-regions.

[0271] For example, on interface 3c as shown in Figure 3C, the electronic device can also receive a trigger operation applied to layout template 335. As shown in Figure 3C, layout template 335 has two template sub-regions, namely template sub-region 336 and template sub-region 337; there are currently 3 open windows. In response to the trigger operation applied to layout template 335, the electronic device can display the layout adjustment process shown in Figure 5A, and finally display the layout adjustment result shown in Figure 5B.

[0272] As shown in Figure 5B, the electronic device can adjust the layout of a currently open floating window to the layout of any template sub-region, such as adjusting the layout of floating window 240 to the layout of template sub-region 336 as shown in Figure 5B. Optionally, the electronic device can shrink and display floating windows with undetermined layouts within the layout of another template sub-region. As shown in Figure 5B, floating windows 250 and 260 are shrunk and displayed within the layout of template sub-region 337. Optionally, to indicate the layout of another template sub-region, the electronic device can display a mask in the screen display area 110 that is identical to the layout of the other template sub-region, such as mask 520 as shown in Figure 5B. The electronic device can display shrunk floating windows 250 and 260 on mask 520.

[0273] The user can select one of the floating windows with an undetermined layout, causing the electronic device to adjust the layout of the selected floating window to match the layout of another template sub-region. For example, on interface 5b as shown in Figure 5B, a trigger operation is received acting on floating window 250 (e.g., a click operation on floating window 250 as shown in Figure 5B). In response to the trigger operation, the electronic device can display interface 5c as shown in Figure 5C. As shown in Figure 5C, the electronic device adjusts the layout of floating window 250 to match the layout of template sub-region 337, with the relative positions of floating windows 240 and 250 in the screen display area 110 matching the style of layout template 335. Optionally, the electronic device can close the unselected floating window and its corresponding application, or hide the corresponding application in the background. Optionally, the user can use a floating ball or other trigger operations to bring up the application running in the background corresponding to the unselected floating window.

[0274] Optionally, during the window layout adjustment process, the mask settings and dynamic effects can be the same as the layout adjustment process shown in Figures 4A-4B. Alternatively, in another possible implementation, the electronic device can display a masked electronic device on applications with a finalized layout, or it can choose not to display a mask on applications with an incomplete layout. As shown in Figure 5A, the electronic device displays a mask 510 on the floating window 240 with a finalized layout as template sub-region 336, and displays the application icon 511 of the application corresponding to the floating window 240 on the mask. As shown in Figures 5A-5B, on the floating windows 250 and 260 with incomplete layouts, the mask can be omitted, and the corresponding application interfaces of APP-2 and APP-3 can continue to be displayed. Users can select applications to participate in the layout from among the applications with incomplete layouts based on the application interface, as shown in Figure 5B. Selecting based on the application interface is more intuitive than selecting based on the application icon.

[0275] Optionally, in one possible implementation, on interface 5b as shown in Figure 5B, the user can also open a new application. The electronic device can display the newly opened application in a floating window and set the layout of the floating window to the layout of template sub-region 337. Optionally, to facilitate the user opening new applications, when the number of template sub-regions in the layout template selected by the user is less than the number of currently open windows, the electronic device can continue to display the taskbar after displaying the current part of the windows in the layout of part of the template sub-regions. For example, in interface 5b as shown in Figure 5B, the electronic device can continue to display the taskbar 113.

[0276] In one possible implementation, the number of template sub-regions in the layout template selected by the user may exceed the number of currently open windows. The electronic device can adjust the layout of the currently open windows to match the layout of some template sub-regions, while other template sub-regions may not display windows.

[0277] For example, on interface 3e as shown in Figure 3E, the electronic device can receive a trigger operation applied to layout template 350. As shown in Figure 3E, layout template 350 has four template sub-regions: template sub-region 351, template sub-region 352, template sub-region 353, and template sub-region 354; currently, three windows are open. In response to the trigger operation applied to layout template 350, the electronic device can automatically adjust the layout of the multiple currently open windows according to the style of layout template 350. Specifically, the electronic device can display the layout adjustment process shown in Figures 6A-6B, and finally display the layout adjustment result shown in Figure 5C.

[0278] As shown in Figures 6A-6B, the electronic device can adjust the layout of floating windows 240, 250, and 260 to match the layout of three template sub-regions in layout template 350, while the window may not be displayed in another template sub-region (such as template sub-region 354). Optionally, during the layout adjustment process, the mask settings and dynamic effects can be the same as the layout adjustment process shown in Figures 4A-4B. For example, during the layout adjustment process shown in Figures 6A-6B, the electronic device can display masks 610, 611, and 612 on floating windows 240, 250, and 260, respectively, with the masks covering the entire floating window. On masks 610, 611, and 612, application icons 613 (APP-1), 614 (APP-2), and 615 (APP-3) can be displayed, respectively.

[0279] Optionally, to indicate the layout of a template sub-area that does not display a window, the electronic device can display a mask in the screen display area 110 that has the same layout as the template sub-area. For example, as shown in FIG6B, a mask 620 has the same layout as the template sub-area 354. The application icon may not be displayed in the mask 620.

[0280] After the layout adjustment is completed, the electronic device can display the interface 6c shown in Figure 6C. The layouts of floating windows 240, 250, and 260 are respectively the layouts of template sub-regions 351, 352, and 353 within layout template 350. Floating windows 240, 250, and 260 display the application interfaces of the corresponding applications APP-1, APP-2, and APP-3, respectively.

[0281] On an interface where some template sub-areas do not display windows, users can open new windows, and electronic devices can display these newly opened windows on the layout of the template sub-areas where no windows are displayed.

[0282] For example, on the interface shown in FIG6C, the electronic device can receive a trigger operation on the application icon 262 in the taskbar 113 (e.g., a click operation on the application icon 262 as shown in FIG6C). In response to the trigger operation, the electronic device can open the application APP-4 corresponding to the application icon 262. Optionally, the electronic device can also receive a trigger operation on the folder icon 630 in the taskbar 113 on the interface shown in FIG6C (e.g., a click operation on the folder icon 630 as shown in FIG6C). In response to the trigger operation, the electronic device can display the folder details interface 640 as shown in FIG6D. Upon receiving a trigger operation on the application icon 641 in the folder details interface 640 (e.g., a click operation on the application icon 641 as shown in FIG6D), the electronic device can open the application APP-4 corresponding to the application icon 641. It is understood that the electronic device can also receive and respond to trigger operations on other application icons displayed in other locations to open new applications. For example, an electronic device can display the add control 632 in the layout of a template sub-area where no window is displayed, as shown in Figure 6C. The user can open a new application by clicking the add control 632 to bring up the application icon selection interface. This application does not limit the method of opening a new application.

[0283] As shown in Figure 6F, the electronic device can display the application interface of application APP-4 in the floating window 650, and set the layout of the floating window 650 to the layout of the template sub-area 354. As shown in Figure 6F, the relative positions of the four floating windows in the screen display area 110 are the same as the style of the layout template 350.

[0284] Optionally, when the number of template sub-regions in the layout template selected by the user exceeds the number of currently open windows, the electronic device can continue to display the taskbar after adjusting the layout of the currently open windows according to the layout template style, in order to facilitate the user to continue opening new applications. For example, in interface 6c shown in Figure 6C, the electronic device can continue to display the taskbar 113. Optionally, in another possible implementation, when continuing to display the taskbar would obscure the currently defined layout of the floating window, the electronic device can also automatically hide the taskbar. For example, in interface 6c shown in Figure 6C, the application interface portion displayed in the floating window 260 is obscured by the taskbar 113; in this case, the electronic device can also automatically hide the taskbar 113 shown in Figure 6C in interface 6c. The electronic device can display other entry points for opening new applications, such as the add control 631 shown in Figure 6C.

[0285] Optionally, when each template sub-area layout displays windows, the electronic device can automatically hide the taskbar. For example, in the interface 6e shown in Figure 6E, the electronic device can also automatically hide the taskbar 113 shown in Figure 6E to avoid obscuring the application interface.

[0286] It is understandable that the scenario where the number of template sub-regions in the layout template selected by the user is greater than the number of currently open windows is not limited to the scenarios shown in Figures 6A-6F. For example, in interface 2e (shown in Figure 2E) with two windows open, the user can click the quick layout control and select a layout template with three template sub-regions in the template selection interface. For instance, it could be layout template 330 in template selection interface 310 (shown in Figure 3C). This application does not impose any limitations on this.

[0287] It is understandable that in scenarios where the number of template sub-regions in the layout template selected by the user is greater than the number of currently open windows, the user may select a layout template when only one window is open, and the screen layout method in a multi-window scenario provided in the embodiments of this application may also be applicable.

[0288] In one possible implementation, the user can first select a layout template and then open multiple windows. The electronic device can then display the applications opened by the user sequentially in the template sub-areas of the selected layout template, according to the style of the selected layout template.

[0289] For example, as shown in FIG7A, no floating window displaying the application is displayed in the screen display area 110. When the electronic device receives a trigger operation on the shortcut layout control 232 in the taskbar 113 (a click operation on the shortcut layout control 232 as shown in FIG7A), in response to the trigger operation, the template selection interface 310 shown in FIG7B can be displayed. On the interface 7b shown in FIG7B, when the electronic device receives a trigger operation on the layout template 330 in the template selection interface 310 (for example, a click operation on the layout template 330 as shown in FIG7B), in response to the trigger operation, the interface 7c shown in FIG7C can be displayed.

[0290] As shown in Figure 7C, the electronic device can display three overlays in the screen display area 110 according to the layout template 330. The layouts of overlays 730, 731, and 732 are the same as the layouts of template sub-regions 331, 332, and 333 in the layout template 330, respectively.

[0291] On interface 7c as shown in Figure 7C, the electronic device receives a trigger operation on the application icon 231 in the taskbar 113 (a click operation on the application icon 231 as shown in Figure 7C). In response to the trigger operation, interface 7d as shown in Figure 7D can be displayed. As shown in Figure 7D, the electronic device can open a floating window 740 and display the application interface of the application APP-1 corresponding to the application icon 231 in the floating window 740. The layout of the floating window 740 can be the same as the overlay 730 layout shown in Figure 7C.

[0292] On interface 7d as shown in Figure 7D, the electronic device receives trigger operations sequentially applied to application icons 242 and 252 in the taskbar 113 (click operations on application icons 242 and 252 as shown in Figure 7C). In response to the two trigger operations, the electronic device can sequentially open floating windows 750 and 760 as shown in Figure 7E. As shown in Figure 7E, floating windows 750 and 760 display the application interfaces of applications APP-2 and APP-3 corresponding to application icons 242 and 252, respectively. Simultaneously, the layout of floating windows 750 and 760 is the same as the layout of overlays 731 and 732 as shown in Figure 7C.

[0293] As shown in Figure 7E, the positional relationship of the three floating windows in the screen display area 110 is the same as that of the layout template 330.

[0294] It is understandable that, during the process shown in Figures 7C-7D, users may also open the application in other ways, and this application does not impose any restrictions on this.

[0295] Optionally, when a user selects a layout template and then opens multiple windows, to facilitate the user continuing to open new applications, the electronic device can continue to display the taskbar even when layouts with template sub-areas have not yet displayed windows. For example, as shown in Figures 7B-7D, the electronic device can display taskbar 113. In Figure 7E, each layout with a template sub-area displays a window, and the electronic device can automatically hide the taskbar 113 shown in Figure 7E (as shown in Figure 8A) to avoid obscuring the application interface.

[0296] In one possible implementation, after adjusting the layout of multiple windows using a layout template, the user can continue to adjust the window layout. For example, Figures 8A-8D are user interface diagrams illustrating a method for quickly exchanging window layouts provided in an embodiment of this application.

[0297] For example, Figure 8A shows an interface 8a displaying floating windows 240, 250 and 260 in the style of layout template 330.

[0298] For example, a user can swap the layout of windows by dragging one window to the display position of another window. For example, on interface 8a as shown in FIG8A, the electronic device receives a drag operation on the floating window 260 (e.g., pressing and dragging the horizontal bar control 810 upwards as shown in FIG8A). In response to the drag operation, the electronic device can display interface 8b as shown in FIG8B. As shown in FIG8B, the floating window 260 can move upwards following the drag operation. Optionally, during the movement, the display size of the floating window 260 can be reduced to facilitate the user dragging it to the desired position. As shown in FIG8B, when the floating window 260 is dragged to the display position of the floating window 250, in response to the drag operation, the electronic device can display the layout swapping interface as shown in FIG8C, and finally display the layout adjustment result as shown in FIG8D. As shown in FIG8D, the layout of the floating window 250 is the same as the layout of the floating window 260 shown in FIG8A, and the layout of the floating window 260 is the same as the layout of the floating window 250 shown in FIG8A. In this layout swap, floating windows 250 and 260 still display the application interfaces of apps APP-2 and APP-3, respectively. Optionally, during the layout swap, a layout swap interface as shown in Figure 8C can be displayed, with overlays 830 and 830 displayed on floating windows 250 and 260, respectively. Overlays 830 and 830 can display the application icons 411 and 412 corresponding to apps APP-2 and APP-3, respectively. It is understandable that the display size of the floating windows may change during the layout swap, for example, when swapping the layouts of floating windows 240 and 250 as shown in Figure 8A. Covering the floating windows with overlays allows time for the applications to redraw their new, larger interfaces. Once the applications have finished drawing, the overlays and icons can be removed to display the new interface, thus avoiding abrupt changes in the screen and improving the smoothness and display effect of the layout swap process.

[0299] Optionally, in one possible implementation, the electronic device may also display a swap button on the redesigned interface, for example, between two windows. In response to triggering the swap button, the electronic device can swap the two windows. The electronic device may also display a rotate button in the center of the screen. In response to triggering the swap button, the electronic device can swap the window layout clockwise or counterclockwise, such as displaying each window in the next window in the clockwise or counterclockwise direction.

[0300] In one possible implementation, to achieve a better display effect, while adjusting the layout of multiple windows according to the layout template, the electronic device can also automatically hide or show the taskbar based on further user operations.

[0301] In one possible implementation, during the process of adjusting the multi-window layout of the electronic device according to the layout template, when each template sub-area displays a window, the electronic device can automatically hide the taskbar to prevent the taskbar from obscuring the application interface. As shown in Figure 9A, the electronic device displays floating windows 240, 250, and 260 according to the style of layout template 330, and the electronic device automatically hides the taskbar 113 on interface 9a.

[0302] In one possible implementation, when using a layout template, if there are layout sub-regions in the currently used layout template that are not displayed, and the taskbar does not obscure the application interface, the electronic device can automatically display the taskbar.

[0303] For example, during the use of a layout template, a user can close some windows in multiple windows, thereby selecting new applications to participate in the layout. As shown in Figures 9A-9B, the electronic device receives and responds to a trigger operation on the close control 910 of the floating window 260 (e.g., a click operation on the close control 910 as shown in Figure 9A), and can close the floating window 260, as shown in Figure 9B. As shown in Figure 9B, after the electronic device closes the floating window 260, a mask 920 can be displayed at the position of the floating window 260, thereby indicating the existence of a layout of a template sub-area where a window can be displayed. Optionally, the electronic device can also display an add control 921 on the mask 920, allowing the user to easily add a new window at the position of the mask 920 by adding the add control 921. At this time, in the current layout template 330, there is a layout with a template sub-area 333 that does not display any windows, but if the taskbar is displayed at this time, it will obscure the application interface in the floating window 240. At this time, the electronic device can continue to hide the taskbar 113 in the interface 9b shown in Figure 9B.

[0304] For example, as shown in Figures 9B-9C, an electronic device receives and responds to a trigger operation on the close control 922 of the floating window 240 (e.g., a click operation on the close control 922 as shown in Figure 9B), and can close the floating window 240, as shown in Figure 9C. As shown in Figure 9C, the electronic device can display a mask 930 after closing the floating window 240. At this time, in the current layout template 330, there are layouts with template sub-regions 331 and 333 where no windows are displayed, and the taskbar will not obscure the application interface. At this time, the electronic device can automatically display the taskbar 113 in the interface 9c shown in Figure 9C, thereby facilitating the user to select an application to open a new window.

[0305] In one possible implementation, when using a layout template, if a user interacts with any currently displayed window on any interface where the taskbar is displayed, the electronic device can automatically hide the taskbar.

[0306] For example, as shown in Figures 9C-9D, on interface 9c shown in Figure 9C, the electronic device can receive a trigger operation on the floating window 250 (a click operation on the application interface displayed in the floating window 250 as shown in Figure 9). In response to the trigger operation, the electronic device can automatically hide the taskbar 113, thereby displaying interface 9d shown in Figure 9D. By automatically hiding the taskbar, a better display effect can be provided when the user operates the floating window. At the same time, it makes it easier for the user to further operate the floating window 250, such as editing the content of the application interface displayed in the floating window 250. It is understood that the trigger operation on the floating window can also be other operations, and this application does not limit them.

[0307] Understandably, during the process of an electronic device adjusting the layout of open windows according to the layout template, the placement of each window within a specific template sub-area can be randomly matched, or it can be ordered according to certain rules based on parameters such as the screen orientation of the application displayed, the operation order of the windows, the opening order of the applications, the display position of the windows, and the window ID. Other parameters may also be considered by the electronic device, and this application does not impose any restrictions on them.

[0308] Understandably, when adjusting the layout of an open window using a layout template, users may want to display the appropriate window in the template sub-area with the corresponding landscape / portrait orientation, based on the application's orientation displayed in the floating window, thus providing a better browsing and user experience.

[0309] The application's landscape / portrait attribute indicates whether the requested application supports landscape and / or portrait display. This attribute can include three types: landscape only, portrait only, and both landscape and portrait. An application supporting only landscape is called a landscape application, and an application supporting only portrait is called a portrait application. An application supporting both landscape and portrait is called a compatible application. Landscape display refers to the application using a rectangular area with a width greater than its height, while portrait display refers to the application using a rectangular area with a width less than its height. Optionally, landscape display means the application interface is in landscape mode, and portrait display means the application interface is in portrait mode. Understandably, in one possible implementation, a compatible application can also display its interface with a 1:1 aspect ratio. Landscape applications, portrait applications, and compatible applications can be referred to as application types.

[0310] Optionally, in the embodiments of this application, the landscape / portrait attribute can also be referred to as the horizontal / vertical orientation attribute. A landscape application can also be called a horizontal application, and a portrait application can also be called a vertical application.

[0311] Optionally, the landscape / portrait orientation of an application can be determined based on the application's own parameters or set by the electronic device for the application. The landscape / portrait orientation determined by the application's own parameters can be called the application's default landscape / portrait orientation. The landscape / portrait orientation set by the electronic device for the application can be called the application's configured landscape / portrait orientation. The application's configured landscape / portrait orientation can be the same as or different from the application's default landscape / portrait orientation. Optionally, the electronic device can store a list in some data structure to store the application's configured landscape / portrait orientation. In one possible implementation, the electronic device can store multiple lists, and the configured landscape / portrait orientations of the same application stored in each list can be different.

[0312] The landscape / portrait attribute of a template sub-region indicates whether it is a landscape or portrait display area. A template sub-region with a landscape display attribute can be called a landscape template sub-region. A template sub-region with a portrait display attribute can be called a portrait template sub-region. A landscape display area refers to a rectangular display area with a width greater than its height, while a portrait display area refers to a rectangular display area with a width less than its height. Optionally, a landscape template sub-region can also be called a horizontal template sub-region, and a portrait template sub-region can also be called a vertical template sub-region.

[0313] It is understood that in the Cartesian coordinate system defined in the embodiments of this application, the width refers to the length of the side of the display area parallel to the X-axis of the screen display area, and the height refers to the length of the side of the display area parallel to the Y-axis of the screen display area.

[0314] In one possible implementation, the electronic device can match the opened window with a template sub-region based on the landscape / portrait attributes of the application displayed in the window and the landscape / portrait attributes of the template sub-region. Specifically, matching the opened window with the template sub-region can refer to determining which template sub-region of the layout template each window is displayed in, or it can refer to determining which window is displayed in the layout of each template sub-region.

[0315] Optionally, in one possible implementation, when the electronic device adjusts the layout of opened windows according to the layout template, it can prioritize matching template sub-regions and windows that are compatible with landscape and portrait orientations, and then match template sub-regions and windows that are not compatible with landscape and portrait orientations. Specifically, windows displaying landscape applications are adapted to landscape template sub-regions, and windows displaying portrait applications are adapted to portrait template sub-regions. Windows displaying compatible applications can be adapted to either landscape or portrait template sub-regions.

[0316] In one possible implementation, when an electronic device adjusts the layout of already opened windows according to the style of a layout template, it can match the windows of landscape applications with the landscape template sub-area and the windows of portrait applications with the portrait template sub-area.

[0317] For example, as shown in Figure 10A, three open floating windows are displayed in the screen display area 110 of the electronic device. Floating window 1010 displays the application interface of application 1013, floating window 1011 displays the application interface of application 1014, and floating window 1012 displays the application interface of application 1015. Applications 1013 and 1014 are landscape applications, and application 1015 is a portrait application. For example, application 1013 can be a game application that supports landscape display, application 1014 can be a video application that supports landscape display (e.g., a long video application), and application 1015 can be a video application that supports portrait display (e.g., a short video application). Optionally, the electronic device can display floating windows 1010, 1011, and 1012 sequentially in the screen display area 110 according to the order in which the applications are opened. Floating window 1012, which is opened last, can be displayed on top. Optionally, the three applications can be opened in any order, and this application does not impose any restrictions on this.

[0318] On interface 10a as shown in FIG10A, the electronic device can receive a trigger operation on the quick layout control 232 (e.g., a click operation on the quick layout control 232 as shown in FIG10A). In response to the trigger operation, the electronic device can display the template selection interface 310 on interface 10b as shown in FIG10B.

[0319] On interface 10b as shown in Figure 10B, the electronic device can receive a trigger operation on layout template 1020 (e.g., a click operation on layout template 1020 as shown in Figure 10B). Layout template 1020 has three template sub-regions: landscape template sub-region 1021, landscape template sub-region 1022, and portrait template sub-region 1023. In response to the trigger operation on layout template 1020, the electronic device can adjust the layout of the three floating windows shown in Figure 10A according to the style of layout template 1020, and after the adjustment is completed, display interface 10c as shown in Figure 10C.

[0320] As shown in Figure 10C, the layout of the three floating windows in the screen display area 110 is the same as that of the layout template 1020. Specifically, the layout of floating window 1012, which displays the portrait application 1015, is the layout of the portrait template sub-area 1023. The layout of floating window 1010, which displays the landscape application 1013, is the layout of the landscape template sub-area 1021. The layout of floating window 1011, which displays the landscape application 1014, is the layout of the landscape template sub-area 1022.

[0321] Optionally, in one possible implementation, when multiple sets of windows and template sub-regions with the same landscape / portrait attributes exist, this application embodiment does not limit the matching relationship between windows and template sub-regions with the same landscape / portrait attributes. Here, having the same landscape / portrait attributes for windows and template sub-regions means that both the application displayed in the window and the template sub-region are in landscape mode, or both are in portrait mode. For example, in the interface 10c shown in Figure 10C, the layout of the floating window 1010 can also be the layout of the landscape template sub-region 1022, while the layout of the floating window 1011 is the layout of the landscape template sub-region 1021.

[0322] Understandably, in one possible implementation, the electronic device can first match template sub-regions and windows with the same landscape and portrait screen attributes, and then match template sub-regions and windows with different but compatible landscape and portrait screen attributes.

[0323] For example, an electronic device can receive and respond to a trigger operation on an application icon to open a landscape application, a portrait application, and a compatible application. As shown in Figure 10D, the electronic device can display floating windows 1010, 1012, and 1040 sequentially in the screen display area 110 according to the order in which the applications are opened. Floating window 1040 can display the application interface of application 1041. Application 1041 is a compatible application, for example, a note-taking application. Optionally, the order in which the three applications are opened can be arbitrary, and this application does not impose any restrictions on this.

[0324] On interface 10d as shown in Figure 10D, the electronic device can receive a trigger operation on the quick layout control 232 (e.g., a click operation on the quick layout control 232 as shown in Figure 10D). In response to the trigger operation, the electronic device can display the template selection interface 310. The electronic device can also receive a trigger operation on the layout template 1020 (e.g., a click operation on the layout template 1020 as shown in Figure 10D). In response to the trigger operation, the electronic device can adjust the layout of the three floating windows shown in Figure 10D according to the style of the layout template 1020, and display interface 10e as shown in Figure 10E after the adjustment is completed.

[0325] As shown in Figure 10E, the layout of the three floating windows in the screen display area 110 is the same as that of the layout template 1020. Specifically, the layout of the floating window 1012 displaying the portrait application 1015 is the layout of the portrait template sub-area 1023. The layout of the floating window 1010 displaying the landscape application 1013 is the layout of the landscape template sub-area 1021. The layout of the floating window 1040 displaying the compatible application 1041 is the layout of the landscape template sub-area 1022.

[0326] As shown in Figure 10E, when an electronic device adjusts the layout of opened windows using a layout template, it prioritizes matching template sub-regions and windows with the same landscape and portrait orientation attributes. Therefore, since there is a window 1012 with the same landscape and portrait orientation attributes as the portrait template sub-region 1023, the floating window 1040 displaying the compatible application 1041 will not be displayed in the layout of the portrait template sub-region 1023, regardless of the opening order of the three applications. When there are no template sub-regions and windows with the same landscape and portrait orientation attributes, the electronic device can match template sub-regions and windows with different but compatible landscape and portrait orientation attributes. Therefore, since there are two landscape template sub-regions but only one landscape application, the electronic device can match the compatible application with the landscape template sub-region. Optionally, this embodiment does not limit the matching relationship between landscape applications and compatible applications and multiple landscape template sub-regions. For example, in the interface 10e shown in Figure 10E, the layout of the floating window 1010 can also be the layout of the landscape template sub-area 1022, while the layout of the floating window 1040 is the layout of the landscape template sub-area 1021.

[0327] In one possible implementation, the electronic device can first match template sub-regions and windows with the same landscape and portrait attributes, then match template sub-regions and windows with different but compatible landscape and portrait attributes, and finally match sub-regions and windows with incompatible landscape and portrait attributes.

[0328] For example, in interface 10b as shown in Figure 10B, if the electronic device receives a trigger operation on layout template 335 (e.g., a click operation on layout template 335 as shown in Figure 10B), in response to the trigger operation, the electronic device can adjust the layout of the three floating windows shown in Figure 10B according to the style of layout template 335. Layout template 335 has two vertical template sub-areas, namely template sub-area 336 and template sub-area 337. After the layout adjustment is completed, the electronic device can display the interface shown in Figure 10F.

[0329] Since the number of template sub-regions is less than the number of currently open windows, the electronic device can match some of the currently open windows with some template sub-regions and shrink other windows with undetermined layouts to display in the template sub-regions of other unmatched windows. For example, as shown in Figure 10F, the electronic device can match only one floating window with one template sub-region. Since both template sub-regions are portrait-oriented, the electronic device can prioritize matching template sub-regions and windows with the same portrait / landscape attributes, displaying the floating window 1012 of the portrait application 1015 in the layout of any one of the portrait template sub-regions. Meanwhile, the remaining floating windows 1010 and 1011 of the landscape application are windows with undetermined layouts and can be shrunk to display in the layout of the other portrait template sub-region.

[0330] If no window has the same landscape / portrait attributes as the template sub-region, the electronic device can match template sub-regions and windows with different but compatible landscape / portrait attributes. For example, if the application displayed by the floating window 1012 shown in Figure 10B is a compatible application (e.g., application 1041 shown in Figure 10D), the electronic device adjusts the layout of the three floating windows shown in Figure 10B according to the style of layout template 335, resulting in the interface shown in Figure 10G. Specifically, the electronic device prioritizes matching the floating window 1012 displaying the compatible application with one of the portrait template sub-regions, and shrinks the floating windows 1010 and 1011 displaying the landscape application within the layout of another portrait template sub-region.

[0331] If no window matches the landscape / portrait orientation of the template sub-area, the electronic device can match template sub-areas and windows that do not match the landscape / portrait orientation. For example, the electronic device can receive and respond to a trigger operation on an application icon to open three landscape applications. As shown in Figure 10H, the electronic device can display floating windows 1010, 1012, and 1080 sequentially in the screen display area 110 according to the application opening order. Floating window 1080 can display the application interface of application 1081. Application 1081 is a landscape application, for example, an online course application. Optionally, the opening order of the three applications can be arbitrary, and this application does not impose any restrictions on this.

[0332] On interface 10h as shown in Figure 10H, the electronic device can receive a trigger operation on the quick layout control 232 (e.g., a click operation on the quick layout control 232 as shown in Figure 10H). In response to the trigger operation, the electronic device can display the template selection interface 310. The electronic device can receive a trigger operation on the layout template 310 (e.g., a click operation on the layout template 310 as shown in Figure 10H). In response to the trigger operation, the electronic device can adjust the layout of the three floating windows shown in Figure 10H according to the style of the layout template 310, and display interface 10i as shown in Figure 10I after the adjustment is completed.

[0333] As shown in Figure 10I, since there are currently no template sub-regions and windows with compatible landscape and portrait orientations, the electronic device can match any floating window displaying a landscape application (e.g., floating window 1080) with any portrait template sub-region, and shrink the remaining floating windows to display them in the layout of another portrait template sub-region. Optionally, windows whose landscape and portrait orientations are not compatible with the template sub-region can be scaled proportionally to the maximum size that the template sub-region layout can accommodate within its layout. For example, as shown in Figure 10I, floating window 1080 is scaled to the maximum size that template sub-region 336 can accommodate within its layout. At this time, the left and right edges of floating window 1080 can coincide with the left and right edges of template sub-region 336. It can be understood that when a floating window displaying a portrait application matches a landscape template sub-region, the floating window displaying the portrait application can be scaled in the landscape template sub-region layout until its top and bottom edges coincide with the top and bottom edges of the template sub-region layout.

[0334] Optionally, a prompt may be displayed when the electronic device matches a template sub-area and window whose landscape / portrait attributes are not compatible. For example, the prompt may be prompt 1090 as shown in Figure 10I, wherein the prompt may be a text prompt, such as "Because application 1081 is not adapted to multi-window mode, the window is displayed with a proportional effect."

[0335] Understandably, when electronic devices match template sub-areas and windows with incompatible landscape / portrait orientations, the display quality will be poor. One possible implementation is to prompt the user to change the template when a window with incompatible landscape / portrait orientations is displayed in the currently shown template sub-area, or to automatically change the template for the user.

[0336] For example, in one possible implementation, when both template sub-regions of layout template 335 display windows for landscape applications, such as floating windows 1081 and 1011 respectively, the user can rotate the electronic device to change from displaying a landscape interface to displaying a portrait interface. At this time, the electronic device can automatically use the layout template with two landscape template sub-regions in the template selection interface 321 shown in Figure 3F, and display floating windows 1081 and 1011 in the two landscape template sub-regions. Meanwhile, floating windows 1081 and 1011 still display the landscape interface shown in Figure 10I.

[0337] Understandably, users may be dissatisfied with the automatically changing layout of an electronic device. Therefore, after changing the layout, the electronic device can display a back icon. Upon receiving a trigger action on the back icon, the electronic device can redisplay the interface before the automatic layout change. In another possible implementation, the electronic device can also redisplay the interface before the automatic layout change when it receives an action of rotating the electronic device.

[0338] For example, the flowchart shown in Figure 11A is a possible implementation of matching windows and template sub-regions based on the landscape and portrait screen attributes of windows and template sub-regions provided in the embodiments of this application.

[0339] As shown in Figure 11A, the process of matching windows and template sub-regions of electronic devices according to screen orientation can include the following steps:

[0340] S1101: Sequentially determine the windows that match each template sub-region in the layout template.

[0341] The electronic device can sequentially determine which window in each template sub-region of the layout template is currently open and which window is displayed.

[0342] Here, "in sequence" refers to following a certain order. For example, in one possible implementation, the electronic device can determine the windows matching each template sub-region in each layout template in a left-to-right, top-to-bottom order. "Determining in a left-to-right, top-to-bottom order" means that the left-to-right order is preferred, but when at least two template sub-regions have the same left-to-right order, the top-to-bottom order is used.

[0343] For example, taking the layout templates in template selection interface 320 and template selection interface 321 as examples, the order from left to right and from top to bottom can be the order of the serial numbers from smallest to largest as shown in Figure 11B(a).

[0344] Optionally, the electronic device can also determine the windows matching each template sub-region in each layout template in a top-to-bottom and left-to-right order. The top-to-bottom and left-to-right order means that the top-to-bottom order is preferred, but if at least two template sub-regions have the same top-to-bottom order, then the left-to-right order is used.

[0345] Optionally, the electronic device can also determine the matching windows of each template sub-area in each layout template in different orders in different template selection interfaces. For example, for template selection interface 320 suitable for displaying a landscape interface on the electronic device, the electronic device can use a left-to-right, top-to-bottom order, as shown in FIG11B(a), in the template selection interface 320, in ascending order of the serial numbers. At the same time, for template selection interface 321 suitable for displaying a portrait interface on the electronic device, the electronic device can use a top-to-bottom, left-to-right order, as shown in FIG11B(b), in ascending order of the serial numbers.

[0346] Alternatively, in another possible implementation, the electronic device may also determine the windows that match the respective template sub-regions in each layout template in a clockwise order.

[0347] For example, taking the layout templates in template selection interface 320 and template selection interface 321 as examples, the clockwise order is shown in Figure 11C in ascending order of the serial numbers.

[0348] This application embodiment does not limit the order in which the electronic device determines the windows matching each template sub-region in the layout template. For example, it can also determine the windows in the reverse order shown in Figures 11B(a)-11C. It is understood that random determination is also a possible order. To facilitate understanding of this solution, unless otherwise stated, this application embodiment uses the order shown in Figure 11B(a) as an example to describe the process of the electronic device adjusting the window layout according to the layout template.

[0349] S1102: When determining the windows that match each template sub-region, the following priority is applied: first, windows with the same landscape and portrait orientation are matched; then, windows with different landscape and portrait orientations but are compatible are matched; finally, windows with incompatible landscape and portrait orientations are matched.

[0350] When determining the windows to match for each template sub-region, the following priority is followed: first, match windows with the same landscape and portrait orientation; then, match windows with different but compatible landscape and portrait orientations; and finally, match windows with incompatible landscape and portrait orientations.

[0351] Specifically, when determining the matching window for each template sub-region, first, windows whose application's landscape / portrait attributes match those of the template sub-region are matched with that template sub-region. If no window exists whose application's landscape / portrait attributes match those of the template sub-region, then windows of applications whose landscape / portrait attributes differ from those of the template sub-region but are compatible are displayed and matched with that template sub-region. If no window exists whose application's landscape / portrait attributes match those of the template sub-region, then windows of applications whose landscape / portrait attributes do not match those of the template sub-region are displayed and matched with that template sub-region.

[0352] For example, Figures 12A-12B show a user interface diagram of an electronic device adjusting the window layout according to the style of layout template 334 provided in an embodiment of this application. In one possible implementation, the electronic device can implement the adjustment process shown in Figures 12A-12B according to the flow shown in Figure 11A.

[0353] As shown in Figure 12A, the electronic device currently has three floating windows open, displaying landscape application 1013, portrait application 1015, and compatible application 1041, respectively. On interface 12a as shown in Figure 12A, the electronic device receives and responds to a trigger operation (such as a click) on the quick layout control 232, displaying the template selection interface 310. The electronic device receives and responds to a trigger operation (such as a click) on the layout template 334, allowing it to adjust the layout of the three floating windows shown in Figure 12A according to the style of the layout template 334.

[0354] For example, the layout adjustment result is shown in Figure 12B. The electronic device sequentially determines the windows that match template sub-regions 1210, 1211, and 1212 in the layout template 334. When determining the window that matches the portrait template sub-region 1210, the currently open window contains a floating window 1012 displaying the portrait application 1015. The portrait / landscape attributes of the floating window 1012 are the same as those of the template sub-region 1210, so the electronic device matches the floating window 1012 with the template sub-region 1210. When determining the window that matches the portrait template sub-region 1211, the floating window 1012 has already matched the template sub-region, and there are no other windows displaying portrait applications in the currently open window. At the same time, the currently open floating window 1040 displays a compatible application, so the portrait / landscape attributes of the floating window 1040 are different from those of the template sub-region 1211 but are compatible. Therefore, the electronic device matches the floating window 1040 with the template sub-region 1211. When determining the window that matches the portrait template sub-region 1212, floating windows 1012 and 1040 have already matched the template sub-region, and there are no other windows displaying portrait or compatible applications in the currently open window. The electronic device will match the floating window 1010, whose portrait / landscape attributes do not match the template sub-region 1212, with the template sub-region 1212.

[0355] For example, the flowchart shown in Figure 13 is another possible implementation of matching windows and template sub-regions according to the screen orientation attributes provided in this application embodiment.

[0356] As shown in Figure 13, the process of matching windows and template sub-regions based on screen orientation of electronic devices may include the following steps:

[0357] S1301: Matches windows with landscape and portrait orientations to template sub-regions.

[0358] Electronic devices can match windows with compatible landscape and portrait orientations to template sub-regions. Optionally, when matching windows with compatible landscape and portrait orientations to template sub-regions, electronic devices can prioritize matching windows with the same landscape and portrait orientations to the template sub-regions, and then match windows with different but compatible landscape and portrait orientations to the template sub-regions.

[0359] For example, in one possible implementation, the electronic device can follow the flow shown in Figure 13A to implement the adjustment process shown in Figures 12A-12B. Specifically, when the electronic device adjusts the layout of the three floating windows shown in Figure 12A according to the style of layout template 334, since there are multiple portrait template sub-regions in layout template 334, and there is a window displaying a portrait application (floating window 1012) in the currently opened window, the electronic device can prioritize matching floating window 1012 with any one of the portrait template sub-regions (such as template sub-region 1210). At this time, since there are other unmatched portrait template sub-regions in layout template 334, and there is a window displaying a compatible application (floating window 1040) in the currently unmatched window, the electronic device can prioritize matching floating window 1040 with any one of the unmatched portrait template sub-regions (such as template sub-region 1211).

[0360] At this point, there is one remaining portrait template sub-area in layout template 334, but there are no windows in the currently unmatched windows whose landscape and portrait attributes are compatible with the portrait template sub-area, so the electronic device will no longer perform matching.

[0361] Optionally, electronic devices may not distinguish between different priorities for having the same landscape and portrait orientation attributes and having different landscape and portrait orientation attributes but being compatible. As long as the landscape and portrait orientation attributes of the window are compatible with the template sub-region, the corresponding window will be matched with the template sub-region.

[0362] S1302: If there are still unmatched template sub-regions and windows, match the windows whose landscape and portrait orientations do not match with the template sub-regions.

[0363] After the electronic device completes step S1301, if there are still unmatched template sub-regions and windows, then the windows whose landscape and portrait screen attributes do not match will be matched with the template sub-regions.

[0364] For example, when the electronic device follows the flow shown in Figure 13A to implement the adjustment process shown in Figures 12A-12B, after completing step S1301, there is still an unmatched window in the portrait template sub-region of the layout template 334. At the same time, there is also an unmatched template sub-region in the currently open window that displays a landscape application. The electronic device continues to execute step S1302 to match the floating window 1010 of the landscape application with the portrait template sub-region 1212.

[0365] It is understood that in the embodiments of this application, when the electronic device adjusts the layout of the opened windows according to the layout template, the method of matching the window and the template sub-region according to the horizontal and vertical screen attributes of the window and the template sub-region can be applied in the following three cases: the number of template sub-regions in the layout template is equal to the number of opened windows, the number of template sub-regions in the layout template is less than the number of opened windows, and the number of template sub-regions in the layout template is greater than the number of opened windows.

[0366] The number of template sub-regions in the layout template can be represented by M, and the number of opened windows can be represented by N, where M and N are both positive integers. When M = N, the electronic device can match N windows with M template sub-regions according to the method provided in the embodiments of this application for matching windows with template sub-regions based on the screen orientation of windows and template sub-regions.

[0367] When M < N, the electronic device can match K (K < M) windows out of N windows with K template sub-regions according to the method provided in the embodiments of this application for matching windows with template sub-regions based on the screen orientation of windows and template sub-regions. Optionally, the remaining (NK) windows can be displayed in the layout of (MK) template sub-regions.

[0368] When M > N, the electronic device can match N windows with N template sub-regions out of M template sub-regions using the method provided in this application for matching windows with template sub-regions based on the screen orientation of windows and template sub-regions. Optionally, the layout of the remaining (MN) template sub-regions may not display windows.

[0369] For example, Figures 14A-14B illustrate a user interface diagram of an electronic device adjusting the window layout according to a layout template style, provided in an embodiment of this application. The number M of template sub-regions in the layout template is greater than the number N of open windows. The electronic device can match N windows with N template sub-regions out of M template sub-regions using the method provided in this application for matching windows with template sub-regions based on their landscape and portrait orientation attributes. In one possible implementation, the electronic device can follow the flow shown in Figure 13 to implement the adjustment process shown in Figures 14A-14B.

[0370] As shown in Figure 14A, two open floating windows are displayed in the screen display area 110. On the interface 14a shown in Figure 14A, the electronic device receives and responds to a trigger operation (such as a click operation) on the shortcut layout control 232, and displays the template selection interface 310. The electronic device receives a trigger operation on the layout template 1020 (a click operation on the layout template 1020 shown in Figure 14A), and in response to the trigger operation, the layout of the two floating windows shown in Figure 14A can be adjusted according to the style of the layout template 1020.

[0371] Specifically, when the electronic device adjusts the layout of the two floating windows shown in Figure 12A according to the style of layout template 1020, since there are currently two sets of windows and template sub-regions that are compatible with both landscape and portrait orientations, the electronic device can first match these two sets of windows and template sub-regions accordingly. Specifically, the opened windows include a floating window 1010 displaying landscape application 1013, and layout template 1020 includes landscape template sub-regions 1021 and 1022. The electronic device can match floating window 1010 with any one of the landscape template sub-regions. At the same time, the opened windows also include a floating window 1012 displaying portrait application 1015, and layout template 1020 includes a portrait template sub-region 1023. The electronic device can match floating window 1012 with portrait template sub-region 1023. In this embodiment, there is no restriction on which set of windows and template sub-regions is matched first.

[0372] Understandably, in one possible implementation, on interface 14a as shown in Figure 14A, the electronic device receives and responds to a trigger operation on layout template 1020 (a click operation on layout template 1020 as shown in Figure 14A). The electronic device can also adjust the layout of the two floating windows shown in Figure 14A according to the style of layout template 1020, based on the process shown in Figure 11A.

[0373] When the electronic device determines the matching window for each template sub-region in the layout template 1020 according to the process shown in Figure 11A and the order shown in Figure 11B(a), the matching result can be as shown in Figure 14C.

[0374] Specifically, the electronic device first matches windows for the landscape template sub-region 1021. At this time, none of the open windows are matched, and there is a floating window 1010 displaying the landscape application 1013. The electronic device prioritizes matching the floating window 1010 with the template sub-region 1021. Next, the electronic device matches windows for the landscape template sub-region 1022. At this time, among the open and unmatched windows, there is no window that matches the landscape / portrait attributes of the landscape template sub-region, so the electronic device matches the floating window 1012 of the portrait application 1015 with the template sub-region 1022.

[0375] Understandably, in some scenarios (as shown in Figures 14A-14C), the process shown in Figure 13 can achieve better display results compared to the process shown in Figure 11.

[0376] Understandably, displaying a window of the same application within a template sub-region layout that is compatible with the application's portrait and landscape orientations provides a better viewing experience than displaying it within a template sub-region layout that is incompatible. Specifically, within the same template sub-region layout, windows whose orientations are compatible with the sub-region can be displayed at a larger size, making better use of the display space within the template sub-region layout. Furthermore, displaying windows within template sub-regions that are compatible with the portrait and landscape orientations aligns more closely with user habits.

[0377] When electronic devices adjust the window layout according to a layout template, they match open windows with template sub-regions based on the landscape / portrait attributes of the application displayed in the window and the landscape / portrait attributes of the template sub-regions, achieving a better layout effect. By prioritizing the matching of windows and template sub-regions with compatible landscape / portrait attributes, electronic devices can display as many windows as possible in template sub-regions with the same or different but compatible landscape / portrait attributes, thus maximizing the display effect after adjusting the window layout.

[0378] Understandably, users can select a layout template before opening multiple windows (as shown in Figures 7A-7E). After the electronic device determines the layout template, when displaying each opened window sequentially, the electronic device can randomly display the window in any template sub-area within the layout template; alternatively, it can display the windows sequentially in a certain order (e.g., as shown in Figures B(a)-11C). For example, as shown in Figures 7D-7E, the electronic device can display the first opened window in template sub-area 730, the second opened window in template sub-area 731, and the third opened window in template sub-area 732 in a left-to-right, top-to-bottom order. Optionally, when displaying each window in the determined layout template, the electronic device can also match the window with the landscape / portrait rules of the template sub-area. For example, in Figure 7D, if application APP-1 is a landscape application, the electronic device can first display the floating window 740 of the application interface of application APP-1 in template sub-area 731 or template sub-area 732. In this design, the electronic device can display windows sequentially in a certain order (e.g., as shown in Figures B(a)-11C) within the template sub-areas of the layout template, while considering both portrait and landscape orientations. For example, if application APP-1 is a landscape application, the electronic device can first display the floating window 740 of the application interface of application APP-1 in the first template sub-area 731 in a left-to-right, top-to-bottom order.

[0379] Understandably, when an electronic device matches windows and template sub-regions based on their orientation (portrait or landscape) attributes, there may be at least two sets of windows and template sub-regions with identical or compatible orientation attributes. In this case, the electronic device can randomly match between these at least two sets of windows and template sub-regions. Optionally, in one possible implementation, the electronic device can also match between these at least two sets of windows and template sub-regions based on the window's operation order. Specifically, when at least two windows have the same operation order, the electronic device can match between these at least two sets of windows and template sub-regions according to the opening order of the applications displayed in these at least two windows. Here, the opening order refers to the order in which the application's windows are displayed; the operation order refers to the order in which the windows receive operations after being opened. When at least two windows have not received any operations, the operation order of these at least two windows is the same.

[0380] Optionally, the electronic device can determine the operation order of windows based on the time when an operation is received after the window is opened. Since the electronic device can set a minimum time unit (e.g., seconds) for recording the time when an operation is received, this unit may not be accurate to the precise moment the operation is received. Therefore, when the electronic device determines the operation order of windows based on the time when an operation is received after the window is opened, there may be situations where at least two windows receive operations at the same time. In this case, at least two windows receive operations simultaneously. When at least two windows receive operations simultaneously, the operation order of at least two windows is the same.

[0381] Figures 15A-15D illustrate a user interface diagram of an electronic device according to an embodiment of this application, which combines the horizontal and vertical screen attributes of windows and template sub-regions, as well as the operation order of windows and the opening order of applications displayed in the windows, and adjusts the window layout according to the style of the layout template.

[0382] As shown in Figure 15A, the electronic device can sequentially receive trigger operations (e.g., click operations on the application icons of applications 1013, 1014, 1041, 1511, and 1015). Responding sequentially to these five trigger operations, the electronic device can sequentially display floating windows 1010, 1011, 1040, 1510, and 1012 in the screen display area 110. Application 1510 is a compatible application, such as an instant messaging application. As shown in Figure 15A, the floating window of the later-opened application can be displayed above the floating window of the earlier-opened application. The opening order of the five applications shown in Figure 15A can be sorted from most recently opened to earliest opened, specifically: Application 1015 -> Application 1511 -> Application 1041 -> Application 1014 -> Application 1013.

[0383] Users can interact with the opened window. For example, in interface 15a as shown in FIG15A, the electronic device receives a trigger operation on the application interface of application 1041. In response to the trigger operation, the electronic device can display the floating window 1040 of application 1041 on the top layer, as shown in FIG15B. In one possible implementation, the trigger operation can be two clicks on note item 1512 in the application interface of application 1041, as shown in FIG15A. When the electronic device responds to the first click on note item 1512 in the application interface of application 1041, it displays the floating window 1040 of the application interface of application 1041 on the top layer. Then, in response to the second click on note item 1512 in the application interface of application 1041, the electronic device can display the details interface 1520 of note item 1512 in the floating window 1040. At this point, the operation order of the five floating windows shown in Figure 15A can be sorted from the most recent operation to the earliest operation, specifically: floating window 1040 -> (floating window 1010 = floating window 1011 = floating window 1510 = floating window 1012).

[0384] In interface 15b shown in Figure 15B, the electronic device receives a trigger operation on the shortcut layout control 232 (e.g., a click operation on the shortcut layout control 232 as shown in Figure 15B). In response to the trigger operation, the electronic device can display the template selection interface 320 shown in Figure 15C. In interface 15c shown in Figure 15C, the electronic device receives a trigger operation on the layout template 350 (e.g., a click operation on the layout template 350 as shown in Figure 15C). In response to the trigger operation, the electronic device can adjust the layout of the five currently open windows according to the style of the layout template 350.

[0385] For example, in one possible implementation, the electronic device, by combining the landscape and portrait screen attributes of the window and template sub-regions, as well as the operation order of the window and the opening order of the applications displayed in the window, adjusts the window layout as shown in Figure 15C according to the style of the layout template 350, and can then display the layout adjustment result shown in Figure 15D.

[0386] Since the number of template sub-regions in the layout template 350 is less than the number of open windows, the electronic device can display some of the open windows in the layout of some template sub-regions, and shrink and display the other windows whose layout is not yet determined in another template sub-region. For example, as shown in Figure 15D, the electronic device can display 3 out of 5 open windows in the layout of 3 template sub-regions, and shrink and display the remaining 2 windows in the layout of another template sub-region with no matching windows.

[0387] In the process of matching the three windows with the three template sub-regions, the electronic device can determine the windows to be matched to each template sub-region in the order from left to right and from top to bottom, as shown in Figure 11B(a). At the same time, when matching windows for each template sub-region, the electronic device can give priority to matching the landscape and portrait attributes of the windows and template sub-regions.

[0388] Specifically, the electronic device first matches windows for the landscape template sub-area 351. At this time, none of the open windows are matched, and there are floating windows 1010 displaying landscape application 1013 and 1011 displaying landscape application 1014. Since there are two windows with the same landscape / portrait attributes as template sub-area 351, the electronic device can further match the most recently operated window according to the window's operation order. As shown in Figures 15A-15C, neither floating window 1010 nor floating window 1011 has received any operation after being opened, and their operation order is the same. At this time, the electronic device can prioritize matching the floating window 1011 of the most recently opened application 1014 with template sub-area 351 according to the opening order of the displayed applications.

[0389] Secondly, the electronic device can match windows for the landscape template sub-region 353. At this time, among the open and unmatched windows, there is only one floating window 1010 displaying the landscape application 1013, and the floating window 1010 has the same landscape and portrait attributes as the template sub-region 353. The electronic device can prioritize matching the floating window 1010 with the template sub-region 353.

[0390] Next, the electronic device can match windows for the landscape template sub-region 352. At this time, among the open and unmatched windows, there are no windows with the same landscape / portrait attributes as the template sub-region 352. The electronic device can prioritize matching windows with different but compatible landscape / portrait attributes. Specifically, floating windows 1040 for display compatible application 1041 and 1510 for display compatible application 1511 are not matched. Since there are two windows with different but compatible landscape / portrait attributes, the electronic device can further prioritize matching the most recently operated window according to the window's operation order. At this time, the electronic device can prioritize matching the most recently operated floating window 1040 with the template sub-region 352.

[0391] Finally, after the electronic device matches the three windows with the three template sub-regions, it can display two additional windows (floating window 1510 and floating window 1012) in the finally determined template sub-region 354.

[0392] As shown in Figure 15D, when the electronic device adjusts the window layout according to the layout template, considering two factors, the priority of the landscape / portrait attributes of the window and template sub-regions is higher than the priority of the window's operation order. Specifically, the application 1041 displayed in the floating window 1040 is the most recently used application. However, since application 1041 is a compatible application, when the electronic device matches the first landscape template sub-region 351, it still prioritizes matching and displaying the floating window of the landscape application. This achieves a better display effect.

[0393] Understandably, when at least two windows have the same orientation (portrait or landscape), the electronic device can prioritize matching the window that was operated on earliest, based on the order of window operation. Similarly, when at least two windows have not received any operation, the electronic device can prioritize matching the window of the earliest opened application, based on the order in which the applications displayed in the window were opened. In another possible implementation, when at least two windows have the same orientation, the electronic device can disregard the window operation order and instead prioritize matching the most recently / earliest opened window based on the order in which the applications displayed in the window were opened.

[0394] Understandably, in one possible implementation, the electronic device may only consider the window operation order as a factor when adjusting the window layout. For example, the electronic device may display the windows sequentially in the template sub-area of ​​the layout template according to their operation order. When at least two windows have the same operation order, the electronic device may display the windows sequentially in the template sub-area of ​​the layout template according to the opening order of the applications displayed in those at least two windows. The window operation order can be from most recent operation to earliest operation, or from earliest operation to most recent operation. The application opening order can be from most recently opened to earliest opened, or from earliest opened to most recently opened. Displaying the windows sequentially in the template sub-area of ​​the layout template can be done by displaying the windows in descending or ascending order of their serial numbers as shown in Figures 11B(a)-11C. This application does not limit the specific order.

[0395] Understandably, in one possible implementation, the electronic device could also determine the opening order of applications based on the time when the application windows are displayed. However, since the electronic device can set a minimum time unit (e.g., seconds) for recording the window display time, this unit may not be accurate enough to pinpoint the exact moment the window receives an operation. Therefore, when the electronic device determines the opening order based on the window display time, it is possible that at least two applications with displayed windows will be opened at the same time.

[0396] Therefore, when an electronic device determines the opening order of applications based on the time when the application window is displayed, and determines the operation order of windows based on the time when the operation is received after the window is opened, there may be at least two windows with the same operation order and the same opening order of the displayed applications.

[0397] When an electronic device is matching a window with a template sub-region, there may be at least two windows with the same landscape / portrait orientation and operation order, and the applications displayed in these at least two windows may also be opened in the same order. In this case, the electronic device can further match the window with the template sub-region according to the window's X-value. Here, the window's X-value refers to the X-coordinate of the leftmost point of the window.

[0398] Figures 16A-16D illustrate a user interface diagram of an electronic device according to an embodiment of this application, in which the window matches a template sub-region based on the window's X value.

[0399] As shown in Figure 16A, the screen display area 110 can display split-screen application icons 1610. A split-screen application refers to an application group consisting of multiple applications. When the electronic device receives a trigger operation applied to a split-screen application icon, it is equivalent to the electronic device simultaneously receiving trigger operations applied to the application icons of multiple applications within the split-screen application. At this time, the electronic device may display multiple windows simultaneously, and display the application interfaces of multiple applications within the split-screen application in each of these multiple windows.

[0400] As shown in Figure 16A, the electronic device can receive a click operation on the split-screen application icon 1610. For example, in one possible implementation, in response to this click operation, the electronic device can simultaneously open two windows and display two applications within the split-screen application in each window, as shown in Figure 16B. As shown in Figure 16B, the electronic device simultaneously opens and displays applications 1041 and 1511 in floating windows 1040 and 1510 respectively.

[0401] On interface 16b as shown in Figure 16B, the electronic device receives a trigger operation on the shortcut layout control 232 (e.g., a click operation on the shortcut layout control 232 as shown in Figure 16B). In response to the trigger operation, the electronic device can display the template selection interface 310 as shown in Figure 16C. On interface 16c as shown in Figure 16C, the electronic device receives a trigger operation on the layout template 335 (e.g., a click operation on the layout template 335 as shown in Figure 16C). In response to the trigger operation, the electronic device can adjust the layout of the two currently open windows according to the style of the layout template 335.

[0402] For example, in one possible implementation, the electronic device can sequentially determine the windows matching each template sub-region in a left-to-right, top-to-bottom order as shown in Figure 11B(a). When determining the windows matching each template sub-region, the electronic device can consider factors such as the window's and template sub-region's landscape / portrait attributes, the window's operation order, and the window's X value. After adjustment, the layout adjustment result shown in Figure 16D can be displayed.

[0403] Specifically, the electronic device first matches the window in the portrait mode template sub-area 336. At this point, neither of the two open windows matches; the landscape / portrait attributes of the applications displayed in the two floating windows are different from, but compatible with, the landscape / portrait attributes of the portrait mode template sub-area 336. Simultaneously, neither floating window receives any operation, and the applications displayed in the two floating windows were opened in the same order. Based on the window's landscape / portrait attributes, the operation order, and the opening time of the applications displayed in the windows, the electronic device cannot determine which window matches the template sub-area 336 first.

[0404] At this point, matching can be performed based on the window's X value. For example, an electronic device can prioritize matching the floating window 1040 with the template sub-region 336, which has a smaller X value.

[0405] Next, the electronic device matches the remaining floating window 1510 with the second vertical screen template sub-area 337.

[0406] Understandably, by determining the windows that match each template sub-area in order from left to right and from top to bottom, and prioritizing the matching of windows with smaller X values ​​when the window's landscape / portrait attributes, operation order, and application opening order are all the same, windows that are relatively displayed on the left can be adjusted to be displayed in the layout of the template sub-area that is relatively displayed on the left. This better conforms to the user's usage habits and provides a better visual experience for layout adjustment.

[0407] Alternatively, in another possible implementation, the electronic device may also prioritize matching windows with larger X values.

[0408] Understandably, in one possible implementation, when an electronic device is matching windows and template sub-regions, there may be at least two windows with identical landscape / portrait attributes, operation order, and X-values, and the applications displayed in these at least two windows may also be opened in the same order. In this case, the electronic device can further match windows with template sub-regions according to their ID values.

[0409] As shown in Figure 17A, when the electronic device displays a portrait-oriented interface, a split-screen application icon 1610 can be displayed on the screen display area 110. The electronic device can receive a trigger operation applied to the split-screen application icon 1610 (as shown in Figure 17A, a click operation on the split-screen application icon 1610). In response to the trigger operation, the electronic device can open two applications in the split-screen application pair, as shown in Figure 17B. For example, as shown in Figure 17B, the electronic device opens and displays applications 1041 and 1511 respectively in floating windows 1040 and 1510.

[0410] As shown in Figure 17B, the electronic device receives and responds to a trigger operation on the quick layout control 232 (e.g., a click operation on the quick layout control 232 as shown in Figure 17B), and can display the template selection interface 311. The electronic device receives a trigger operation on the layout template 1701 (e.g., a click operation on the layout template 1701 as shown in Figure 17B), and in response to the trigger operation, the electronic device can adjust the layout of the two currently open windows according to the style of the layout template 1701. After adjustment, the electronic device can display the interface shown in Figure 17C. As shown in Figure 17C, the floating windows 1040 and 1510 are aligned at their left and right ends.

[0411] At this point, when the electronic device changes from a portrait to a landscape orientation, the displayed interface will change from that shown in Figure 17C to that shown in Figure 17D. As shown in Figure 17D, floating windows 1040 and 1510 are still displayed with their left and right edges aligned. At this time, the X values ​​of floating windows 1040 and 1510 are the same. Since the heights of floating windows 1040 and 1510 are parallel to the long side of the electronic device in interface 17c (Figure 17C), and parallel to the short side of the electronic device in interface 17d (Figure 17D), the layout of floating windows 1040 and 1510 may partially overlap when the electronic device changes from a portrait to a landscape orientation.

[0412] On interface 17d as shown in Figure 17D, the electronic device receives and responds to a trigger operation on the shortcut layout control 232 (e.g., a click operation on the shortcut layout control 232 as shown in Figure 17B), and can display the template selection interface 310 as shown in Figure 17E. On interface 17e as shown in Figure 17E, the electronic device receives a trigger operation on the layout template 335 (e.g., a click operation on the layout template 335 as shown in Figure 17E), and in response to the trigger operation, the electronic device can adjust the layout of the two currently open windows according to the style of the layout template 335.

[0413] For example, in one possible implementation, the electronic device can sequentially determine the windows matching each template sub-region in a left-to-right, top-to-bottom order as shown in Figure 11B(a). When determining the windows matching each template sub-region, the electronic device can combine factors such as the window's and template sub-region's landscape / portrait attributes, the window's operation order, the window's X value, and the window's ID for matching. After adjustment, the layout adjustment result shown in Figure 17F can be displayed.

[0414] Specifically, the electronic device first matches the window in the portrait template sub-area 336. At this point, neither of the two open windows matches; the landscape / portrait attributes of the applications displayed in the two floating windows are different from, but compatible with, the landscape / portrait attributes of the portrait template sub-area 336. Simultaneously, neither floating window receives any operation, and the opening order of the applications displayed in the two floating windows, as well as the X-values ​​of the two floating windows, are the same. Based on the window's landscape / portrait attributes, operation order, X-value, and the opening time of the applications displayed in the windows, the electronic device cannot determine which window will preferentially match the template sub-area 336.

[0415] At this point, the electronic device can match windows according to their IDs. For example, the electronic device can prioritize matching the floating window 1040 with the template sub-region 336, which has a larger ID value. When two applications are open simultaneously, the window IDs can be randomly assigned by the electronic device. In one possible implementation, the ID value of the floating window 1510 may also be larger than the ID value of the floating window 1040.

[0416] Optionally, in one possible implementation, the split-screen application can also be a top-to-bottom split-screen application consisting of two applications. When an electronic device opens a top-to-bottom split-screen application consisting of two applications, the two applications in the top-to-bottom split-screen application can be displayed by default in a top-bottom, left-aligned position (for example, as shown in Figure 17D).

[0417] For example, the flowchart shown in Figure 18A is a possible implementation of matching windows and template sub-regions based on the landscape and portrait screen attributes of windows and template sub-regions, the operation order of windows, the opening order of applications displayed in windows, the X value of windows, and the ID of windows, according to an embodiment of this application.

[0418] Steps S1801-S1803 can be found in the previous description of the process shown in Figure 13, and will not be repeated here.

[0419] Specifically, during the execution of each step in steps S1801-S1803, the electronic device can execute steps S18001-S18004. This includes:

[0420] S18001: If at least two windows display the same landscape and portrait orientation of the application, match the template sub-area according to the operation order of the at least two windows.

[0421] The order of operations on a window can be from the most recent operation to the earliest operation, or from the earliest operation to the most recent operation.

[0422] S18002: If at least two windows display applications with the same landscape and portrait orientation and the same window operation order, match the template sub-area according to the opening order of the applications displayed in the at least two windows.

[0423] The order in which applications are displayed in the window can be from most recently opened to earliest opened, or from earliest opened to most recently opened.

[0424] S18003: If at least two windows display applications with the same landscape and portrait orientation and the same application opening order, and the same window operation order, match the template sub-region according to the X value of the at least two windows.

[0425] The matching of the template sub-regions according to the X values ​​of at least two windows can be done either by matching the template sub-regions in ascending order of the X values ​​of the windows, or by matching the template sub-regions in descending order of the X values ​​of the windows.

[0426] S18004: If at least two windows display applications with the same landscape / portrait orientation and application opening order, and the same window operation order and X value, match the template sub-region according to the ID of the at least two windows.

[0427] The matching of the template sub-regions according to the IDs of at least two windows can be done either by matching the window IDs in ascending order or by matching the window IDs in descending order.

[0428] In steps S18001-S18004, when the at least two windows match the template sub-region according to a certain condition (operation order / opening order of displayed applications / X value / ID), the windows can be displayed sequentially in the template sub-region of the layout template according to that condition. Displaying the windows sequentially in the template sub-region of the layout template can be done according to either a descending or ascending order of the sequence numbers shown in Figures 11B(a)-11C. Optionally, in another possible implementation, when the electronic device matches the windows and template sub-regions based on their landscape and portrait orientations, and at least two sets of windows and template sub-regions with the same or compatible landscape and portrait orientations exist, the electronic device can also match between these at least two sets of windows and template sub-regions according to the order in which the windows are identified as the focus windows.

[0429] An electronic device may designate a window as the focus window when one of the following two situations occurs: first, when the window is displayed for the first time; second, when the window receives an operation after being displayed.

[0430] For example, as shown in FIG15A, the electronic device can sequentially receive trigger operations (e.g., click operations on the application icons of applications 1013, 1014, 1041, 1511, and 1015). In response to the aforementioned five trigger operations, the electronic device can sequentially display floating windows 1010, 1011, 1040, 1510, and 1012 in the screen display area 110. When the electronic device first displays floating window 1010, it designates floating window 1010 as the focus window. When the electronic device displays floating window 1011 for the first time while displaying floating window 1010, it designates floating window 1011 as the focus window. Similarly, when the electronic device displays floating windows 1010, 1011, 1040, 1510, and 1012 in the screen display area 110 in sequence, the order in which these five floating windows are identified as the focus windows, from the most recently identified to the earliest identified, can be: Floating window 1012 -> Floating window 1510 -> Floating window 1040 -> Floating window 1011 -> Floating window 1010.

[0431] When a window receives an operation after being displayed, the electronic device can designate the window receiving the operation as the focus window. For example, in interface 15a shown in FIG15A, the electronic device receives a trigger operation acting on the application interface of application 1041. In response to the trigger operation, the electronic device can display the floating window 1040 of application 1041 on the top layer, as shown in FIG15B. The trigger operation can be two click operations on note item 1512 in the application interface of application 1041, as shown in FIG15A. In response to the first click operation on note item 1512 in the application interface of application 1041, the electronic device will designate the floating window 1040 of the application interface of application 1041 as the focus window. At this time, the electronic device can display the floating window 1040 on the top layer. In one possible implementation, when the window is designated as the focus window, the user can operate the application interface displayed in the focus window. For example, when the electronic device determines the floating window 1040 as the focus window in response to the first click operation on the note item 1512 in the application interface of application 1041, the electronic device can display the details interface 1520 of the note item 1512 in the floating window 1040 in response to the second click operation on the note item 1512 in the application interface of application 1041. Optionally, the electronic device can also determine the floating window 1040 as the focus window again. In this case, the order in which the five floating windows are determined as focus windows, as shown in FIG15B, can be sorted from most recently determined to earliest determined as focus: Floating window 1040 -> Floating window 1012 -> Floating window 1510 -> Floating window 1011 -> Floating window 1010.

[0432] In interface 15b shown in Figure 15B, the electronic device receives a trigger operation on the shortcut layout control 232 (e.g., a click operation on the shortcut layout control 232 as shown in Figure 15B). In response to the trigger operation, the electronic device can display the template selection interface 320 shown in Figure 15C. In interface 15c shown in Figure 15C, the electronic device receives a trigger operation on the layout template 350 (e.g., a click operation on the layout template 350 as shown in Figure 15C). In response to the trigger operation, the electronic device can adjust the layout of the five currently open windows according to the style of the layout template 350.

[0433] For example, in one possible implementation, the electronic device, by combining the landscape and portrait screen attributes of the window and template sub-regions, and the order in which the window is determined as the focus window, adjusts the window layout as shown in Figure 15C according to the style of layout template 350, and can then display the layout adjustment result shown in Figure 15D.

[0434] Since the number of template sub-regions in the layout template 350 is less than the number of open windows, the electronic device can display some of the open windows in the layout of some template sub-regions, and shrink and display the other windows whose layout is not yet determined in another template sub-region. For example, as shown in Figure 15D, the electronic device can display 3 out of 5 open windows in the layout of 3 template sub-regions, and shrink and display the remaining 2 windows in the layout of another template sub-region with no matching windows.

[0435] In the process of matching the three windows with the three template sub-regions, the electronic device can determine the windows to be matched to each template sub-region in the order from left to right and from top to bottom, as shown in Figure 11B(a). At the same time, when matching windows for each template sub-region, the electronic device can give priority to matching the landscape and portrait attributes of the windows and template sub-regions.

[0436] Specifically, the electronic device first matches windows for the landscape template sub-region 351. At this time, none of the open windows are matched, and there are floating windows 1010 displaying landscape application 1013 and floating windows 1011 displaying landscape application 1014. Since there are two windows with the same landscape / portrait attributes as the template sub-region 351, the electronic device can further match the window that was most recently identified as the focus window, according to the order in which the windows were determined as focus windows. As shown in Figures 15A-15C (see the previous explanation of Figures 15A-15C for details), the electronic device first displays floating window 1010, and then displays floating window 1011. Neither floating window 1010 nor floating window 1011 receives any operation after being displayed. Therefore, floating window 1010 is identified as the focus window earlier than floating window 1011, and floating window 1011 is the most recently identified focus window compared to floating window 1010. At this time, the electronic device can prioritize matching the floating window 1011, which was most recently identified as the focus window, with the template sub-region 351 according to the order in which the windows were identified as focus windows.

[0437] Secondly, the electronic device can match windows for the landscape template sub-region 353. At this time, among the open and unmatched windows, there is only one floating window 1010 displaying the landscape application 1013, and the floating window 1010 has the same landscape and portrait attributes as the template sub-region 353. The electronic device can prioritize matching the floating window 1010 with the template sub-region 353.

[0438] Next, the electronic device can match windows for the landscape template sub-region 352. At this time, among the open and unmatched windows, there are no windows with the same landscape / portrait attributes as the template sub-region 352. The electronic device can prioritize matching windows with different but compatible landscape / portrait attributes. Specifically, floating windows 1040 for displaying compatible application 1041 and 1510 for displaying compatible application 1511 are not matched. Since there are two windows with different but compatible landscape / portrait attributes, the electronic device can further prioritize matching the window most recently identified as the focus window, according to the order in which the windows were identified as focus windows. Because floating window 1040 received an operation after being displayed, and the time of receiving the operation was later than the time floating window 1510 was displayed, and floating window 1510 did not receive an operation after being displayed, floating window 1040 was identified as the focus window later than floating window 1510. At this time, the electronic device can prioritize matching floating window 1040, which was most recently identified as the focus window, with the template sub-region 352.

[0439] Finally, after the electronic device matches the three windows with the three template sub-regions, it can display two additional windows (floating window 1510 and floating window 1012) in the finally determined template sub-region 354.

[0440] As shown in Figure 15D, when the electronic device adjusts the window layout according to the layout template, considering two factors, the priority of the landscape and portrait orientation attributes of the window and template sub-regions is higher than the order in which the window is identified as the focus window. Specifically, floating window 1040 is the window most recently identified as the focus window among the five floating windows shown in Figure 15C. However, since application 1041 is a compatible application, when matching the first landscape template sub-region 351, the electronic device still prioritizes matching and displaying the floating window of the landscape application. This achieves a better display effect.

[0441] Understandably, when at least two windows have the same landscape and portrait orientation, electronic devices can prioritize matching the window that was first identified as the focus window, based on the order in which the windows were identified as the focus windows.

[0442] In another possible implementation, when at least two windows have the same landscape and portrait orientation, the electronic device may disregard the window operation order and instead prioritize matching the window that was most recently / earliest identified as the focus window, according to the order in which the windows were identified as the focus windows.

[0443] Optionally, in one possible implementation, the electronic device can determine the order in which multiple windows are identified as the focus window based on the display window and the time when the window receives the operation.

[0444] For example, the flowchart shown in Figure 18B is a possible implementation of matching windows and template sub-regions based on the landscape and portrait screen attributes of windows and template sub-regions and the order in which windows are determined as focus windows, according to an embodiment of this application.

[0445] Steps S1801-S1803 can be found in the previous description of the process shown in Figure 13, and will not be repeated here.

[0446] Specifically, during the execution of each step in steps S1801-S1803, the electronic device can execute step S18005. This specifically includes:

[0447] S18005: If at least two windows display the same landscape or portrait orientation of the application, match the template sub-region in the order in which the at least two windows are identified as the focus windows.

[0448] The order in which windows are designated as the focus window can be from the most recently designated focus window to the earliest designated focus window, or from the earliest designated focus window to the most recently designated focus window.

[0449] When matching a template sub-region with the order in which at least two windows are identified as focus windows, the windows can be displayed sequentially in the template sub-region of the layout template in the same order. This sequential display of windows in the template sub-region of the layout template can be done according to either a descending or ascending order of the serial numbers shown in Figures 11B(a)-11C.

[0450] The hardware structure of an electronic device provided in the embodiments of this application is described below.

[0451] Figure 19 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.

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

[0453] Electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, camera 193, display screen 194, buttons 190, and indicator 192. The sensor module 180 may include pressure sensor 180A, touch sensor 180K, etc.

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

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

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

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

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

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

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

[0461] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

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

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

[0464] Electronic device 100 can perform shooting functions through an ISP, camera 193, video codec, GPU, display 194, and application processor. The ISP is used to process data fed back by the camera 193. The camera 193 is used to capture still images or videos.

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

[0466] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.

[0467] Electronic device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor. The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The speaker 170A, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. The receiver 170B, also called a "handpiece," is used to convert audio electrical signals into sound signals. When electronic device 100 answers a phone call or voice message, the receiver 170B can be brought close to the user's ear to listen to the voice. The microphone 170C, also called a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.

[0468] Touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be disposed on the surface of electronic device 100, in a different location than display screen 194.

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

[0470] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

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

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

[0473] It should be understood that the steps in the above-described method embodiments provided in this application can be implemented by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.

[0474] This application also provides an electronic device that may include a memory and a processor. The memory may be used to store a computer program; the processor may be used to invoke the computer program in the memory to cause the electronic device to perform the methods in any of the above embodiments.

[0475] This application also provides a chip system including at least one processor for implementing the functions involved in the methods performed by the electronic device in any of the above embodiments.

[0476] In one possible design, the chip system also includes a memory for storing program instructions and data, which may be located within or outside the processor.

[0477] The chip system can consist of chips or include chips and other discrete components.

[0478] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.

[0479] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.

[0480] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0481] This application also provides a computer program product comprising: a computer program (also referred to as code or instructions) that, when run, causes a computer to perform the method executed by the electronic device in any of the above embodiments.

[0482] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). When the computer program is run, it causes the computer to perform the method executed by the electronic device in any of the above embodiments.

[0483] The software architecture of the electronic device provided in the embodiments of this application is described below.

[0484] Figure 20 is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application.

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

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

[0487] As shown in Figure 20, the application package may include desktop applications, system user interfaces, video applications (such as video apps), shopping applications, note-taking applications (such as memo apps), etc. The applications in this application can also be replaced with other software such as mini-programs or atomic services.

[0488] A desktop application includes applications that run on the system desktop. The electronic device 100 can interact with the user through the GUI provided by the system user interface. For example, in response to a user's triggering operation on the electronic device (such as a click on application icon 1), the desktop application displays window 1 and shows the application interface of the application corresponding to application icon 1 in window 1.

[0489] The system user interface (UI) refers to the user interface of the operating system. The system UI runs as applications, providing the basic GUI for the system. Examples include the status bar at the top of the screen, the navigation bar at the bottom of the screen, the quick settings bar in the drop-down menu, the notification bar, the lock screen, the desktop interface, the volume control dialog box, the screenshot display interface, the power button, and the recent tasks interface (also known as the background running window).

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

[0491] As shown in Figure 20, the application framework layer may include Window Manager Service (WMS), content providers, view system, resource manager, input module, notification manager, and WMShell.

[0492] WMShell stores the size of tasks and is responsible for multi-window interaction, floating window management, etc., making it an important window management center.

[0493] The Window Management Service is used to manage window applications. It can obtain the screen size, determine whether to display in full-screen mode, whether to use split-screen mode, and whether there are floating windows, status bars, screen lock, or screen captures. The Window Management Service is a service, also known as the Window Manager Service (WMS).

[0494] A window can be understood as an area on a display screen that shows the user interface (UI) and allows user interaction. In some embodiments, a window can also hide the user interface (i.e., the software's operating interface), quickly revealing application navigation and functions when the user needs to interact, or reopening the application's operating interface based on triggered commands. From a system perspective, a window is essentially a canvas. A display screen can include multiple windows, and the layout, order, and animations of these windows are managed by the Window Management Service (WMS). Windows are layered; higher-level windows are displayed on top of lower-level windows, obscuring them. For example, floating windows are always displayed on the top layer.

[0495] Content providers store and retrieve data, making that data accessible to the window management service. This data can include files, folders, text, videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

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

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

[0498] The input module is used to obtain the raw input events (including touch coordinates, timestamps of touch operations, etc.) corresponding to touch operations from the kernel layer and identify the control corresponding to the input event.

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

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

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

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

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

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

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

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

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

[0508] The rendering module can be used to draw and render images on the draggable window of the first object. For example, when the first object is text or a file, it can draw and render shadows and backgrounds on the draggable window of the text or file. When the first object is an image, it can draw and render shadows on the draggable window of the image.

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

[0510] The following example, using a drag-and-drop window scenario, illustrates the workflow of the software and hardware of electronic device 100.

[0511] Assume display screen 194 shows the application icon of the Notes app. When touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the object corresponding to the input event. Taking the touch operation as a click on the Notes app icon as an example, when the desktop application determines that the operation corresponding to the click on the Notes app icon is the Notes app icon, it sets the desktop application to run in the foreground. Then, the desktop application calls the interface of the application framework layer to report the event to the window management service. The window management service sets the window state of the application interface (such as full-screen display state), window position and size, etc., and draws the window. Then, by calling the kernel layer to control the display driver, the window is displayed on the display screen 194 above the desktop application.

[0512] Based on the electronic device software architecture shown in Figure 20, and in conjunction with the module interaction timing diagrams shown in Figures 21-22, the following describes a possible implementation of the screen layout method shown in Figures 2A-18B provided in the embodiments of this application for electronic devices to execute.

[0513] It should be noted that, in the process shown in Figures 21 and 22, the window management service module can work with other modules in the framework layer to implement the steps executed by the window management service module as shown in Figures 21 and 22.

[0514] Figure 21 illustrates a module interaction timing diagram of an electronic device provided in an embodiment of this application, which opens one or more windows in a free-floating window mode and can receive trigger operations applied to one or more windows. This may include the following steps:

[0515] S101. The window management service module receives an operation applied to the free-floating window control.

[0516] The window management service module in the electronic device can receive trigger operations applied to the free-floating window control. For example, as shown in Figure 2A, the trigger operation can be a click operation on the free-floating window control 511. It can also be understood that the trigger operation can be received by other modules of the electronic device and then sent to the window management service module.

[0517] After receiving a trigger operation applied to a free-floating window control, the window management service module can convert the trigger operation into a click event applied to the free-floating window control.

[0518] S102. The window management service module receives a trigger operation applied to the free-floating window control. In response to the trigger operation, the window management service module sends the click event coordinates to the desktop.

[0519] S103. The desktop enters free floating window mode.

[0520] After the desktop receives the click event coordinates sent by the window management service module, the desktop can enter the free floating window mode.

[0521] The desktop can be marked with a status value indicating whether it is in free-floating window mode or not. For example, the status value can be set to 0 and 1 to represent the desktop mode not being in free-floating window mode and being in free-floating window mode, respectively.

[0522] When the desktop enters free-floating window mode, the desktop can modify the value of this flag, for example, changing it from 0 to 1. Understandably, the desktop can also use other methods to mark whether it is in free-floating window mode. S104. After the desktop enters free-floating window mode, it notifies the WMShell module to enter free-floating window mode.

[0523] The S105.WMShell module enters free-floating window mode.

[0524] After receiving a notification from the desktop to enter free floating window mode, the WMShell module can enter free floating window mode.

[0525] The WMShell module can use a status value to indicate whether it has entered one of two states: free-floating window mode and free-floating window mode. When the WMShell module enters free-floating window mode, it can modify the value of this status flag.

[0526] For example, the status value setting can refer to the desktop status value setting in step S104, and will not be repeated here. The WMShell module can also mark whether the WMShell module is in a free floating window state in other ways.

[0527] After the S106.WMShell module enters the free floating window mode, the notification window management service module also enters the free floating window mode.

[0528] S107. The window management service module displays a transition animation.

[0529] Optionally, after receiving the notification from the WMShell module that it has entered the free floating window mode, the window management service module can first display a transition animation and then execute step S108.

[0530] For example, the transition animation displayed by the window management service module can be the dynamic effect shown in Figure 2B(a) and Figure 2B(b). For details, please refer to the previous description of the dynamic effect shown in Figure 2B(a) and Figure 2B(b).

[0531] S108. The window management service module enters the free floating window mode.

[0532] After displaying the transition animation, the window management service module can enter the free floating window mode.

[0533] Optionally, after receiving a notification from the WMShell module to enter free floating window mode, the window management service module may skip step S107 and directly enter free floating window mode. In one possible implementation, after receiving a notification from the WMShell module to enter free floating window mode, the window management service module may execute both steps S107 and S108 simultaneously.

[0534] The window management service module can use a status value to indicate whether it has entered one of two states: free-floating window mode and open-window mode. When the window management service module enters free-floating window mode, it can modify the value of this status flag.

[0535] For example, the status value setting can refer to the desktop status value setting in step S104, and will not be repeated here. The window management service module can also mark whether the window management service module is in a free floating window state in other ways.

[0536] Once the window management service module enters free-floating window mode, it will display the application interface of the opened application as a floating window by default. At this time, the electronic device enters free-floating window mode.

[0537] S109. The window management service module displays a prompt to enter the free floating window mode.

[0538] Optionally, the window management service module can display a prompt indicating that it has entered the free-floating window mode. For example, the prompt displayed by the window management service module may be as shown in Figure 2C; please refer to the previous explanation of the dynamic effect shown in Figure 2C.

[0539] Once the electronic device enters the free-floating window mode, it can open the application once or multiple times. Step S10 in Figure 21 illustrates the process of the electronic device opening the application once.

[0540] It is understandable that the electronic device performs the operation of opening the application once or multiple times, that is, performs the process of step S10 shown in Figure 21 once or multiple times.

[0541] As is understandable, the application shown in timing diagram 21 can refer to any one of one or more applications installed on the electronic device. These applications can be either system applications pre-installed on the electronic device or third-party applications.

[0542] It should be noted that each time the electronic device executes step S10, it can be a process of opening any one of the one or more applications installed on the electronic device. That is, each time the electronic device executes step S10, the application in step S108 can be any one of the one or more applications installed on the electronic device. Therefore, when the electronic device executes step S10 multiple times, it can be a process of opening multiple different applications installed on the electronic device, or it can be a process of opening the same application installed on the electronic device multiple times. In other words, when step S10 is executed multiple times, the application shown in timing diagram 21 can be the same or different applications during the multiple executions.

[0543] For example, when the electronic device performs step S10 to open application APP-1, the application in step S10 shown in FIG21 is APP-1. When the electronic device performs step S10 to open application APP-2, the application in step S10 shown in FIG21 is APP-2.

[0544] It is understandable that, during a single step S10, the application mentioned in different sub-steps of step S10 refers to the same application. For example, when the electronic device executes step S10 to open application APP-1, the application in step S10 shown in Figure 21 is APP-1 during this execution of step S10.

[0545] It is understandable that an electronic device can open an application once or multiple times after entering the free floating window mode, or it can open an application once or multiple times before entering the free floating window mode. That is, the position of step S10 shown in Figure 21 is only an example; the electronic device can execute step S10 either after step S109 or before step S109. This application does not limit the order in which the electronic device executes step S10.

[0546] It should be noted that the specific implementation process of step S10 may differ when the electronic device performs the operation of opening the application once or multiple times at different times. This application embodiment mainly describes the specific implementation process of the electronic device performing step S10 once or multiple times after entering the free floating window mode.

[0547] The following describes the process of an electronic device executing step S10 once in free floating window mode. This execution process is the first execution of step S10 after the electronic device is turned on.

[0548] For example, to facilitate understanding of this solution, unless otherwise stated, the following describes the specific implementation process of step S10 by taking the electronic device performing step S10, opening the application APP-1 corresponding to application icon 231 on interface 2c as shown in Figure 2C. The description of step S10 in this embodiment, combined with application APP-1, can also be applied to the process of an electronic device opening other applications, and will not be repeated in this embodiment.

[0549] S110. The application receives a trigger operation that applies to the application icon.

[0550] Each time step S10 is executed, the application can receive a trigger operation applied to the application icon.

[0551] For example, as shown in Figure 2C, application APP-1 can receive a trigger operation applied to application icon 231 of application APP-1. For example, the trigger operation can be a click operation as shown in Figure 2C.

[0552] It is understandable that the trigger operation received by the application is applied to the application icon, or it can be sent to the application by other modules of the electronic device after receiving the trigger operation.

[0553] S109. After receiving a trigger operation applied to the application icon, the application requests a layout from the window management service module in response to the trigger operation applied to the application icon. The layout request message may carry one or more of the following application parameters, including but not limited to: package name / application ID, floating window parameters, screen orientation parameters, and gradation parameters, etc.

[0554] In the application parameters, the package name / application ID can be used to indicate which application the requested layout is for.

[0555] The Floating Window parameter indicates whether the requested application supports opening in a floating window mode. A "Yes" parameter means the application supports this mode, meaning its interface can be displayed in a floating window. A "No" parameter means the application does not support this mode, meaning its interface can only be displayed in a full-screen window. For applications that support this mode, the electronic device, in free floating window mode, will display the application's interface in a floating window by default.

[0556] Landscape / Portrait parameters indicate the application's default landscape / portrait orientation. These parameters can include one or more of the following: landscape parameter and portrait parameter. The landscape parameter indicates whether the application supports landscape display, while the portrait parameter indicates whether the application supports portrait display.

[0557] A landscape mode parameter of "Yes" indicates that the application supports landscape display; a landscape mode parameter of "No" indicates that the application does not support landscape display. A portrait mode parameter of "Yes" indicates that the application supports portrait display; a portrait mode parameter of "No" indicates that the application does not support portrait display. Specifically, the default landscape and portrait mode attributes of the application corresponding to different landscape and portrait mode parameters are shown in Table 1.

[0558] Table 1

[0559] It is understood that the embodiments of this application do not limit the way in which the electronic device records the yes or no in the application parameters. For example, the electronic device can record yes or no by assigning the value of the parameter to true or false, or it can record yes or no by assigning the value of the parameter to 1 or 0. The embodiments of this application do not limit this.

[0560] The aspect ratio parameter indicates the aspect ratio supported by the requesting application. The aspect ratio refers to the aspect ratio of the rectangular display area when the application's interface is displayed within that area. Aspect ratios can include the following types: infinitely adjustable, proportionally adjustable, and six-level. Infinitely adjustable means the application supports all aspect ratios; that is, the application can display its interface within a rectangular display area with any aspect ratio. Proportionally adjustable means the application can display its interface within a rectangular display area with a fixed aspect ratio. This means that a rectangular display area with a fixed aspect ratio can have different display sizes depending on the specific width and height values. Six-level means the application can display its interface within a rectangular display area with any of six fixed aspect ratios: 4:3, 16:9, 21:9, 3:4, 9:16, and 9:21. Optionally, the aspect ratio can also include full-screen display only.

[0561] For example, after receiving a trigger operation (a click operation on the application icon 231 as shown in Figure 2C) applied to application APP-1, application APP-1 can request a layout from the window management service module in response to the trigger operation. For example, the layout request can carry one or more of the following application parameters: package name: APP-1, application ID: A1, floating window parameter: yes, landscape parameter: yes, portrait parameter: yes, and adjustment level parameter: infinitely adjustable.

[0562] S112. The window management module parses the application parameters carried in the layout request message sent by the application.

[0563] S113. After receiving the layout request message sent by the application, the window management module can obtain the number of currently open windows.

[0564] Understandably, since the electronic device can execute step S10 multiple times to open multiple applications, the number of currently open windows in step S113 can be 0 or not.

[0565] When the electronic device is turned on, the number of currently open windows is 0 when the process of step S10 is executed for the first time. For example, as shown in interface 2c of FIG2C, there are currently no open windows.

[0566] It is understood that the execution order of steps S112 and S113 is not limited in the embodiments of this application.

[0567] S114. After receiving the layout request message sent by the application, the window management service module can determine the layout of the application interface to be displayed and the layout of the currently open window.

[0568] When the electronic device is turned on, if the number of currently open windows is 0 when step S10 is executed for the first time, the electronic device only needs to determine the layout of the application interface of the application requesting the layout.

[0569] In one possible implementation, the window management service module determines the layout of the application interface to be displayed for the requesting application, which may include: the display mode of the requesting application and the specific aspect ratio of the displayed application interface, and determining the display coordinates of the application interface. In another possible implementation, the window management service module determines the layout of the application interface to be displayed for the requesting application, and may further include determining the specific size of the displayed application interface. The order in which the window management service module determines the display mode, the specific aspect ratio of the displayed application interface, the specific size of the displayed application interface, and the display coordinates of the application interface is not limited in this embodiment. The display mode may include display in a floating window or full-screen display, landscape display or portrait display.

[0570] The following describes a method provided by an embodiment of this application for a window management service module to determine the display mode of an application requesting a layout.

[0571] Optionally, in one possible implementation, the window management service module can determine the layout of the application interface of the requesting application to be displayed after step S112. In another possible implementation, the window management service module can determine the display method of the requesting application based on the application parameters of the requesting application.

[0572] Specifically, as shown in Table 2, the window management service module can determine the display method of applications with a "yes" floating window parameter based on the floating window parameters of the requesting application, and display them in the floating window. For applications with a "no" floating window parameter, the window management service module may not open the application in free floating window mode. Optionally, the window management service module can display a prompt. The prompt can be used to inform the user that the application requesting the layout does not support opening in a floating window mode. Optionally, the prompt can be text, such as "This application does not support floating window display," or "This application can only be opened in one window."

[0573] For applications that can be displayed in a floating window, the window management service module can further determine whether the application interface is displayed in landscape or portrait mode based on the landscape / portrait parameters of the application requesting the layout. The display methods corresponding to different landscape / portrait parameters are shown in Table 2.

[0574] Table 2

[0575] Optionally, in one possible implementation, after determining the display method of the application requesting the layout, the window management service module can also determine the specific aspect ratio of the application interface of the application requesting the layout to be displayed based on the level parameter in the application parameters.

[0576] Specifically, when the requested application's aspect ratio is proportional, the window management service module can determine the aspect ratio of the application's interface to be displayed within a rectangular display area with a fixed value, based on the application's aspect ratio parameters. This fixed value can be a value carried in the application's aspect ratio parameters. When the requested application's aspect ratio is six-level or infinitely variable, the window management service module can determine any aspect ratio supported by six-level or infinitely variable adjustment as the specific aspect ratio for displaying the application's interface. Optionally, the electronic device can default to any aspect ratio supported by six-level or infinitely variable adjustment (e.g., 9:16) as the specific aspect ratio for displaying the application's interface.

[0577] Optionally, in one possible implementation, the window management service module may not determine the layout of the application interface of the requesting application to be displayed after step S112.

[0578] The following describes another method provided by an embodiment of this application for a window management service module to determine the display mode of an application requesting a layout.

[0579] The window management service module can obtain a data structure containing application parameters of applications stored on the electronic device, and determine the display method and aspect ratio of the application to be displayed based on the application parameters in the data structure. If the application parameters of the application to be displayed are not present in the data structure, the application parameters carried by the application in the layout request are used to determine the display method and aspect ratio of the application to be displayed. For ease of description of the embodiments of this application, this data structure will be referred to as the application list below. In one possible implementation, the window management service module can parse the application list during initialization.

[0580] In one possible implementation, the application list stores application parameters that may differ from the application parameters carried by the application in the request layout message.

[0581] For example, in one possible implementation, the application parameters stored in the application list can be application parameters that enable a better user experience. For instance, as shown in Figure 10A, application 1015 is a short video application. For example, application 1015 carries both landscape and portrait parameters as "yes" in its layout request message, but the user experience is poor when application 1015 is displayed in portrait mode. Therefore, in the application list, the landscape / portrait attributes of application 1015 can be configured as follows: landscape parameter is "yes," and portrait parameter is "no." As another example, as shown in Figure 10A, application 1013 carries a "no" floating window parameter in its layout request message, but opening application 1013 as a floating window can improve the user experience, allowing users to use and operate application 1013 and other applications simultaneously. Therefore, the floating window parameter of application 1013 can be configured as "yes" in the application list.

[0582] In another possible implementation, an application list can be used to configure application parameter values ​​that differ from the application's own parameter values. This allows control over the application's display method and the specific aspect ratio of its interface. For example, an application with a "no" floating window parameter can be configured to support floating windows. Similarly, an application with a "no" portrait mode parameter can be configured to support portrait mode. Furthermore, an application with a proportional adjustment mode can be configured to have stepless adjustment.

[0583] Understandably, the window management service module determines the display method of the requesting application and the specific aspect ratio of the application interface based on the application list, which can achieve better display effects.

[0584] For example, after receiving the layout request message sent by application APP-1, the window management service module can determine the display mode of application APP-1 as portrait display based on the application parameters (floating window parameter: yes, landscape parameter: yes, portrait parameter: yes, level parameter: infinitely adjustable) carried by application APP-1 in the layout request message, and determine the specific aspect ratio of the application interface of application APP-1 to be 9:16.

[0585] Understandably, after the window management service module determines the display method of the application requesting the layout and the specific aspect ratio of the application interface, it can also determine the display coordinates of the application interface of the application requesting the layout.

[0586] In one possible implementation, the window management service module can determine the display coordinates of the application interface of the requesting application based on the number of currently open windows obtained in step S113. When the number of currently open windows is different, the same display method and the same aspect ratio can correspond to different display coordinates.

[0587] When the electronic device executes step S10 for the first time after being turned on, the number of currently open windows is 0.

[0588] For example, after the window management service module determines the display method of application APP-1 and the specific aspect ratio of the application interface, as shown in Figure 2C, since the number of currently open windows is 0, the window management service module can determine the display coordinates of the application interface of application APP-1 as: top left vertex (x1, y1), bottom right vertex (x2, y2). It can be understood that the layout of the application interface of application APP-1 can be uniquely determined by the two coordinates of the top left vertex (x1, y1) and the bottom right vertex (x2, y2). Here, (x2-x1) / 2 can be the median value of the rightmost X value of the screen display area of ​​the electronic device.

[0589] Understandably, the window management service module can also uniquely determine the layout of the application's interface by determining the coordinates of any vertex of the application's interface and the size of the displayed interface.

[0590] For example, as shown in Figure 2C, if the number of currently open windows is 0, the window management service module can also determine the display coordinates of the top left corner of the application interface of application APP-1 as (x1, y1), and determine the width and height of the application interface as (x2-x1) and (y2-y1) respectively.

[0591] S115. After receiving the layout request message sent by the application, the window management service module creates the window and window ID.

[0592] Specifically, the window management service module can send a message to the SurfaceFlinger module, requesting the SurfaceFlinger module to draw a window according to the layout determined by the window management service module in step S114. The window is used to display the application interface of the application requesting the layout.

[0593] When creating a window, a unique window ID can be generated that points to the created window.

[0594] For example, after receiving the layout request message sent by application APP-1, the window management service module can create window 240 as shown in Figure 2D and create window ID1, which can uniquely point to window 240.

[0595] In free-floating window mode, the electronic device displays the application interface of the opened application in a floating window by default. Therefore, when the electronic device executes step S10 in free-floating window mode, the window management service module can create a window and a window ID.

[0596] S116. After creating a window and its ID, the window management service module can display the window.

[0597] After the window management service module sends a message to the SurfaceFlinger module to draw the window, the SurfaceFlinger module can begin drawing the window. At this point, the window management service module can begin displaying the window drawn by the SurfaceFlinger module. The moment the SurfaceFlinger module begins drawing the window, and the moment the window management service module begins displaying the window, is the moment the application is opened. At this time, the window management service module can determine the currently drawn and displayed window as the current focus window and update the focus window queue, thereby recording the order in which the focus windows are determined. The focus window queue may exist during the initialization of the window management service module. Optionally, in one possible implementation, the window management service module can sequentially arrange the windows currently determined as focus windows into the focus window queue.

[0598] Understandably, since the SurfaceFlinger module can start drawing only one window at a time, when determining the focus window based on the time when the SurfaceFlinger module starts drawing the window, there is no possibility that two windows will be determined as focus windows at the same time (i.e., the order in which the two windows are determined as focus windows is the same).

[0599] Optionally, in another possible implementation, the window management service module can record the time when a window begins to be displayed (i.e., when the SurfaceFlinger module begins drawing the window), which is the time when the application is opened. Optionally, the window management service module can set a minimum time unit for recording (e.g., seconds), which may not be accurate to the precise moment a window begins to be displayed. Therefore, it is possible that at least two windows may be displayed at the same time.

[0600] S117. The window management service module sends the window layout to the application.

[0601] After creating a window and its ID, the window management service module can send the window layout to the application.

[0602] Specifically, when the electronic device executes step S10 for the first time after being turned on, the window layout refers to the layout of the window created in step S115. Since the window created in step S115 is used to display the application interface of the application requested in step S111, the window layout in step S116 can be the layout of the application interface of the application requested in step S114 that is displayed.

[0603] For example, after the window management service module creates window 240 and window ID1, it can send the layout of window 240 to application APP-1. The layout of window 240 can be: top-left vertex (x1, y1), bottom-right vertex (x2, y2). Optionally, the layout of window 240 can also be: top-left vertex (x1, y1), with a width of (x2-x1) and a height of (y2-y1).

[0604] S118. The application draws the interface based on the window layout sent by the window management service module and obtains the drawing result.

[0605] After receiving the window layout sent by the window management service module, the application can determine the size of the application to be displayed based on the window layout, and then draw the application interface with the size corresponding to the display size.

[0606] For example, after receiving the layout of window 240 sent by the window management service module, application APP-1 draws an application interface with a width of (x2-x1) and a height of (y2-y1) according to the layout of the top left vertex (x1, y1) and the bottom right vertex (x2, y2), thus obtaining the drawing result. Optionally, the layout of window 240 sent by the window management service module can also directly include the width and height values.

[0607] S119. After the application completes the interface drawing, the application sends the interface drawing results to the window management service module.

[0608] For example, after completing the interface drawing, application APP-1 sends the interface drawing results to the window management service module.

[0609] It should be noted that there is no explicit order between steps S116 and S11, and they can be performed simultaneously.

[0610] S120. After receiving the interface drawing results sent by the application, the window management service module displays the interface drawing results in the window.

[0611] When the electronic device executes step S10 for the first time after being turned on, the window in step S119 refers to the window created in step S115.

[0612] For example, after receiving the interface drawing result sent by application APP-1, the window management service module displays the interface drawing result in the window 240 created in step S115, as shown in Figure 2D. The application display area 241 of window 240 can display the application interface drawn by application APP-1 in step S117. The layout of window 240 is uniquely determined by the top-left vertex (x1, y1) and bottom-right vertex (x2, y2), or by the top-left vertex (x1, y1) and a width of (x2-x1) and a height of (y2-y1).

[0613] The following describes the process of the electronic device executing step S10 once in the free floating window mode. This execution process is the Nth time the electronic device executes step S10 after it is turned on.

[0614] When the electronic device executes step S10 for the Nth time after being turned on, the implementation process of steps S110 and S113 can refer to the process of the electronic device executing step S10 for the first time after being turned on. The embodiments of this application will not be described again here.

[0615] In step S114, the number of currently open windows is not 0, but (N-1). Therefore, the window management service module needs to determine the layout of the application interface of the requesting application to be displayed, as well as the layout of the currently open windows. The method by which the window management service module determines the layout of the application interface of the requesting application to be displayed is the same as the process of executing step S10 for the first time.

[0616] For example, consider the case where an electronic device continues to open application APP-2 corresponding to application icon 242 on the interface shown in Figure 2D. For example, the floating window parameters, landscape / portrait parameters, and aspect ratio parameters of application APP-2 can be the same as those of application APP-1. Then, the window management service module can determine the display mode of APP-2 as portrait mode and determine the specific aspect ratio of the application interface of application APP-1 to be 9:16.

[0617] When the electronic device is in free-floating window mode and performs step S10 for the second time, the number of currently open windows is 1. The window management service module can determine the layout of the application interface of the requesting application APP-2 to be displayed based on the number of currently open windows, and redetermine the layout of the currently open window 240.

[0618] For example, the window management service module can redefine the display coordinates of the application interface of application APP-1 as: top left vertex (x2, y2), bottom right vertex (x3, y3), and the display coordinates of the application interface of application APP-2 as: top left vertex (x4, y4), bottom right vertex (x5, y5). Here, (x5-x2) / 2 can be the midpoint of the rightmost X value of the screen display area of ​​the electronic device. This ensures that the application interfaces of the two applications are displayed centered in the screen display area, as shown in Figure 2E.

[0619] In step S117, the window layout sent by the window management service module includes the layout of the window created in step S115 and the layout of the currently open window in step S114. Furthermore, the window management service module sends the layouts of different windows to different applications, and each of the N applications draws its application interface according to the received layout. Therefore, step S11 can be executed N times, respectively implementing the process of the window management service module sending N window layouts to N applications, and each of the N applications completing its interface drawing and sending the drawing results to the window management service module.

[0620] In step S120, the window management service module displays the N interface drawing results from step S11 in N windows respectively.

[0621] Optionally, in one possible implementation, after displaying one or more windows, the electronic device may also receive and respond to a trigger operation on one or more windows, executing step S12 once or N times. This may include:

[0622] S121. A trigger operation was received that is applied to the already opened window 1.

[0623] Window 1 can be any one of the one or more windows currently displayed by the electronic device when performing step S121.

[0624] Understandably, a trigger operation can also be initiated by other modules of the electronic device receiving the trigger operation and then sending it to the window management service module.

[0625] For example, the triggering operation can be a click operation on note entry 1512 in the application interface of application 1041, as shown in Figure 15A.

[0626] Optionally, in one possible implementation, when the window management service receives a trigger operation applied to an already opened window 1, it can record the time when the trigger operation was received. This time can be the time after the window was displayed when the operation was received. Optionally, the window management service module can set a minimum time unit for recording (e.g., seconds), which may not be accurate to the precise moment the window received the operation. Therefore, it is possible that at least two windows receive the operation at the same time.

[0627] S122. Update the focus window queue.

[0628] When the window management service receives a trigger operation applied to an already opened window 1, it can simultaneously designate window 1 as the current focus window and update the focus window queue, thereby recording the order in which the focus windows are designated. Optionally, in one possible implementation, the window management service module can sequentially arrange the windows currently designated as focus windows into the focus window queue.

[0629] The window management service can determine the current focus window 1 based on the exact moment when the trigger operation is received and applied to the already opened window 1. Therefore, it is possible for two windows to be determined as focus windows at the same time (i.e., the order in which the two windows are determined as focus windows is the same).

[0630] Understandably, when an electronic device executes step S10 as shown in Figure 21 multiple times, the execution order of multiple steps S12 and multiple steps S10 other than the first step S10 can be arbitrary.

[0631] Optionally, in one possible implementation, the application 1 opened in step S108 can also be a split-screen application.

[0632] Through the module interaction process shown in Figure 21, this application embodiment provides a possible implementation method for an electronic device to open one or more windows in a free floating window mode and receive trigger operations applied to one or more windows.

[0633] As shown in Figures 2A-18B, when an electronic device has one or more windows open and can receive operations on the windows, it can also automatically adjust the layout of the open windows according to the style of the layout template.

[0634] Figure 22 shows a sequence diagram of module interactions in an embodiment of this application, illustrating how an electronic device adjusts the layout of an open window according to a layout template. This may include the following steps:

[0635] S201. The window management service module receives a trigger operation applied to the shortcut layout control.

[0636] For example, Figure 2F shows a click operation on the quick layout control 232. It can be understood that the trigger operation can also be initiated by other modules of the electronic device receiving the trigger operation and sending it to the window management service module.

[0637] After receiving a trigger operation applied to a shortcut layout control, the window management service module converts the trigger operation into a click event applied to the shortcut layout control.

[0638] S202. The window management service module receives a trigger operation applied to the shortcut layout control. In response to the trigger operation, the window management service module sends the click event coordinates to the desktop.

[0639] S203. Desktop Notification WMShell Module Startup Template.

[0640] After receiving the notification message from the desktop to launch the template, the S204.WMShell module obtains the template's XML (Extensible Markup Language) configuration file.

[0641] Therefore, layout templates can control the positional relationship of multiple windows within the same screen display area by setting the positional relationship of multiple template sub-regions within the same display area.

[0642] The module's XML configuration file is used to specify the style of the layout template. Optionally, a template's XML configuration file can be used to describe the style of a layout template.

[0643] Understandably, XML configuration files can be written in many different ways. For example, in one possible implementation, the XML configuration file can use the layout container androidx.constraintlayout.widget.ConstraintLayout to lay out multiple template sub-regions.

[0644] The `androidx.constraintlayout.widget.ConstraintLayout` class defines layouts using constraints. Constraints involve setting the relationship (e.g., positional relationship) between each component and other components or its parent container to arrange multiple components within the same display area. Each component can be a display area itself; for example, each template sub-area can be a component, and each template sub-area can be a display area. Display areas are used to display the application interface. Each component can contain other components, and each component containing other components has a parent container relative to its internal components.

[0645] For example, in one possible implementation, the layout container `androidx.constraintlayout.widget.ConstraintLayout` is used to set the positional relationship of multiple template sub-regions within the same screen display area. This can include three levels of nested tags. The first level can define display area one, used to limit the area within the screen display area used for multi-window layout; the second level can define display area two, which can be smaller than display area one, and can be used to limit the display area occupied by multiple template sub-regions within display area one; the third level can define the parameters of each minimum component (i.e., each template sub-region). The parent container of display area two is display area one, and the parent container of each minimum component is display area two.

[0646] For example, this application embodiment provides an XML configuration file for a layout template with three template sub-regions. For ease of understanding, the XML configuration file shown in this application embodiment is called "hn_pattern_split3_1vleft_2hright". This application does not impose any special restrictions on the name of the configuration file. Figure 23A shows the style of the layout template specified by the XML configuration file hn_pattern_split3_1vleft_2hright. For example, it can be the style of layout template 330.

[0647] In the XML configuration file hn_pattern_split3_1vleft_2hright, the first and second layers can be used. <androidx.constraintlayout.widget.ConstraintLayout……< / androidx.constraintlayout.widget.ConstraintLayout> The third layer can be accessed through three tags.<com.android.wm.shell.hndesktoppattern.HnDesktopLayoutView…… / > The `<em>` tag sets parameters for three template sub-regions (i.e., three minimum components) in the layout template. For example, each `<em>` tag may include some or all of the following fields: `android:id`, `app:layout_constraintDimensionRatio`, `app:layout_constraintBottom_toBottomOf`, `app:layout_constraintStart_toStartOf`, `app:layout_constraintEnd_toEndOf`, `app:layout_constraintTop_toTopOf`, `app:layout_constraintBottom_toTopOf`, `app:layout_constraintTop_toBottomOf`, `android:layout_marginTop`, and `android:padding`. The `android:id` field can be used to uniquely identify a component. The `app:layout_constraintDimensionRatio` field can indicate the component's aspect ratio in the form of "width:height". The `app:layout_constraintBottom_toBottomOf` field can be used to indicate the bottom alignment of the component. The `app:layout_constraintStart_toStartOf` field can be used to indicate the leftmost alignment of a component. `app:layout_constraintEnd_toEndOf` can be used to indicate the rightmost alignment of a component. `app:layout_constraintTop_toTopOf` can be used to indicate the topmost alignment of a component. `app:layout_constraintBottom_toTopOf` can be used to indicate the bottommost alignment of a component, with the bottom of the component aligned to the top of the alignment object.`app:layout_constraintTop_toBottomOf` can be used to indicate the topmost alignment of a component, ensuring that the top of the component is aligned with the bottommost edge of that alignment object. `android:layout_marginTop` can be used to indicate the distance between a component and other components above it or its parent container. The `android:padding` field can be used to indicate the margins of components within the same component.

[0648] The fields `app:layout_constraintBottom_toBottomOf`, `app:layout_constraintStart_toStartOf`, `app:layout_constraintEnd_toEndOf`, and `app:layout_constraintTop_toTopOf` can be set to `parent` to indicate that the component is aligned with its parent container. When either end of the component is aligned with its parent container, that end of the component will be as close as possible to the corresponding end of the parent container. For example, when the bottom end of the component is aligned with its parent container, the component will be as close as possible to the bottom end of the parent container. For instance, when there are no other opposing positional constraints, the bottom end of the parent container can be used as the bottom end of the component. When both opposite ends of the component (e.g., top and bottom, left and right) are aligned with its parent container, both opposite ends of the component will be as close as possible to the corresponding end of the parent container, ultimately ensuring that the shortest distances from the opposite ends of the component to the corresponding ends of the parent container are equal. For example, when both the top and bottom of a component are aligned with the parent container, the shortest distance between the top of the component and the top of the parent container is equal to the shortest distance between the bottom of the component and the bottom of the parent container.

[0649] First layer of labels <androidx.constraintlayout.widget.ConstraintLayout……< / androidx.constraintlayout.widget.ConstraintLayout> Display area one is defined. Display area one is the area within the screen display area used for multi-window layout. Template sub-areas can only be displayed within display area one.

[0650] For example, in one possible implementation, display area one can be the entire screen display area of ​​the electronic device; that is, the maximum display size of the template sub-area can fill the entire screen display area of ​​the electronic device. Optionally, in another possible implementation, to achieve a better display effect, display area one can be a portion of the screen display area. For example, another portion of the screen display area can be reserved for displaying the status bar 111.

[0651] For example, the XML configuration file can use the three fields `android:paddingTop`, `android:paddingBottom`, and `android:paddingHorizontal` to set the margins of the top, bottom, left, and right edges of display area one from the edge of the screen display area. By setting the margins, the size of display area one is made smaller than the size of the screen display area of ​​the electronic device. As shown in Figure 23A, the screen display area of ​​the electronic device can be display area 2320, and display area one set by the first-level tag can be display area 2321.

[0652] In three<com.android.wm.shell.hndesktoppattern.HnDesktopLayoutView…… / > In the tag, the android:id field is @+id / view1, which uniquely indicates the template sub-region 331 in the layout template 330 shown in Figure 23A; the android:id field is @+id / view2, which uniquely indicates the template sub-region 332 in Figure 330; and the android:id field is @+id / view3, which uniquely indicates the template sub-region 333 in Figure 330.

[0653] For example, in the android:id field, it is @+id / view1<com.android.wm.shell.hndesktoppattern.HnDesktopLayoutView…… / > In the `` tag, the `app:layout_constraintDimensionRatio` field is 3:4, indicating that the aspect ratio of the template sub-region `view1` is 3:4. This is shown in Figure 23A as the aspect ratio of the template sub-region 331. The `app:layout_constraintBottom_toBottomOf` field is `parent`, indicating that the bottom edge of the template sub-region 331 in Figure 23A is aligned with the bottom edge of the parent container display region 2322. The `app:layout_constraintStart_toStartOf` field is `parent`, indicating that the left edge of the template sub-region 331 in Figure 23A is aligned with the left edge of the parent container display region 2322. The `app:layout_constraintTop_toTopOf` field is `parent`, indicating that the bottom edge of the template sub-region 331 in Figure 23A is aligned with the bottom edge of the parent container display region 2322. As shown in Figure 23A, the left, top, and bottom ends of the template sub-region 331 overlap with the left, top, and bottom ends of the display area 2322, respectively, and are displayed with a horizontal length to vertical length ratio of 3:4. Since the display positions of the left, top, and bottom ends of the template sub-region 331 are fixed, and the display size is limited to the range of the display area 2322, the display position of the right end of the template sub-region 331 can be uniquely determined by setting the display ratio.

[0654] For example, based on the field parameters of components @+id / view2 and @+id / view3, the display effects of components @+id / view2 and @+id / view3 are shown in template sub-regions 332 and 333 in Figure 23A, respectively. As shown in Figure 23A, the aspect ratio of template sub-regions 332 and 333 is 16:9. The upper and right ends of template sub-region 332 overlap with the upper and right ends of display area 2322, respectively, and the right and lower ends of template sub-region 333 overlap with the right and lower ends of display area 2322, respectively. Simultaneously, there is a distance of 2323 between the lower end of template sub-region 332 and the upper end of template sub-region 333. The distance 2323 can be determined by the value of the field android:layout_marginTop in the tag @+id / view3 of the component. The value of @dimen / desktop_pattern_item_margin can be any value, such as 4dp. The display effect is shown in Figure 23A.

[0655] In the tags that set the display relationship of template sub-regions, if the display area of ​​the template sub-region is not restricted to the range of display area two 2322 through a second-level tag, the template sub-regions can be displayed in display area one 2321 according to the positional relationship shown in the XML configuration file hn_pattern_split3_1vleft_2hright shown in the embodiments of this application. In this case, in some possible embodiments, the aspect ratio of display area one 2321 may not allow the three template sub-regions to be tiled. As shown in Figure 23B, when the aspect ratio of display area one 2321 is as shown in Figure 23B, if the three template sub-regions are displayed in display area one 2321 in 23A according to the parameters of the XML configuration file hn_pattern_split3_1vleft_2hright, the three template sub-regions will overlap.

[0656] To achieve better display of the three template sub-regions, one possible implementation is to set a second display region within the first display region using a second-level tag. The aspect ratio of the second display region can be determined based on the aspect ratio and positional relationship of each template sub-region in the layout template. For example, based on the aspect ratio and positional relationship of the three template sub-regions, the aspect ratio of the second display region can be set to 29.5:18. In the second display region with an aspect ratio of 29.5:18, the three template sub-regions will not overlap and will have a better display effect.

[0657] In this embodiment, by rationally designing the aspect ratio of display area two, the various template sub-areas in each layout template can be arranged closely together without overlapping, but with certain gaps between them. Therefore, the layout template can present a better display effect, thereby enabling multiple windows laid out according to the layout template style to present a better display effect.

[0658] It is understood that the XML configuration file hn_pattern_split3_1vleft_2hright shown is merely an example, and the number of template sub-regions set in the XML configuration file can be two, four, or more. Furthermore, the parameters of each component in the XML configuration file can be set to any other arbitrary parameters, and this application does not impose any restrictions on this. The hierarchy and number of tags in the XML configuration file can also be other levels and numbers, and a reasonable layout of template sub-regions can be achieved in other ways. The XML configuration file hn_pattern_split3_1vleft_2hright shown is only one possible implementation.

[0659] Optionally, the template's XML configuration file can be stored in the WMShell module.

[0660] The S205.WMShell module creates a template array.

[0661] The WMShell module can create template arrays to store data for each template sub-region in the layout template obtained from parsing the XML configuration file, as well as other data that needs to be assigned to the template sub-regions.

[0662] For example, in one possible implementation, the template array can store the following fields for each template sub-region: window, width and height, and coordinates. The window field stores the unique identifier (e.g., window ID) of the window displayed ...

Claims

1. A window layout method, characterized in that, Applied to electronic devices, the method includes: Display a first interface, the first interface includes a first value of windows, the first value of windows correspond to a second value of applications, the second value is less than or equal to the first value, the second value of applications does not include the first application, and the first value of windows are all vertical windows; While maintaining the display of the first value window, in response to an operation performed on the icon of the first application, the first window of the first application is displayed, and the first window of the first application is a landscape window; In the case where the first value window and the first window of the first application are displayed: In response to the first operation, at least one layout template icon is displayed, the at least one layout template icon including the icon of a first layout template and the icon of a second layout template, the first layout template icon including the icon of a horizontal sub-region, the second layout template icon not including the icon of a horizontal sub-region, the number of sub-region icons included in the first layout template icon being a third value, the number of sub-region icons included in the second layout template icon being a fourth value, the third value and the fourth value being less than or equal to the first value, and the third value and the fourth value being integers greater than or equal to 3; When a second operation of selecting the first layout template is detected, in response to the second operation, a second interface is displayed. The second interface includes a first display area, a second window of the first application, and a second window of the second application. The second window of the first application is a horizontal window. The second application is one of the second value of applications. The second application is different from the first application. The first display area includes the identifiers of at least two applications. The at least two applications are applications other than the first application and the second application among the second value of applications. When a third operation of selecting the second layout template is detected, in response to the third operation, a third interface is displayed. The third interface includes a second display area, a second window of a third application, and a second window of a fourth application. The second windows of the third and fourth applications are vertical windows. The third application is one of the second value of applications, and the fourth application is one of the second value of applications. Both the third and fourth applications are different from the first application. The second display area includes the identifiers of at least two applications. The at least two applications are applications other than the third and fourth applications in the second value of applications, and the at least two applications include the first application.

2. The method according to claim 1, characterized in that, The third value and the fourth value are 3. The icons of the first layout template include icons of the first vertical sub-region, the first horizontal sub-region, and the second horizontal sub-region. The icons of the second layout template include icons of the second vertical sub-region, the third vertical sub-region, and the fourth vertical sub-region. The second interface includes the first vertical sub-area and the first horizontal sub-area. The second window of the second application is displayed in the first vertical sub-area. The second window of the second application is a vertical window. The second window of the first application is displayed in the first horizontal sub-area. The icon of the first vertical sub-area corresponds to the first vertical sub-area. The icon of the first horizontal sub-area corresponds to the first horizontal sub-area. The icon of the second horizontal sub-area corresponds to the first display area. The third interface includes the second vertical sub-region and the third vertical sub-region. The second window of the third application is displayed in the second vertical sub-region, and the second window of the fourth application is displayed in the third vertical sub-region. Both the second window of the third application and the second window of the fourth application are vertical windows. The second and third vertical sub-regions do not overlap. The icon of the second vertical sub-region corresponds to the second vertical sub-region, the icon of the third vertical sub-region corresponds to the third vertical sub-region, and the icon of the fourth vertical sub-region corresponds to the second display area.

3. The method according to claim 2, characterized in that, The icon of the second vertical sub-region is displayed to the left of the icon of the third vertical sub-region, the icon of the third vertical sub-region is displayed to the left of the icon of the fourth vertical sub-region, the second vertical sub-region is displayed to the left of the third vertical sub-region, and the third vertical sub-region is displayed to the left of the second display area.

4. The method according to claim 3, characterized in that, The second application and the third application are the same application, and the method further includes: Before displaying the first interface, a fourth interface is displayed, the fourth interface including a fifth window, the fifth value being 2 smaller than the first value; After the fourth interface is displayed, in response to an operation on the icon of the fourth application, the fifth interface is displayed, the fifth interface including the fifth window and the second window of the fourth application; The display of the first interface specifically means that, when the fifth interface is displayed, the first interface is displayed in response to an operation performed on the icon of the second application.

5. The method according to claim 3, characterized in that, The first window includes the first window of the fourth application and the first window of the second application, wherein the second application and the third application are the same application, and the method further includes: After displaying the first interface and before responding to the first operation, the method further includes: A fourth operation is detected acting on the first window of the fourth application, the first window of the fourth application being displayed in response to an operation acting on the icon of the fourth application; After the fourth operation is detected, a fifth operation is detected that acts on the first window of the second application, the first window of the second application being displayed in response to an operation that acts on the icon of the second application; After the fourth operation is detected, and before responding to the first operation, no operation on the first value window is detected except for the fifth operation.

6. The method according to claim 3, characterized in that, The first window includes the first window of the fourth application and the first window of the second application, wherein the second application and the third application are the same application, and the method further includes: Before displaying the first interface, a fourth interface is displayed, the fourth interface including a fifth window, the fifth value being 1 less than the first value; The display of the first interface specifically refers to: displaying the first interface in response to an operation performed on the icon of the fourth application; After displaying the first interface and before responding to the first operation, the method further includes: A fourth operation was detected acting on the first window of the second application, the first window of the second application being displayed in response to an operation acting on the icon of the second application; after the fourth operation was detected, no operation on the first window was detected before responding to the first operation.

7. The method according to claim 4, characterized in that, The second application and the third application are the same application, and the method further includes: After the fifth interface is displayed and before the first interface is displayed, a fourth operation is detected acting on the window of the fourth application. After the fourth operation is detected, no operation on the first value window is detected before responding to the first operation.

8. The method according to any one of claims 1-7, characterized in that, The method further includes: In response to the selection of a first identifier, the window of the application corresponding to the first identifier is displayed in the second horizontal sub-region. The first identifier is one of the identifiers of the at least two applications in the first display area, and the icon of the second horizontal sub-region corresponds to the second horizontal sub-region.

9. The method according to any one of claims 1-8, characterized in that, The method further includes: The sixth interface is displayed, which includes a seventh value of horizontal windows and an eighth value of vertical windows. The seventh value of horizontal windows and the eighth value of vertical windows correspond to a ninth value of applications. The ninth value is less than or equal to the sum of the seventh and eighth values. The seventh value is greater than or equal to 1, and the eighth value is greater than or equal to 2. When the sixth interface is displayed: In response to the sixth operation, an icon of at least one layout template is displayed, the icons of the at least one layout template including an icon of a third layout template, the icons of the third layout template including the number of icons of the tenth vertical sub-region, excluding the icons of the horizontal sub-region, the tenth value being less than the sum of the seventh and eighth values; When the eighth value is less than the eleventh value, in response to the operation of selecting the third layout template, a seventh interface is displayed. The seventh interface includes an eleventh value of vertical sub-regions and a third display area. The eleventh value is 1 less than the tenth value. The third display area includes the identifiers of at least two applications, which are applications in the ninth value of applications. Among the eleventh value of vertical sub-regions, the eighth value of vertical sub-regions displays vertical windows, and the twelfth value of vertical sub-regions displays horizontal windows. The sum of the twelfth value and the eighth value is the eleventh value. When the eighth value is greater than or equal to the eleventh value, in response to the operation of selecting the third layout template, a seventh interface is displayed. The seventh interface includes an eleventh value of vertical sub-regions and a third display area. The eleventh value is 1 less than the tenth value. The third display area includes the identifiers of at least two applications, which are applications in the ninth value of applications. Each of the eleventh value of vertical sub-regions displays a vertical window.

10. The method according to claims 1-9, characterized in that, The identifiers of the at least two applications include the identifier of a fifth application, which is a thumbnail of the window of the fifth application.

11. The method according to claims 1-10, characterized in that, The method further includes: The eighth interface is displayed, which includes a thirteenth horizontal window and a fourteenth vertical window. The thirteenth horizontal window and the fourteenth vertical window correspond to a fifteenth application. The sum of the thirteenth and fourteenth values ​​is greater than or equal to the fifteenth value. When the eighth interface is displayed: In response to the seventh operation, an icon of at least one layout template is displayed, the icon of the at least one layout template including an icon of a fourth layout template, the icon of the fourth layout template including an icon of the thirteenth horizontal sub-region and an icon of the fourteenth vertical sub-region; In response to the seventh operation of selecting the fourth layout template, a ninth interface is displayed. The ninth interface includes the thirteenth horizontal window and the fourteenth vertical window. The thirteenth horizontal window is displayed in the thirteenth horizontal sub-region, and the fourteenth vertical window is displayed in the fourteenth vertical sub-region. Each horizontal sub-region displays one horizontal window, and each vertical sub-region displays one vertical window.

12. The method according to claim 11, characterized in that, The method further includes: The tenth interface is displayed, which includes the first window of the sixth application and the first window of the seventh application. When the tenth interface is displayed: In response to the eighth operation, an icon of at least one layout template is displayed, the icon of the at least one layout template including an icon of a fifth layout template, the icon of the fifth layout template including an icon of a fifth vertical sub-region and an icon of a sixth vertical sub-region, the icon of the fifth layout template not including a horizontal sub-region; In response to the selection of the fifth layout template, an eleventh interface is displayed. The eleventh interface is a horizontal interface and includes a fifth vertical sub-area and a sixth vertical sub-area. The second window of the sixth application is displayed in the fifth vertical sub-area, and the second window of the seventh application is displayed in the sixth vertical sub-area. The icons of the fifth vertical sub-area correspond to the fifth vertical sub-area, and the icons of the sixth vertical sub-area correspond to the sixth vertical sub-area. In response to the ninth operation, the twelfth interface is displayed. The twelfth interface is a vertical interface and includes a third horizontal sub-region and a fourth horizontal sub-region. The third horizontal sub-region displays the third window of the sixth application, and the fourth horizontal sub-region displays the third window of the seventh application. The application interfaces displayed by the second window of the sixth application, the second window of the seventh application, the third window of the sixth application, and the third window of the seventh application are all horizontal interfaces. The content displayed by the first window of the sixth application, the second window of the sixth application, and the third window of the sixth application corresponds to the same interface of the sixth application. The content displayed by the first window of the seventh application, the second window of the seventh application, and the third window of the seventh application corresponds to the same interface of the seventh application.

13. The method according to claim 12, characterized in that, The ninth operation is the operation of rotating the electronic device, and the method further includes: After displaying the twelfth interface, in response to the tenth operation, the eleventh interface is displayed, wherein the tenth operation is the operation of rotating the electronic device; When the twelfth interface includes a first control, the tenth operation is an operation performed on the first control, or the tenth operation is an operation to rotate the electronic device.

14. The method according to claims 1-13, characterized in that, The method further includes: The thirteenth interface is displayed, and the number of application windows included in the thirteenth interface is the sixteenth value. The application windows correspond to the seventeenth value of applications, and the seventeenth value is less than or equal to the sixteenth value. When the thirteenth interface is displayed: In response to the eleventh operation, an icon of at least one layout template is displayed, the icon of the at least one layout template including an icon of the sixth layout template, the icon of the sixth layout template including an icon of the eighteenth sub-region, the eighteenth value being greater than the sixteenth value; When the selection of the sixth layout template is detected, the fourteenth interface is displayed. The fourteenth interface includes the sixteenth sub-region, and the sixteenth window is displayed in the sixteenth sub-region. Each sub-region displays one window, and the sixteenth sub-region corresponds to the icon of the sixteenth sub-region in the icon of the eighteenth sub-region.

15. The method according to claim 14, characterized in that, The method further includes: The fourteenth interface also includes a nineteenth display area, the sum of the nineteenth value and the sixteenth value is equal to the eighteenth value, the nineteenth display area is displayed in the nineteenth sub-area, the nineteenth sub-area corresponds to the icon of the nineteenth sub-area in the icon of the eighteenth sub-area, and the sub-area corresponding to the sixteenth window and the nineteenth display area are different; In response to the twelfth operation acting on the ninth application, the first window of the ninth application is displayed in the fourth display area of ​​the nineteenth display area, wherein the first window of the ninth application is not included in the sixteenth window of the fourteenth interface.

16. The method according to claims 1-15, characterized in that, The method further includes: The fifteenth interface is displayed, which includes a twentieth window. The fifteenth interface does not include a taskbar. In response to the operation of closing at least one window in the twentieth window, the taskbar is displayed. The display area of ​​the taskbar does not overlap with the display area of ​​the windows that have not been closed in the twentieth window. The taskbar includes application icons for multiple applications.

17. The method according to claims 1-16, characterized in that, The method further includes: The first interface, the fourth interface, the fifth interface, the sixth interface, the seventh interface, the eighth interface, the tenth interface, the thirteenth interface, and the fourteenth interface also include the taskbar; The ninth, eleventh, and twelfth interfaces do not include the taskbar; Before responding to the operation of selecting the first identifier, the second interface and the third interface also include the taskbar; In response to the operation of selecting the first identifier, the second interface and the third interface do not include the taskbar.

18. The method according to any one of claims 1-17, characterized in that, The types of applications include landscape applications, portrait applications, and compatible applications. A landscape application is an application that displays a landscape window in response to an operation on the application icon of the landscape application. A portrait application is an application that displays a portrait window in response to an operation on the application icon of the portrait application. A compatible application is an application that displays a portrait window in response to an operation on the application icon of the compatible application.

19. The method according to claim 18, characterized in that, The response to the second operation, displaying the second interface, specifically includes: In response to the second operation, a first parameter is obtained. The first parameter includes the number of currently open windows and the window ID, the application type parameter of the application corresponding to the window, and the focus window queue. The currently open windows include the first value number of windows and the first window of the first application. The application corresponding to the window is the second value number of applications. The focus window queue is the order in which the currently open windows are determined to be focus windows. Based on the first parameter, determine the windows displayed in the M sub-regions of the first layout template to obtain the first window layout; The second interface is displayed according to the first window layout.

20. The method according to claim 19, characterized in that, The step of determining the windows displayed in the M sub-regions of the first layout template based on the first parameter to obtain the first window layout is as follows: Based on the number of currently open windows in the first parameter as the twenty-first value, and based on the number of icons in the sub-regions included in the first layout template as the third value, it is determined that the number of currently open windows is greater than the number of icons in the sub-regions included in the first layout template. The twenty-first value of windows is the first value of windows included in the first interface and the first window of the first application. The twenty-first value is 1 greater than the first value. If the number of currently open windows is greater than the number of icons in the sub-regions included in the first layout template, the value of M is determined, and the value of M is 1 less than the third value; The first window layout is obtained by determining M windows from the twenty-one windows as the windows displayed in the M sub-regions.

21. The method according to claim 20, characterized in that, The step of determining M windows out of the twenty-one windows as the windows for displaying the M sub-regions to obtain the first window layout is as follows: Based on the application type parameter of the application corresponding to the 21st value window in the first parameter and the focus window queue, the first order of the 21st value window is determined; Based on the first order, determine the windows displayed in the M sub-regions of the first layout template to obtain the first window layout.

22. The method according to claim 21, characterized in that, The step of determining the first order of the 21st number of windows based on the application type parameter of the application corresponding to the 21st number of windows in the first parameter and the focus window queue is specifically as follows: The twenty-first window is arranged in the order of horizontal application window, vertical application window, and compatible application window, with the horizontal application window placed in front of the vertical application window and the vertical application window placed in front of the compatible application window. If at least two windows correspond to the same application type, the at least two windows are arranged in the focus window queue in the order from the most recently identified as focus to the earliest identified as focus.

23. The method according to claim 22, characterized in that, The horizontal and vertical attributes of a horizontal application are the same as and compatible with the horizontal and vertical attributes of its sub-regions. The horizontal and vertical attributes of a horizontal application are different from and incompatible with the horizontal and vertical attributes of its sub-regions. The horizontal and vertical attributes of a vertical application are the same as and compatible with the horizontal and vertical attributes of its sub-regions. The horizontal and vertical attributes of a vertical application are different from and incompatible with the horizontal and vertical attributes of its sub-regions. The horizontal and vertical attributes of a compatible application are different from and compatible with the horizontal and vertical attributes of its sub-regions. The horizontal and vertical attributes of a horizontal application are different from and compatible with the horizontal and vertical attributes of its sub-regions.

24. The method according to claim 23, characterized in that, The step of determining the windows displayed in the M sub-regions of the first layout template according to the first order to obtain the first window layout is as follows: Read any one of the M sub-regions, determine the window displayed in the currently read sub-region according to the first rule, and obtain the matched window sub-region. The first rule includes: reading the 21st window in the first order from the beginning, and determining the first unmatched window whose horizontal and vertical attributes match the horizontal and vertical attributes of the currently read sub-region as the window that matches the currently read sub-region. The unmatched window is the window that does not match the sub-region. The window to be displayed in the unmatched window sub-region is determined according to the second rule, which includes: reading any one sub-region in the unmatched window sub-region, reading the 21st window in the first order from the beginning, and determining the first unmatched window read as the window that matches the currently read sub-region. The unmatched window sub-region is the sub-region in the M sub-regions other than the matched window sub-region.

25. The method according to claim 24, characterized in that, The first application is a landscape application, the second application and the fourth application are both portrait applications or both are compatible applications, the applications corresponding to the seventh value of landscape windows are all landscape applications, and the applications corresponding to the eighth value of portrait windows are all portrait applications or both are compatible applications.

26. The method according to claim 25, characterized in that, The method further includes: In response to the first operation, the corresponding template configuration file is obtained according to the horizontal and vertical attributes of the current display interface. The template configuration file includes the styles of the at least two layout templates. The styles include the number of sub-regions included in each of the at least two layout templates, the aspect ratio of each sub-region, and the relative positional relationship. Based on the template configuration file, display the icons of the at least two layout templates.

27. An electronic device, characterized in that, The device includes a memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-26.

28. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the device control method as described in any one of claims 1-26.

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