Window layout control method and device

By detecting and adapting the display ratio of page changes in the target application, adaptively adjusting the window size and position, the problem of displaying cropping and black edges in window mode is solved, and the user experience and display effect is improved.

CN120233973APending Publication Date: 2025-07-01BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311847182.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The window mode of existing electronic devices often shows cropping or black edges under some pages in the application, resulting in poor display effect.

Method used

By detecting the display page of the target application switches from the first page to the second page, and determining the target display ratio in the display ratio supported by the second page, determining the size and position of the second window based on the size and position of the first window, realizing the adaptive layout display of the second window.

Benefits of technology

Adaptive matching of window layout is achieved, the impact of window relay layout is reduced, the layout effect and user experience is improved, and the problems of display cropping and black edges are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120233973A_ABST
    Figure CN120233973A_ABST
Patent Text Reader

Abstract

The invention provides a window layout control method and device, and the method comprises the steps: determining a target display scale of a second page in response to the detection that a first page is switched to the second page and the display scale supported by the second page is different from that of the first page under the condition of windowed display of a target application, and determining a second size and a second position of the second window based on the first size, the first position and the target display scale of the first window, performing layout display on the second window based on the second size and the second position, and displaying a second page in the second window. In the embodiment of the invention, the adaptive matching of the window layout is realized based on the page change in the application, the adaptive adjustment of the page-level window layout can be realized, and the adjusted window size and position are determined based on the original window size and position, so that the influence caused by window relayout is reduced, and the layout effect and the user experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of electronic devices, and particularly to a method and apparatus for controlling window layout. Background Art

[0002] Nowadays, electronic devices are developing towards large screens. To optimize the usage experience under large screens, major manufacturers have developed window modes, that is, application programs are displayed on the screen in the form of floating windows. However, currently, in some pages within the application of the electronic device's window mode, problems such as display cropping or black borders often occur, resulting in poor display effects. Summary of the Invention

[0003] To optimize the display effect in the window mode of an electronic device, embodiments of the present disclosure provide a method and apparatus for controlling window layout, an electronic device, and a storage medium.

[0004] In a first aspect, embodiments of the present disclosure provide a method for controlling window layout, including:

[0005] When the target application is displayed in windowed mode, in response to detecting that the display page of the target application switches from a first page to a second page, and the display ratio supported by the second page is different from that of the first page, determine a target display ratio among at least one display ratio supported by the second page;

[0006] Based on the first size, first position of the first window when displaying the first page, and the target display ratio, determine the second size and second position of the second window when displaying the second page;

[0007] Based on the second size and second position of the second window, layout and display the second window, and display the second page in the second window.

[0008] In some embodiments, the process of detecting the display ratios supported by each page of the target application includes:

[0009] Obtain the page type of the page. In response to the page type being a full-screen page, determine the display ratio supported by the page based on the display direction of the page;

[0010] And / or,

[0011] Obtain the display direction requested by the target application for the page, and determine, from a pre-set display ratio library, the display ratio that is the same as the display direction as the display ratio supported by the page; the display direction includes a landscape display direction and a portrait display direction.

[0012] In some embodiments, determining a target display ratio among at least one display ratio supported by the second page includes:

[0013] Obtaining a first display ratio of the first page currently;

[0014] Among at least one display ratio supported by the second page, determining a display ratio close to the first display ratio as the target display ratio.

[0015] In some embodiments, the first dimension includes a first diagonal length of the first window, the first position includes first center point coordinates of the first window, the second dimension includes a width and a height of the second window, and the second position includes second center point coordinates of the second window;

[0016] Determining a second dimension and a second position of the second window when displaying the second page based on the first dimension, the first position of the first window when displaying the first page, and the target display ratio includes:

[0017] Obtaining the first diagonal length and the first center point coordinates of the first window;

[0018] Based on the first diagonal length and the target display ratio, determining the width and the height of the second window;

[0019] Based on the first center point coordinates and the width and the height of the second window, determining the second center point coordinates of the second window.

[0020] In some embodiments, determining the width and the height of the second window based on the first diagonal length and the target display ratio includes:

[0021] Based on the first diagonal length and the target display ratio, determining a candidate width and a candidate height of the second window;

[0022] In response to the candidate width not exceeding the maximum display width of the display screen and the candidate height not exceeding the maximum display height of the display screen, determining the candidate width and the candidate height as the width and the height of the second window;

[0023] In response to the candidate width exceeding the maximum display width of the display screen and / or the candidate height exceeding the maximum display height of the display screen, performing an equal proportion scaling on the candidate width and the candidate height based on the maximum display width and the maximum display height to obtain the width and the height of the second window.

[0024] In some embodiments, determining the second center point coordinates of the second window based on the first center point coordinates and the width and height of the second window includes:

[0025] Determining the corner point coordinates of the second window based on the first center point coordinates and the width and height of the second window;

[0026] In response to all corner point coordinates being within the display screen edge, determining the first center point coordinates as the second center point coordinates of the second window;

[0027] In response to any one of the corner point coordinates exceeding the display screen edge, determining the offset coordinates of the second window based on the corner point coordinate that exceeds the display screen edge, and determining the second center point coordinates of the second window based on the first center point coordinates and the offset coordinates.

[0028] In some embodiments, laying out and displaying the second window based on the second size and second position of the second window, and displaying the second page in the second window includes:

[0029] Taking a screenshot of the first page and displaying the screenshot on top of the first window;

[0030] Based on the second size and second position of the second window, laying out and displaying the second window under the screenshot, and displaying the second page in the second window.

[0031] In a second aspect, an embodiment of the present disclosure provides a window layout control device, including:

[0032] A ratio determination module, configured to, in the case of windowed display of a target application, in response to detecting that the display page of the target application switches from a first page to a second page, and the display ratio supported by the second page is different from the first page, determine a target display ratio among at least one display ratio supported by the second page;

[0033] A window determination module, configured to determine the second size and second position of the second window for displaying the second page based on the first size, first position of the first window when displaying the first page, and the target display ratio;

[0034] A window layout module, configured to layout and display the second window based on the second size and second position of the second window, and display the second page in the second window.

[0035] In some embodiments, the ratio determination module is configured to:

[0036] Obtain the page type of the page, and in response to the page type being a full-screen page, determine the display ratio supported by the page based on the display orientation of the page;

[0037] and / or,

[0038] Obtain the display orientation requested by the target application for the page, and determine the display ratio that is the same as the display orientation from a pre-set display ratio library as the display ratio supported by the page; the display orientation includes a landscape display orientation and a portrait display orientation.

[0039] In some embodiments, the ratio determination module is configured to:

[0040] Obtain the current first display ratio of the first page;

[0041] Among at least one display ratio supported by the second page, determine the display ratio that is close to the first display ratio as the target display ratio.

[0042] In some embodiments, the first dimension includes the first diagonal length of the first window, the first position includes the first center point coordinates of the first window, the second dimension includes the width and height of the second window, and the second position includes the second center point coordinates of the second window; the window determination module is configured to:

[0043] Obtain the first diagonal length and the first center point coordinates of the first window;

[0044] Based on the first diagonal length and the target display ratio, determine the width and height of the second window;

[0045] Based on the first center point coordinates and the width and height of the second window, determine the second center point coordinates of the second window.

[0046] In some embodiments, the window determination module is configured to:

[0047] Based on the first diagonal length and the target display ratio, determine the candidate width and candidate height of the second window;

[0048] In response to the candidate width not exceeding the maximum display width of the display screen and the candidate height not exceeding the maximum display height of the display screen, determine the candidate width and the candidate height as the width and height of the second window;

[0049] In response to the candidate width exceeding the maximum display width of the display screen, and / or the candidate height exceeding the maximum display height of the display screen, scale the candidate width and the candidate height proportionally based on the maximum display width and the maximum display height to obtain the width and height of the second window.

[0050] In some embodiments, the window determination module is configured to:

[0051] Determine the corner coordinates of the second window based on the first center point coordinates and the width and height of the second window;

[0052] In response to all corner coordinates being within the display screen edge, determine the first center point coordinates as the second center point coordinates of the second window;

[0053] In response to any one of the corner coordinates exceeding the display screen edge, determine the offset coordinates of the second window based on the corner coordinates exceeding the display screen edge, and determine the second center point coordinates of the second window based on the first center point coordinates and the offset coordinates.

[0054] In some embodiments, the window layout module is configured to:

[0055] Take a screenshot of the first page and display the screenshot above the first window;

[0056] Based on the second size and second position of the second window, layout and display the second window below the screenshot, and display the second page in the second window.

[0057] In a third aspect, embodiments of the present disclosure provide an electronic device, including:

[0058] A processor; and

[0059] A memory storing computer instructions for causing the processor to execute the method according to any embodiment of the first aspect.

[0060] In a fourth aspect, embodiments of the present disclosure provide a storage medium storing computer instructions for causing a computer to execute the method according to any embodiment of the first aspect.

[0061] The window layout control method according to the embodiments of the present disclosure includes, when a target application is displayed in a windowed manner, in response to detecting a switch from a first page to a second page, and the display ratio supported by the second page is different from that of the first page, determining the target display ratio of the second page, determining the second size and the second position of a second window based on the first size, the first position of a first window, and the target display ratio, laying out and displaying the second window based on the second size and the second position, and displaying the second page in the second window. In the embodiments of the present disclosure, an adaptive matching of the window layout is achieved based on the page change within the application, which can realize an adaptive adjustment of the window layout at the page level, and determine the adjusted window size and position based on the original window size and position, reducing the impact brought by the window relayout, and improving the layout effect and user experience. Description of the Drawings

[0062] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following will briefly introduce the drawings required to be used in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0063] Figure 1 It is a schematic diagram of an application in windowed mode in the related art.

[0064] Figure 2 It is a schematic diagram of an application in windowed mode in the related art.

[0065] Figure 3 It is a schematic diagram of an application in windowed mode in the related art.

[0066] Figure 4 It is a flowchart of the window layout control method in some embodiments of the present disclosure.

[0067] Figure 5 It is a flowchart of the window layout control method in some embodiments of the present disclosure.

[0068] Figure 6 It is a flowchart of the window layout control method in some embodiments of the present disclosure.

[0069] Figure 7 It is a flowchart of the window layout control method in some embodiments of the present disclosure.

[0070] Figure 8 It is a flowchart of the window layout control method in some embodiments of the present disclosure.

[0071] Figure 9 It is a schematic diagram of the principle of the window layout control method in some embodiments of the present disclosure.

[0072] Figure 10 It is a schematic diagram of the principle of the window layout control method in some embodiments of the present disclosure.

[0073] Figure 11 It is a flowchart of the window layout control method in some embodiments of the present disclosure.

[0074] Figure 12 It is a schematic diagram of the principle of the window layout control method in some embodiments of the present disclosure.

[0075] Figure 13 It is a flowchart of the window layout control method in some embodiments of the present disclosure.

[0076] Figure 14 It is a schematic diagram of the principle of the window layout control method in some embodiments of the present disclosure.

[0077] Figure 15 It is a schematic diagram of the principle of the window layout control method in some embodiments of the present disclosure.

[0078] Figure 16 It is a flowchart of the window layout control method in some embodiments of the present disclosure.

[0079] Figure 17 It is a structural block diagram of the window layout control device in some embodiments of the present disclosure.

[0080] Figure 18 It is a structural block diagram of the electronic device in some embodiments of the present disclosure. Specific embodiments

[0081] Next, the technical solutions of the present disclosure will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts shall fall within the protection scope of the present disclosure. In addition, the technical features involved in different embodiments of the present disclosure described below can be combined with each other as long as they do not conflict with each other.

[0082] With the rise of concepts such as full-screen and foldable screens, electronic devices are gradually developing towards large screens. For example, mobile terminals such as smart phones and tablet computers, and the increase in the display screen brings a better interaction experience and visual feeling to users.

[0083] However, with the increase in the display screen, it also brings inconvenience to the touch operations of users. Therefore, in order to optimize the operation experience under a large screen, major device manufacturers have developed a window mode, that is, the application program is displayed on the screen in the form of a floating window.

[0084] For exampleFigure 1 In the example, an application (App) can be displayed on the screen of the electronic device 10 in the form of a small window 20. At the same time, the user can drag the hot area of ​​the window 20 to adjust the position and display ratio of the window 20.

[0085] In the related art, a variety of display ratios are generally provided for the window 20, such as 10:16, 9:16, 3:4, 5:7 and other vertical screen ratios, and 16:9, 16:10, 4:3, 7:5 and other horizontal screen ratios. Figure 1 As shown, the user can manually drag the hot spots at the lower left and right corners of the window 20 to arbitrarily adjust the size of the window 20. After the user selects the window size, the system selects the closest display ratio to rearrange and display the window ratio.

[0086] For example Figure 2 In this example, when the application is displayed in window 20, see Figure 2 As shown in (a), the user can manually adjust the size of the window 20 by dragging the hot zone in the lower right corner. After the user finishes dragging, the system selects a display ratio closest to the user dragged size to readjust the ratio of the window 20.

[0087] The above window layout process requires users to manually drag the window, and it is only an application-level window layout. When switching pages within the application, the display ratio of the window does not change, resulting in the display ratio of some pages within the application not being correctly adapted, resulting in display cropping or black edge problems.

[0088] Combination Figure 2 As shown, after the user manually adjusts the display ratio of window 20, all pages in window 20 need to be displayed according to the display ratio. However, in actual scenarios, when switching between different pages in the application, the display ratios supported by the pages are not exactly the same, resulting in display problems for some pages that are not compatible with the display ratio.

[0089] For example, Figure 3 For example, when the video app is displayed in window mode, Figure 3 In the example (a) of the figure, the user does not play the video in full screen. At this time, the display ratio of the page and the window are adapted, and the current page can be displayed correctly. However, when the user clicks "" to enter the full screen video playback page, the window display ratio does not match the full screen ratio, so the full screen playback page can only be displayed as follows: Figure 3 As shown in (b), the video image is displayed in the center of the window, and the upper and lower parts of the video are black edges (or white edges).

[0090] For another example, when a certain application is displayed in window mode, page A of the application supports portrait display, so it can be correctly displayed at, for example, the window ratio shown in Figure 1 the example. However, page B only supports landscape display. Therefore, when switching from page A to page B, either page B can only be cropped, resulting in incomplete display of the content of page B, or it can only be scaled proportionally as shown in Figure 3 (b) in, generating a large amount of black edges (or white edges).

[0091] It can be seen that the window mode in the related art cannot achieve window adaptive layout at the page level, resulting in incorrect window ratios when some pages are switched in window mode, poor display effects in window mode, and reduced user experience.

[0092] Based on the above defects in the related art, the embodiments of the present disclosure provide a window layout control method, device, electronic device, and storage medium, aiming to optimize the display effect of the window mode, achieve window adaptive layout at the page level, and improve user experience.

[0093] The electronic device in the embodiments of the present disclosure can be any suitable device type, such as a smart phone, a tablet computer, a handheld computer, a smart conference large screen, etc. The present disclosure does not limit this. In these electronic devices, an application can be partially displayed on the display screen in the form of a floating window.

[0094] For ease of explanation, in the following embodiments of the present disclosure, a tablet computer is taken as an example of the electronic device. A tablet computer generally has two usage modes: landscape and portrait. Manufacturers will also perform software optimization for landscape display and portrait display. Therefore, in window mode, the display ratio of the window generally includes a landscape display ratio and a portrait display ratio.

[0095] As shown in Figure 4 , in some embodiments, the window layout control method exemplified in the present disclosure includes:

[0096] S410. When the target application is displayed in window mode, in response to detecting that the display page of the target application switches from the first page to the second page, and the display ratio supported by the second page is different from that of the first page, determine a target display ratio among at least one display ratio supported by the second page.

[0097] In the embodiments of the present disclosure, as can be seen from the foregoing, when a certain application is displayed in window mode, not all pages in the application support the display ratio of the current window. Therefore, when switching from page A to page B, if page B does not support the display ratio of the current window, it is necessary to adaptively adjust the window layout and re-layout the window to correctly display page B.

[0098] Since the embodiments of the present disclosure involve page switching within an application and the resulting changes in window layouts, for the sake of convenience in description, the old page before the switch is defined as the first page, and the new page after the switch is defined as the second page. At the same time, the old window before the window layout change is defined as the first window, and the window after the window layout change is defined as the second window. That is, when the page within the application switches from the first page to the second page, the window layout may need to be adjusted from the first window to the second window.

[0099] In some embodiments, the target application may refer to any application program that can be windowed and displayed in an electronic device system, and there is no limitation on the specific application type.

[0100] In the case of windowed display of a certain target application, when the target application switches from the first page to the second page, it is necessary to determine whether the display ratio supported by the second page is the same as that supported by the first page.

[0101] If the display ratio supported by the second page is different from that of the first page, then assuming that the second page is still displayed according to the first window layout when displaying the first page, the second page cannot be correctly displayed, and problems such as picture content cropping or black borders may very likely occur. For example, the first page supports a portrait 3:4 display ratio, so the first window correctly displays the first page according to the portrait 3:4 display ratio. However, the second page only supports a landscape 4:3 display ratio. If the portrait 3:4 display ratio of the first window is still used to display the second page, it cannot be correctly displayed.

[0102] Thus, in this case, the embodiments of the present disclosure need to first determine the target display ratio for displaying the second page. It can be understood that the display ratio supported by the second page may include one or more. In the case where the second page includes only one display ratio, this display ratio can be directly determined as the target display ratio. In the case where the second page includes multiple display ratios at the same time, the display ratio closest to the display ratio of the first window can be selected from the multiple display ratios as the target display ratio. The following embodiments of the present disclosure will explain this.

[0103] In the embodiments of the present disclosure, it is first necessary to detect the display ratios supported by each page within the target application, and then determine whether the display ratios supported by the first page and the second page are the same.

[0104] In some embodiments, the display ratio supported by a page can be determined by detecting the page type. For example, for some pages such as games and full-screen videos, they only support the full-screen ratio. Thus, if a certain page is detected as a page type such as a game or a full-screen video, it can be determined that the display ratio supported by this page is the full-screen display ratio.

[0105] In some other embodiments, when the detection system generates the (Activity) activity component corresponding to the page, the page display direction requested from the underlying layer is the display direction supported by the page. Then, based on the display ratio in the same pre-set display direction, the display ratio supported by the page is determined.

[0106] The process of determining the display ratio supported by the page will be described in the following embodiments of the present disclosure and will not be elaborated here for the time being.

[0107] After determining the display ratio supported by the first page and the display ratio supported by the second page, it can be determined whether the display ratios supported by the first page and the second page are the same. If they are different, it means that the layout of the first window currently being displayed needs to be adjusted again, so that the target display ratio corresponding to the second page can be determined.

[0108] S420. Based on the first size, first position of the first window when the first page is displayed, and the target display ratio, determine the second size and second position of the second window when the second page is displayed.

[0109] It can be understood that when the display ratio supported by the second page is different from that of the first page, it means that the first window for displaying the first page needs to be re-layout to be a second window suitable for displaying the second page. The target display ratio of the second window has been determined, and it is also necessary to further determine the size and position of the second window.

[0110] It is worth noting that when the first window is re-layout to the second window, if the display area difference between the first window and the second window is large, or the position offset degree is large, it will bring the user a visual feeling of sudden change of the display window, resulting in a poor user experience. For example, if the display area of the first window is very large and the display area of the second window suddenly becomes very small, or the first window is located on the left side of the screen and the position of the second window suddenly changes to the right side of the screen, then even if the second window can display the second page at the correct display ratio, it will still lead to a poor user experience and reduce the user experience.

[0111] Therefore, in the embodiments of the present disclosure, in order to minimize the sensory changes brought to the user by the window re-layout, when re-layouting the second window for display, generally follow the following principles: First, the display size of the second window should be as close as possible to that of the first window; second, the display position of the second window should be as consistent as possible with that of the second window.

[0112] Therefore, in the embodiments of the present disclosure, when determining the target display ratio of the second window, it is necessary to determine the second size of the second window in combination with the first size of the first window, and at the same time determine the second position of the second window based on the first position of the first window. For the process of calculating the second size and the second position of the second window, the following embodiments of the present disclosure will be described.

[0113] S430. Layout and display the second window based on the second size and the second position of the second window, and display the second page in the second window.

[0114] In the embodiments of the present disclosure, after determining the second size and the second position of the second window through the above process, the second window can be displayed on the display screen of the electronic device, and the second page can be displayed in the second window.

[0115] It can be understood that since the display ratio of the second window is re-layout according to the target display ratio supported by the second page, when the second page is displayed in the second window, the second page can be displayed according to the correct display ratio, realizing the adaptive matching of the window layout following the page change.

[0116] In addition, since the size and position of the second window are determined based on the size and position of the first window, the size and position of the second window are close to those of the first window. Therefore, when the window is re-layout, the influence of the window change can be reduced as much as possible, improving the user experience.

[0117] As can be seen from the above, in the embodiments of the present disclosure, based on the page change within the application, the adaptive matching of the window layout can be realized, the window layout at the page level can be adjusted adaptively, and the size and position of the adjusted window are determined based on the original window size and position, reducing the influence brought by the window re-layout, and improving the layout effect and the user experience.

[0118] Combined with the foregoing, in the embodiments of the present disclosure, when it is necessary to detect the page change in the target application, it is necessary to check whether the display ratios supported by the first page and the second page are the same. Therefore, in some embodiments, it is necessary to detect the display ratio supported by each page. Two alternative implementation methods are given below.

[0119] As Figure 5 shown, in some embodiments, in the window layout control method exemplified by the present disclosure, the process of detecting the page display ratio includes:

[0120] S510. Obtain the page type of the page.

[0121] S520. In response to the page type being a full-screen page, determine the display ratio supported by the page based on the page display direction.

[0122] In some embodiments, for certain pages within a target application, they only support full-screen ratios, and these pages that only support full-screen ratios are full-screen pages.

[0123] For example, for some mobile games, they only support full-screen display and cannot adjust the display ratio. In other words, they only support one display ratio, which is the full-screen ratio. Another example is a full-screen video page, which also only supports the full-screen ratio. Still another example is in some applications, for the signature page where users write signatures by hand, it also only supports the full-screen ratio.

[0124] Therefore, in the embodiments of the present disclosure, the page type of these pages that only support full-screen ratios can be set to "full-screen page", and the page type of the pages other than these is "non-full-screen page". When the target application needs to switch to a certain page, the system can obtain the corresponding page type of this page. If the page type of this page is "full-screen page", it means that this page only supports the full-screen ratio.

[0125] However, as can be understood in combination with Figure 1 what is shown, an electronic device generally has two display modes, landscape and portrait. Therefore, generally, the full-screen ratio also includes the display ratios in two display directions, landscape and portrait.

[0126] Thus, in some embodiments of the present disclosure, when it is determined that the page type of a certain page is a full-screen page, it is possible to further detect whether the display direction of this page is the landscape display direction or the portrait display direction. After determining the display direction, based on the display direction and the full-screen ratio, the display ratio supported by this page can be determined. For example, in an example, the page type of a certain game page is a full-screen page, and the display direction is portrait, which thus indicates that the display ratio supported by this game page is the full-screen ratio in the portrait direction.

[0127] It should be noted that the full-screen ratio described in the present disclosure refers to the display ratio that is the same as the ratio of the display screen of the electronic device. For example, in an example, the landscape display ratio of the display screen of the electronic device is 4:3, and the portrait display ratio is 3:4. Then the full-screen ratios supported by the full-screen pages are landscape 4:3 and portrait 3:4. Those skilled in the art can understand this, and the present disclosure will not elaborate further.

[0128] As Figure 6 shown, in some embodiments, the process of the window layout control method exemplified in the present disclosure for detecting the page display ratio includes:

[0129] S610. Obtain the display direction requested by the target application for the page.

[0130] S620. Determine, from the pre-set display ratios, the display ratio that is the same as the display direction as the display ratio supported by the page.

[0131] It can be understood that the Activity is one of the four most basic and common components in Android. The Activity component is an application component that provides a display interface for user interaction. Each page of the target application corresponds to an Activity process. That is, for each page displayed, the system needs to create an Activity process.

[0132] When creating the Activity process corresponding to a certain page, it is necessary to request the display orientation required for this page from the underlying system. The display orientation includes landscape display orientation and portrait display orientation. For example, if a certain page is a portrait page, then when creating the Activity process corresponding to this page, it is necessary to request the display orientation as the portrait display orientation from the underlying system.

[0133] Therefore, in the embodiments of the present disclosure, the display orientation requested when creating the Activity process of the page can be obtained, and then based on the requested display orientation, the supported display orientation of this page can be determined.

[0134] In the embodiments of the present disclosure, multiple display ratios can be set in advance for different display orientations, so as to construct a display ratio library. For example, one or more display ratios can be set for the landscape display orientation, and one or more display ratios can be set for the portrait display orientation, thus obtaining the display ratio library.

[0135] For example, in one example, the display ratio library can be as shown in Table 1 below:

[0136] Table 1

[0137]

[0138] That is, in the landscape display orientation, there are multiple display ratios such as 4:3, 16:9, 16:10, etc., and in the portrait display orientation, there are multiple display ratios such as 3:4, 9:16, 10:16, etc.

[0139] In the embodiments of the present disclosure, based on the foregoing S610, determining the display orientation of a certain page may include the following three situations: 1) only supporting the landscape display orientation; 2) only supporting the portrait display orientation; 3) supporting both the landscape display orientation and the portrait display orientation.

[0140] After determining the display orientation corresponding to this page, the supported display ratio can be determined from the pre-set display ratio library based on this display orientation.

[0141] For example, in one example, the display orientation of a certain page is the landscape display orientation. Thus, in combination with the display ratio library shown in Table 1, each display ratio included in the landscape display orientation in the display ratio library is determined as the display ratio supported by this page.

[0142] For example, in another example, the display orientation of a certain page is the portrait display orientation. Thus, in combination with the display ratio library shown in Table 1, each display ratio included in the portrait display orientation in the display ratio library is determined as the display ratio supported by this page.

[0143] For example, in yet another example, the display orientation of a certain page supports both the landscape display orientation and the portrait display orientation. Thus, in combination with the display ratio library shown in Table 1, the display ratios included in the landscape display orientation and the portrait display orientation are determined as the display ratios supported by this page, that is, this page supports all display ratios.

[0144] Through Figure 5 and Figure 6 the implementation manners, when the target application is displayed in a windowed manner, the display ratios supported by each page of the target application can be detected. It should be noted that Figure 5 and Figure 6 the implementation manners can be implemented independently or in combination. For example, in the case of the combination of Figure 5 and Figure 6 the implementation manners, first, it can be determined whether this page is a full-screen page by using the Figure 5 implementation manner. If it is not a full-screen page, then the display ratios supported by this page are determined according to the method process of the Figure 6 implementation manner. Those skilled in the art can undoubtedly understand and fully implement this in combination with the foregoing, and the present disclosure will not elaborate on this.

[0145] In the implementation manner of the present disclosure, during the process of windowed display of the target application, when switching from the first page to the second page, the display ratios supported by the second page can be detected through the above method process, and then the display ratios supported by the second page are compared with those of the first page. The following will be described in combination with Figure 7 for illustration.

[0146] As Figure 7 shown, in some implementation manners, the window layout control method of the example of the present disclosure includes:

[0147] S710. Obtain the current first display ratio of the first page.

[0148] S720. Among at least one display ratio supported by the second page, determine the display ratio close to the first display ratio as the target display ratio.

[0149] In the embodiments of the present disclosure, when the target application switches from the first page to the second page, the display ratio supported by the second page can be detected through the foregoing method process, which will not be elaborated herein. At the same time, the display ratio when the first window currently displays the first page can be obtained, that is, the first display ratio.

[0150] If there is a display ratio in the display ratios supported by the second page that is the same as the first display ratio, it means that the display ratios of the second page and the first page are the same. Then, the first display ratio of the currently displayed first page can be directly maintained unchanged, and the switch to the second page can be directly made.

[0151] However, if the display ratio supported by the second page is different from the first display ratio, it means that the window layout needs to be re-performed, and then the target display ratio needs to be determined among the multiple display ratios supported by the second page.

[0152] Combined with the foregoing, the principle for determining the target display ratio of the second page is: as close as possible to the first display ratio of the currently displayed first page. Therefore, in some embodiments of the present disclosure, the display ratio closest to the first display ratio can be determined among at least one display ratio supported by the second page as the target display ratio.

[0153] For example, in an example, the first display ratio of the first window currently displaying the first page is portrait 3:4. Through the foregoing method process, the display ratios supported by the second page are determined to include landscape 4:3 and 5:3. Since 4:3 is closer to the first display ratio 3:4, 4:3 can be determined as the target display ratio of the second page.

[0154] As can be seen from the above, in the embodiments of the present disclosure, the display ratio closest to the first display ratio of the first page among the display ratios supported by the second page is determined as the target display ratio, so that the display ratio of the re-layouted second window is closer to that of the original first window, the window re-layout effect is more coordinated, and the window layout effect is improved.

[0155] In some embodiments, the first size of the first window includes the first diagonal length, the first position of the first window includes the first center point coordinates, the second size of the second window includes the width and height of the second window, and the second position of the second window includes the second center point coordinates.

[0156] As Figure 8 shown, in some embodiments, the process of determining the second size and the second position of the second window in the window layout control method of the present disclosure example includes:

[0157] S810. Obtain the first diagonal length and the first center point coordinates of the first window.

[0158] SeeFigure 9 As shown, in some embodiments, the first window 21 is as shown by the solid line frame in the figure, and the second window 22 is as shown by the dashed line frame in the figure.

[0159] First, the coordinates of at least two diagonal points of the first window 21 can be obtained. For example Figure 9 the coordinates of diagonal point B and diagonal point D of the first window 21 are shown. Then, according to the coordinates of diagonal point B and diagonal point D, the length l of the first diagonal BD can be calculated BD , that is, the length l of the first diagonal of the first window 21 BD .

[0160] Similarly, based on the coordinates of diagonal point B and diagonal point D, the coordinates of the center point C1 of the first window 21 can be calculated, that is, the first center point coordinate C1 described in the present disclosure.

[0161] S820. Determine the width and height of the second window based on the length of the first diagonal and the target display ratio.

[0162] Combined with the foregoing, it can be understood that in order to ensure that the change degree is as small as possible when the layout of the first window 21 changes to the second window 22, the size of the second window 22 should be as close as possible to that of the first window 21. Therefore, in some embodiments, the length l of the first diagonal of the first window 21 BD can be used as the length of the second diagonal of the second window 22.

[0163] According to the rectangle formula, it can be understood that given the aspect ratio and the diagonal length, the width and height of the rectangle can be calculated using the Pythagorean theorem. Therefore, in the embodiments of the present disclosure, combined with Figure 9 as shown, when the diagonal length and the target display ratio of the second window 22 are known, the width w and height h of the second window 22 can be calculated using the Pythagorean theorem. When the width w and height h of the second window 22 are determined, the size of the second window 22 can be determined.

[0164] However, it should be noted that the width w and height h of the second window 22 should satisfy the maximum size limit of the display screen of the electronic device, that is, the size of the second window 22 cannot exceed the maximum display size of the electronic device.

[0165] Therefore, in some embodiments, if the calculated width w of the second window 22 exceeds the maximum display width w max , or the height h exceeds the maximum display height h max , then the size of the second window 22 needs to be further scaled. The following embodiments of the present disclosure will illustrate this. In Figure 9In the example, since both the width w and height h of the second window 22 do not exceed the maximum size limit, scaling is not required.

[0166] S830. Determine the second center point coordinates of the first window based on the first center point coordinates and the width and height of the second window.

[0167] It can be understood that after determining the width w and height h of the second window 22 through the above method, the second size of the second window 22 has been determined, and the second position of the second window 22 also needs to be determined.

[0168] Combined with the foregoing, to ensure that the change degree is as small as possible when the layout of the first window 21 changes to the second window 22, the position of the second window 22 should be as close as possible to that of the first window 21. Therefore, in some embodiments, the first center point coordinates C1 of the first window 21 can be used as the second center point coordinates C2 of the second window 22.

[0169] However, it should be noted that when the first center point coordinates C1 of the first window 21 are used as the second center point coordinates C2 of the second window 22, one or more sides of the second window 22 may exceed the screen display range, that is, the second window 22 is located outside the screen display range. At this time, the second window 22 needs to be translated so that the second window 22 is entirely within the screen display range. The following embodiments of the present disclosure will illustrate this, and will not be elaborated here for the time being.

[0170] After determining the width w, height h, and second center point coordinates C2 of the second window 22, the second size and second position of the second window 22 are all known, and thus the second window 22 can be re-layout and displayed according to these parameters.

[0171] For example Figure 10 As shown, the re-layout second window 22 is shown by the solid line frame in the figure, and the original first window 21 is shown by the dashed line frame in the figure. In Figure 9 and Figure 10 the example, during the process of the first window 21 changing to the second window 22, the second window 22 does not scale or translate. Therefore, the second diagonal length l AC of the second window 22 is equal to the first diagonal length l BD of the first window 21, and the second center point coordinates C2 of the second window 22 are the same as the first center point coordinates C1 of the first window 21.

[0172] As described above, in the embodiments of the present disclosure, the size and position of the second window are determined based on the size and position of the first window, so that the size and position of the second window after re-layout are close to those of the original first window, reducing the impact caused by the window layout change and improving the window layout effect and user experience.

[0173] As Figure 11 shown, in some embodiments, for the window layout control method of the present disclosure example, the process of determining the width and height of the second window 22 includes:

[0174] S821. Determine the candidate width and candidate height of the second window based on the length of the first diagonal and the target display ratio.

[0175] In the embodiments of the present disclosure, as can be seen from the foregoing, after determining the length l of the first diagonal BD and the target display ratio, the width w and height h of the second window can be determined using the Pythagorean theorem. However, the width w and height h of the second window 22 may exceed the maximum size limit. Therefore, the calculated width w and height h are temporarily used as the candidate width w' and candidate height h'.

[0176] S822. In response to the candidate width not exceeding the maximum display width of the display screen and the candidate height not exceeding the maximum display height of the display screen, determine the candidate width and candidate height as the width and height of the second window.

[0177] It can be understood that for an electronic device, its display area has a maximum size limit, that is, there is a maximum display width limit in the horizontal direction and a maximum display height limit in the vertical direction. For example, taking the Figure 12 shown electronic device 10 as an example, the electronic device 10 has a maximum display width w in the horizontal direction max , and the width w of the second window 22 cannot exceed this limit. In the vertical direction, it has a maximum display height h max , and the height h of the second window 22 cannot exceed this limit.

[0178] It can be understood that after obtaining the candidate width w' and candidate height h' of the second window 22 through the foregoing calculation, the candidate width w' can be compared with the maximum display width w max . If w' ≤ w max , it means that the second window 22 does not exceed the limit of the maximum display width w in the width direction max . Similarly, the candidate height h' is compared with the maximum display height h max . If h' ≤ h max , it means that the second window 22 also does not exceed the limit of the maximum display width w in the height direction max .

[0179] In this case, the candidate width w' can be determined as the width w of the second window 22, and the candidate height h' can be determined as the height h of the second window 22. For example Figure 10 In the example, the candidate width w' does not exceed the maximum display width w max and the candidate height h' does not exceed the maximum display height h max Based on the candidate width w' and the candidate height h', they are determined as the width w and the height h of the second window 22.

[0180] S823. In response to the candidate width exceeding the maximum display width of the display screen and the candidate height exceeding the maximum display height of the display screen, based on the maximum display width, the maximum display height, and the target display ratio, the candidate width and the candidate height are scaled proportionally to obtain the width and the height of the second window.

[0181] Combined with Figure 12 As shown, the dashed box in the figure represents the window enclosed by the candidate height h' and the candidate width w'. In this example, the candidate width w' ≤ w max indicating that the second window 22 does not exceed the maximum display width w in the width direction max However, the candidate height h' > h max indicating that the second window 22 exceeds the maximum display height h in the height direction max of the limit.

[0182] In this case, the height h of the second window 22 can be limited to the maximum display height h max that is, set the height h = h max Then, the candidate width w' is scaled proportionally, that is, the width w of the second window = w' * (h max / h'), so as to calculate the width w and the height h of the second window 22. Figure 12 The solid box in is the size of the second window 22 after the scaling process.

[0183] Of course, those skilled in the art can understand that for the case where the candidate width w' exceeds the maximum display width w max and for the case where the candidate width w' exceeds the maximum display width w max and at the same time the candidate height h' exceeds the maximum display height h max the scaling principle is similar to Figure 12 and those skilled in the art can undoubtedly understand and fully implement it on this basis, and the present disclosure will not be elaborated further.

[0184] As described above, in the embodiments of the present disclosure, when the size of the second window exceeds the maximum size of the screen, the second window is scaled based on the maximum size of the screen, so that the second window is completely displayed within the screen display range, improving the window display effect and user experience.

[0185] As Figure 13 shown, in some embodiments, the process of determining the second center point coordinates of the second window in the window layout control method of the present disclosure example includes:

[0186] S831. Determine the corner point coordinates of the second window based on the first center point coordinates and the width and height of the second window.

[0187] As Figure 14 shown, the solid line frame in the figure is the first window 21. After calculating the width w and height h of the second window 22 through the foregoing method process, the first center point coordinates C1 of the first window 21 are temporarily used as the second center point coordinates of the second window 22, and then based on the first center point coordinates C1, the corner point coordinates of each corner point of the rectangular window can be calculated, that is, the corner point coordinates of a total of 4 corner points F1 to F4 in the figure.

[0188] S832. In response to all corner point coordinates being within the display screen edge, determine the first center point coordinates as the second center point coordinates of the second window.

[0189] Combined with Figure 9 and Figure 10 shown, each corner point coordinate of the second window 22 is within the display screen edge, that is, the second window 22 does not exceed the display range of the display screen. Therefore, the first center point coordinates C1 can be determined as the second center point coordinates C2 of the second window 22, and the second position of the second window 22 is determined according to the foregoing Figure 9 and Figure 10 embodiments, which will not be elaborated herein by the present disclosure.

[0190] S833. In response to any one corner point coordinate exceeding the display screen edge, determine the offset coordinates of the second window based on the corner point coordinate exceeding the display screen edge, and determine the second center point coordinates of the second window based on the first center point coordinates and the offset coordinates.

[0191] Combined with Figure 14 shown, after calculating the coordinates of the corner points F1 to F4 of the second window, it is determined that the coordinates of the corner points F1 and F4 exceed the left edge of the display screen, that is, the second window exceeds the display range of the display screen.

[0192] Thus, based on the coordinates of the corner point F1 (or F4), the offset coordinates of the second window are determined. The offset coordinates refer to the minimum offset amount for translating the second window into the display range of the display screen. For example Figure 14In the example, the offset coordinate is (xp, 0). After determining the offset coordinate (xp, 0), the first center point coordinate C1 can be translated according to the offset coordinate (xp, 0) to obtain the second center point coordinate C2. For example Figure 15 In the example, by translating the first center point coordinate C1 according to the offset coordinate (xp, 0), the second center point coordinate C2 can be obtained.

[0193] Continue to refer to Figure 15 As shown, after determining the width w, height h of the second window 22 and the second center point coordinate C2, the second size and the second position of the second window 22 can be determined.

[0194] Of course, those skilled in the art can understand that Figure 14 and Figure 15 only show that the second window 22 extends beyond one side edge of the display screen. For the case where the second window 22 extends beyond both the horizontal and vertical side edges of the display screen simultaneously, the principle is similar thereto, and those skilled in the art can undoubtedly understand and fully implement it on this basis, and the present disclosure will not elaborate further.

[0195] As can be seen from the above, in the embodiment of the present disclosure, when the position of the second window exceeds the screen display range, the second window is translated based on the corner point coordinates exceeding the display screen edge, so that the second window is completely displayed within the screen display range, improving the window display effect and user experience.

[0196] In the embodiment of the present disclosure, after determining the position and size of the second window, the window can be re - laid out. The following is combined with Figure 16 for illustration.

[0197] As Figure 16 shown, in some embodiments, the process of re - laying out and displaying the second window in the window layout control method of the present disclosure example includes:

[0198] S1610. Take a screenshot of the first page and display the screenshot on the upper layer of the first window.

[0199] S1620. Based on the second size and the second position of the second window, layout and display the second window on the lower layer of the screenshot, and display the second page in the second window.

[0200] In the embodiment of the present disclosure, after calculating the second position and the second size of the second window, the second window can be re - rendered and laid out.

[0201] It should be noted that if the second window is directly rendered and laid out while the first page is displayed in the first window, during this process, the content on the first page may be stretched, deformed, etc., resulting in a poor animation transition effect and affecting the user experience.

[0202] Therefore, in some embodiments of the present disclosure, before re-layouting the second window, first take a screenshot of the first page displayed in the first window and overlay the screenshot on the upper layer of the first window. In this way, during the subsequent window re-layouting process, the upper-layer screenshot can play a masking role, and problems such as content stretching and deformation will not occur in the animations observed by the user. Remove the upper-layer screenshot when the second window starts to be displayed.

[0203] In some embodiments, the system includes an Auto Resize module. The Auto Resize module is used to redraw and layout the window. Specifically, when generating the second window by re-layouting, first notify the Task module to perform the re-layouting operation, then apply the first-frame rendering after re-layouting based on the calculated position and size mentioned above, then send the first-frame rendering picture transaction to the system process, and then send the first-frame picture transaction to the Auto Resize module. The Auto Resize module executes the switching animation to complete the display of the second window on the display screen, and finally the application switches the display page to the second page.

[0204] Regarding the details not elaborated in the window re-layouting process, those skilled in the art can understand and fully implement them with reference to the related technologies, and the present disclosure will not elaborate on this.

[0205] As can be seen from the above, in the embodiments of the present disclosure, based on the page changes within the application, the adaptive matching of the window layout can be realized, the window layout at the page level can be adaptively adjusted, and the adjusted window size and position are determined based on the original window size and position, reducing the impact brought by the window re-layouting and improving the layout effect and user experience. Moreover, during the re-layouting process of the second window, a mask is formed by using the screenshot of the first page to improve the transition animation effect and user experience.

[0206] In some embodiments, the present disclosure provides a window layout control device, as Figure 17 shown. The device includes:

[0207] A ratio determination module 1, configured to, in the case of window-displaying a target application, in response to detecting that the display page of the target application switches from a first page to a second page, and the display ratio supported by the second page is different from that of the first page, determine a target display ratio among at least one display ratio supported by the second page;

[0208] A window determination module 2, configured to determine the second size and second position of the second window for displaying the second page based on the first size, first position of the first window when displaying the first page, and the target display ratio;

[0209] The window layout module 3 is configured to layout and display the second window based on the second size and the second position of the second window, and display the second page in the second window.

[0210] As can be seen from the above, in the embodiments of the present disclosure, the adaptive matching of the window layout is realized based on the page change within the application, the adaptive adjustment of the window layout at the page level can be realized, and the adjusted window size and position are determined based on the original window size and position, reducing the impact brought by the window relayout and improving the layout effect and user experience.

[0211] In some embodiments, the ratio determination module 1 is configured to:

[0212] Obtain the page type of the page, and in response to the page type being a full-screen page, determine the display ratio supported by the page based on the display direction of the page.

[0213] And / or,

[0214] Obtain the display direction requested by the target application for the page, and determine the display ratio identical to the display direction from a pre-set display ratio library as the display ratio supported by the page; the display direction includes a landscape display direction and a portrait display direction.

[0215] In some embodiments, the ratio determination module 1 is configured to:

[0216] Obtain the current first display ratio of the first page;

[0217] Among the at least one display ratio supported by the second page, determine the display ratio close to the first display ratio as the target display ratio.

[0218] In some embodiments, the first size includes the first diagonal length of the first window, the first position includes the first center point coordinates of the first window, the second size includes the width and height of the second window, and the second position includes the second center point coordinates of the second window; the window determination module 2 is configured to:

[0219] Obtain the first diagonal length and the first center point coordinates of the first window;

[0220] Based on the first diagonal length and the target display ratio, determine the width and height of the second window;

[0221] Based on the first center point coordinates and the width and height of the second window, determine the second center point coordinates of the second window.

[0222] In some embodiments, the window determination module 2 is configured to:

[0223] Determine a candidate width and a candidate height of the second window based on the first diagonal length and the target display ratio;

[0224] In response to the candidate width not exceeding the maximum display width of the display screen and the candidate height not exceeding the maximum display height of the display screen, determine the candidate width and the candidate height as the width and height of the second window;

[0225] In response to the candidate width exceeding the maximum display width of the display screen, and / or the candidate height exceeding the maximum display height of the display screen, perform an equal proportion scaling on the candidate width and the candidate height based on the maximum display width and the maximum display height to obtain the width and height of the second window.

[0226] In some embodiments, the window determination module 2 is configured to:

[0227] Determine the corner coordinates of the second window based on the first center point coordinates and the width and height of the second window;

[0228] In response to all the corner coordinates being within the display screen edge, determine the first center point coordinates as the second center point coordinates of the second window;

[0229] In response to any one of the corner coordinates exceeding the display screen edge, determine the offset coordinates of the second window based on the corner coordinate exceeding the display screen edge, and determine the second center point coordinates of the second window based on the first center point coordinates and the offset coordinates.

[0230] In some embodiments, the window layout module 3 is configured to:

[0231] Take a screenshot of the first page and display the screenshot on top of the first window;

[0232] Based on the second size and the second position of the second window, layout and display the second window under the screenshot, and display the second page in the second window.

[0233] As can be seen from the above, in the embodiments of the present disclosure, an adaptive matching of the window layout is realized based on the page change within the application, which can achieve an adaptive adjustment of the window layout at the page level, and determine the adjusted window size and position based on the original window size and position, reducing the impact brought by the window relayout, improving the layout effect and user experience. Moreover, during the relayout process of the second window, a mask is formed by using the screenshot of the first page to improve the transition animation effect and user experience.

[0234] In some embodiments, the present disclosure provides an electronic device, including:

[0235] a processor; and

[0236] a memory storing computer instructions for causing the processor to execute the method according to any of the above embodiments.

[0237] In some embodiments, the present disclosure provides a storage medium storing computer instructions for causing a computer to execute the method according to any of the above embodiments.

[0238] Figure 18 The structure of the electronic device in some embodiments of the present disclosure is shown below. In combination with Figure 18 the electronic device in some embodiments of the present disclosure will be described.

[0239] Referring to Figure 18 , the electronic device 1800 may include one or more of the following components: a processing component 1802, a memory 1804, a power component 1806, a multimedia component 1808, an audio component 1810, an input / output (I / O) interface 1812, a sensor component 1816, and a communication component 1818.

[0240] The processing component 1802 generally controls the overall operation of the electronic device 1800, such as operations associated with display, telephone call, data communication, camera operation, and recording operation. The processing component 1802 may include one or more processors 1820 to execute instructions. In addition, the processing component 1802 may include one or more modules to facilitate the interaction between the processing component 1802 and other components. For example, the processing component 1802 may include a multimedia module to facilitate the interaction between the multimedia component 1808 and the processing component 1802. Another example is that the processing component 1802 may read executable instructions from the memory to implement functions related to the electronic device.

[0241] The memory 1804 is configured to store various types of data to support the operation of the electronic device 1800. Examples of these data include instructions for any application or method operating on the electronic device 1800, contact data, phone book data, messages, pictures, videos, etc. The memory 1804 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0242] The power supply component 1806 provides power for various components of the electronic device 1800. The power supply component 1806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1800.

[0243] The multimedia component 1808 includes a display screen that provides an output interface between the electronic device 1800 and the user. In some embodiments, the multimedia component 1808 includes a front camera and / or a rear camera. When the electronic device 1800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0244] The audio component 1810 is configured to output and / or input audio signals. For example, the audio component 1810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 1800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 1804 or transmitted via the communication component 1818. In some embodiments, the audio component 1810 further includes a speaker for outputting audio signals.

[0245] The I / O interface 1812 provides an interface between the processing component 1802 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a start button, and a lock button.

[0246] The sensor component 1816 includes one or more sensors for providing a status assessment of various aspects of the electronic device 1800. For example, the sensor component 1816 can detect the on / off state of the electronic device 1800, the relative positioning of components, such as the display and the keypad of the electronic device 1800. The sensor component 1816 can also detect a change in the position of the electronic device 1800 or a component of the electronic device 1800, the presence or absence of user contact with the electronic device 1800, the orientation or acceleration / deceleration of the electronic device 1800, and the temperature change of the electronic device 1800. The sensor component 1816 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 1816 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 1816 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0247] The communication component 1818 is configured to facilitate communication between the electronic device 1800 and other devices in a wired or wireless manner. The electronic device 1800 can access a communication standard-based wireless network, such as Wi-Fi, 2G, 3G, 4G, 5G or 6G, or a combination thereof. In an exemplary embodiment, the communication component 1818 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1818 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0248] In an exemplary embodiment, the electronic device 1800 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components.

[0249] Obviously, the above embodiments are merely examples for clear illustration and not limitations on the embodiments. For those of ordinary skill in the art, other different forms of changes or variations can be made based on the above description. It is not necessary and impossible to enumerate all the embodiments here. And the obvious changes or variations derived therefrom are still within the protection scope of the present disclosure.

Claims

1. A window layout control method, characterized in that, Including: When the target application is displayed in a windowed manner, in response to detecting that the display page of the target application switches from the first page to the second page, and the display ratio supported by the second page is different from that of the first page, determine a target display ratio among at least one display ratio supported by the second page; Based on the first size, first position of the first window when the first page is displayed, and the target display ratio, determine the second size and second position of the second window when the second page is displayed; Based on the second size and second position of the second window, layout and display the second window, and display the second page in the second window.

2. The method according to claim 1, wherein The process of detecting the display ratios supported by each page of the target application includes: Obtain the page type of the page. In response to the page type being a full-screen page, determine the display ratio supported by the page based on the display direction of the page; And / or Obtain the display direction requested by the target application for the page, and determine the display ratio that is the same as the display direction from a pre-set display ratio library as the display ratio supported by the page; the display direction includes a landscape display direction and a portrait display direction.

3. The method according to claim 1 or 2, characterized in that, The determining of the target display ratio among at least one display ratio supported by the second page includes: Obtain the current first display ratio of the first page; Among at least one display ratio supported by the second page, determine the display ratio that is close to the first display ratio as the target display ratio.

4. The method according to claim 1, wherein The first size includes the first diagonal length of the first window, the first position includes the first center point coordinates of the first window, the second size includes the width and height of the second window, and the second position includes the second center point coordinates of the second window; The determining of the second size and second position of the second window when the second page is displayed based on the first size, first position of the first window when the first page is displayed, and the target display ratio includes: Obtain the first diagonal length and first center point coordinates of the first window; Based on the first diagonal length and the target display ratio, determine the width and height of the second window; Based on the first center point coordinates and the width and height of the second window, determine the second center point coordinates of the second window.

5. The method according to claim 4, characterized in that, The determining of the width and height of the second window based on the first diagonal length and the target display ratio includes: Based on the first diagonal length and the target display ratio, determine the candidate width and candidate height of the second window; In response to the candidate width not exceeding the maximum display width of the display screen and the candidate height not exceeding the maximum display height of the display screen, determine the candidate width and the candidate height as the width and height of the second window; In response to the candidate width exceeding the maximum display width of the display screen, and / or the candidate height exceeding the maximum display height of the display screen, scale the candidate width and the candidate height proportionally based on the maximum display width and the maximum display height to obtain the width and height of the second window.

6. The method according to claim 4, characterized in that, The determining the second center point coordinates of the second window based on the first center point coordinates and the width and height of the second window includes: Determine the corner point coordinates of the second window based on the first center point coordinates and the width and height of the second window; In response to all the corner point coordinates being within the display screen edge, determine the first center point coordinates as the second center point coordinates of the second window; In response to any one of the corner point coordinates exceeding the display screen edge, determine the offset coordinates of the second window based on the corner point coordinate exceeding the display screen edge, and determine the second center point coordinates of the second window based on the first center point coordinates and the offset coordinates.

7. The method according to claim 1, characterized in that The laying out and displaying the second window based on the second size and second position of the second window and displaying the second page in the second window includes: Take a screenshot of the first page and display the screenshot on top of the first window; Based on the second size and second position of the second window, layout and display the second window under the screenshot, and display the second page in the second window.

8. A window layout control device, characterized in that, Includes: A ratio determination module configured to, in the case of windowed display of a target application, in response to detecting that the display page of the target application switches from a first page to a second page, and the display ratio supported by the second page is different from that of the first page, determine a target display ratio among at least one display ratio supported by the second page; A window determination module configured to determine the second size and second position of a second window for displaying the second page based on the first size, first position of the first window when displaying the first page, and the target display ratio; A window layout module configured to layout and display the second window based on the second size and second position of the second window, and display the second page in the second window.

9. An electronic device, characterized in that, Includes: A processor; and A memory storing computer instructions for causing the processor to execute the method according to any one of claims 1 to 7.

10. A storage medium, characterized in that, Stores computer instructions for causing a computer to execute the method according to any one of claims 1 to 7.