Page layout method and related device

By adjusting the view tree structure and displaying the content of the same application page in columns, it solves the problem of insufficient information density caused by differences in display sizes of different devices, improves the amount of information and user experience, and simplifies the developer adaptation process.

CN118733158APending Publication Date: 2024-10-01HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310379893.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The size and shape of the display screens of different electronic devices vary greatly, resulting in insufficient information density and amount of information output in the page content displayed by the same application on different devices, affecting the user experience.

Method used

Provides a page layout method that divides the same application page content into multiple columns by adjusting the view tree structure, and utilizes the actual area of ​​the display screen to improve information density and information volume, without the need for application developers to adapt to different devices.

Benefits of technology

Make full use of the display space on different devices, increase information density and amount of information, improve user experience, and reduce developer adaptation workload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733158A_ABST
    Figure CN118733158A_ABST
Patent Text Reader

Abstract

The invention discloses a page layout method and a related device. According to the method, a system-level page layout scheme is provided, the electronic equipment divides page content into multiple columns, and the multiple columns of content are displayed on a display screen at the same time. By implementing the scheme of the application, different contents of the same page in the same application can be displayed by using the display screen without adapting to devices of different sizes or types by an application developer, the density and the information amount of output information are improved, and thus the device use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminals and human-computer interaction, and in particular to page layout methods and related devices. Background Art

[0002] With the development of terminal technology, electronic devices have more and more forms and categories. The display screen sizes of different types of electronic devices vary greatly. For example, the display screen aspect ratios of ordinary mobile phones, foldable screen mobile phones, tablet computers and other devices are all different. In order to meet user needs, more and more electronic devices are equipped with large-size displays. Summary of the invention

[0003] The present application provides a page layout method and related devices, which can improve the information density and amount of information output by a display screen, thereby improving the user's device usage experience.

[0004] In a first aspect, a page layout method is provided, which is applied to an electronic device, and includes: running a first application; obtaining a view tree structure of a first page in the first application; adjusting the view tree structure of the first page; and displaying a first content in a first area of ​​a display screen and a second content in a second area of ​​the display screen according to the adjusted view tree structure of the first page, wherein a right edge of the first area is connected to a left edge of the second area, the first content and the second content are both from the first page, and the first content is located above the second content in the first page.

[0005] Implementing the method provided in the first aspect provides a system-level page layout solution, which eliminates the need for application developers to adapt for devices of different sizes or categories. By adjusting the view tree structure, the electronic device can make full use of the display screen to display different contents of the same page in the same application, thereby improving the output information density and the output information volume, thereby improving the user's device usage experience.

[0006] In conjunction with the first aspect, in some implementations, the electronic device can adjust the view tree structure of the first page after detecting that the display screen switches from a folded state to an unfolded state; or after detecting that the electronic device switches from a vertical screen state to a horizontal screen state. In this way, after the electronic device switches the display screen state, it can use the display screen to increase the amount of information output.

[0007] In combination with the first aspect, in some implementations, the electronic device includes an application framework layer, and the electronic device adjusts the view tree structure of the first page through the application framework layer.

[0008] In combination with the first aspect, in some embodiments, the method further includes: detecting a sliding operation on the second area; sliding the second content displayed in the second area, and keeping the position of the first content in the first area unchanged. That is, the electronic device can present an effect that the content of some areas is fixed, and the content of other areas can be slidably displayed, so that the user can view the fixed content in some areas.

[0009] In combination with the previous embodiment, the method further includes: detecting a user operation acting on the first area; adjusting the content displayed in the first area, and keeping the second content in the second area unchanged. That is, the area with fixed content can also interact with the user. In combination with the previous embodiment, the view tree of the first page includes a first node, a second node, and a third node; wherein the second node and the third node are both child nodes of the first node, the second node includes the first content, and the third node includes the second content. Adjusting the view tree structure of the first page specifically includes: generating a fourth node, and adding the fourth node as the parent node of the first node; adjusting the second node from a child node of the first node to a child node of the fourth node, the fourth node being used to display the first content carried by the second node in the first area, and the second content carried by the third node in the second area.

[0010] Combined with the scheme in the previous paragraph, the first node specifically includes: a fifth node, a sixth node, wherein the sixth node is a child node of the fifth node, and the second node and the third node are both child nodes of the sixth node; the fifth node is used to carry the content that can be slidably displayed in the first page, and the sixth node is used to arrange the content carried by the fifth node in a vertical manner; adding the fourth node as the parent node of the first node, and adjusting the second node from a child node of the first node to a child node of the fourth node, specifically includes: adding the fourth node as the parent node of the fifth node, and adjusting the second node from a child node of the sixth node to a child node of the fourth node.

[0011] In combination with the previous implementation, the first content includes any one or more of the following: pictures, videos, animated pictures or music playback interfaces; and / or the second content includes any one or more of the following: description information, comments or recommended content for the first content. This makes it easier for users to view pictures, videos, animated pictures or music playback interfaces in a fixed area.

[0012] In combination with the previous embodiment, the electronic device can adjust the view tree structure of the first page after recognizing that both the first content and the second content can be slidably displayed in the first page provided by the first application, and the size of the first content in the first page is larger than the first size. This can avoid fixedly displaying the smaller-sized content in the first area.

[0013] In combination with the previous embodiment, the heights of the first area and the second area are the same and equal to the height of the display screen, and the sum of the widths of the first area and the second area is equal to the width of the display screen.

[0014] In combination with the solution in the previous paragraph, the width of the first area is greater than the width of the second area, which is equivalent to the first area for displaying fixed content being wider than the second area for displaying second content.

[0015] In combination with the previous implementation, the first content is located in the center of the first area.

[0016] In combination with the previous implementation, before adjusting the view tree structure of the first page, the method further includes: querying a second optimization method for the first application or the first page from pre-stored optimization information; or obtaining optimization information provided by the first application, the optimization information provided by the first application is used to indicate the second optimization method for the first application or the first page; or detecting a user operation for selecting the second optimization method. The second optimization method here is the optimization method provided in the previous implementation.

[0017] In combination with the first aspect, in some embodiments, the method further includes: detecting a sliding operation on the first area or the second area; sliding the first content displayed in the first area, and sliding the second content displayed in the second area at the same time. In other words, the electronic device can present a multi-column joint sliding effect.

[0018] In combination with the previous implementation, the view tree of the first page includes a seventh node and an eighth node, wherein the eighth node is a child node of the seventh node, and the eighth node includes a first content and a second content. Adjusting the view tree structure of the first page specifically includes: generating a ninth node; adding the ninth node as a child node of the seventh node; adjusting the eighth node from a child node of the seventh node to a child node of the ninth node, and the ninth node is used to display the first content carried by the eighth node in the first area, and display the second content carried by the eighth node in the second area.

[0019] In some implementations, the seventh node is the root node of the view tree of the first page.

[0020] Combined with the solution in the previous paragraph, the width of the ninth node is equal to 1 / 2 of the width of the display screen, and the height of the ninth node is equal to 2 times the height of the display screen; or, the width of the ninth node is equal to 1 / 3 of the width of the display screen, and the height of the ninth node is equal to 3 times the height of the display screen.

[0021] In combination with the previous implementation, the electronic device may adjust the view tree structure of the first page after recognizing that both the first content and the second content can be slidably displayed on the first page provided by the first application.

[0022] In combination with the previous embodiment, the height of the first area and the second area are the same and both are equal to the height of the display screen; the width of the first area and the second area are the same and both are equal to 1 / 2 of the width of the display screen, which is equivalent to dividing the display screen into two equal parts to display the first content and the second content.

[0023] Combined with the previous implementation, the third content is displayed in the third area of ​​the display screen, the left edge of the third area is connected to the right edge of the second area, and the third content is located below the second content in the first page; wherein the heights of the first area, the second area, and the third area are the same and are equal to the height of the display screen; the widths of the first area, the second area, and the third area are the same and are equal to 1 / 3 of the width of the display screen. This is equivalent to dividing the display screen into three equal parts to display the first content, the second content, and the third content.

[0024] In combination with the previous implementation, before adjusting the view tree structure of the first page, the method further includes: querying a first optimization method for the first application or the first page from pre-stored optimization information; or obtaining optimization information provided by the first application, the optimization information provided by the first application is used to indicate the first optimization method for the first application or the first page; or detecting a user operation for selecting the first optimization method. The first optimization method here is the optimization method provided in the previous implementation.

[0025] In combination with the first aspect and any one of the above-mentioned embodiments, before adjusting the view tree structure of the first page, the method also includes: querying the first application or the first page from a pre-stored first list, the first list is used to indicate the application or page that needs to optimize the page layout; or, obtaining the configuration information of the first application, the configuration information of the first application is used to instruct the electronic device to optimize the layout of the first page; or, detecting a user operation used to trigger the electronic device to optimize the layout of the first page.

[0026] In combination with the first aspect and any one of the above implementation modes, the method further includes any one or more of the following:

[0027] Displaying a status bar on the display screen, wherein the status bar is located at the top of the first area and the second area, or only at the top of the first area;

[0028] Displaying a navigation bar on the display screen, wherein the navigation bar is located at the bottom of the first area and the second area, or only at the bottom of the second area;

[0029] Displaying the header of the first page on the display screen, the header is located at the top position outside the status bar in the first area and the second area, or is only located at the top position outside the status bar in the first area; of course, if the status bar is not displayed, the header is located at the top position of the first area and the second area, or is only located at the top position of the first area;

[0030] The tail of the first page is displayed on the display screen, and the tail is located at the bottom position outside the navigation bar in the first area and the second area, or is only located at the bottom position outside the navigation bar in the second area; of course, if the navigation bar is not displayed, the tail is located at the bottom position of the first area and the second area, or is only located at the bottom position of the second area.

[0031] In a second aspect, an electronic device is provided, comprising: 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 includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute a method executed by the electronic device in the first aspect or any one of the embodiments of the first aspect.

[0032] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, causes the electronic device to execute a method executed by the electronic device in the first aspect or any one of the embodiments of the first aspect.

[0033] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the method executed by the electronic device in the first aspect or any one of the embodiments of the first aspect.

[0034] In a fifth aspect, an embodiment of the present application provides a chip system, which includes at least one processor for implementing a method executed by an electronic device in the first aspect or any one of the embodiments of the first aspect.

[0035] By implementing the system-level page layout solution provided in this application, the electronic device divides the page content into multiple columns and displays the multiple columns of content on the display screen at the same time. There is no need for application developers to adapt for devices of different sizes or categories. The display screen can be used to display different contents of the same page in the same application, thereby improving the output information density and amount, thereby improving the user's device usage experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1A-Figure 1C A user interface for displaying the same page on three electronic devices respectively;

[0037] Figure 2A Page 20 provided for the embodiment of the present application;

[0038] Figure 2B-2E A user interface when the electronic device provided in an embodiment of the present application displays page 20;

[0039] Figure 3A Page 30 provided for the embodiment of the present application;

[0040] Figure 3B-Figure 3C A user interface when the electronic device provided in an embodiment of the present application displays page 30;

[0041] Figure 3D Page 31 provided for the embodiment of the present application;

[0042] Figure 3E-Figure 3F A user interface when the electronic device provided in an embodiment of the present application displays page 31;

[0043] Figure 3G Page 32 provided for the embodiment of the present application;

[0044] Figure 3H-3J A user interface when the electronic device provided in an embodiment of the present application displays page 32;

[0045] Figure 4 A flow chart of a page layout method provided in an embodiment of the present application;

[0046] Figure 5 A flowchart of an electronic device analyzing page results provided in an embodiment of the present application;

[0047] Figure 6 A schematic diagram of a scenario when optimizing page layout using optimization method 1 provided in an embodiment of the present application;

[0048] Figure 7 A flow chart of optimizing page layout provided in an embodiment of the present application;

[0049] Figure 8 A schematic diagram of adjusting the view tree provided in an embodiment of the present application;

[0050] Fig. 9 The view tree description code provided for the embodiment of the present application;

[0051] Fig.10 A comparison chart of the effects of optimizing the page layout using optimization method 2 provided in the embodiment of the present application;

[0052] Fig.11 A flowchart of another page layout method provided in an embodiment of the present application;

[0053] Fig.12 A hardware structure block diagram of an electronic device provided in an embodiment of the present application;

[0054] Fig.13 The software architecture of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0056] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0057] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that the user can recognize. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0058] As the forms and types of electronic devices increase, the screen sizes of various electronic devices also vary. For example, the aspect ratio of the display screen of an ordinary mobile phone can be 16:9, the aspect ratio of the display screen of a foldable screen mobile phone after unfolding can be 16:16, and the aspect ratio of the display screen of a tablet computer can be 4:3.

[0059] Figure 1A-Figure 1C The user interface when three electronic devices display the same page is exemplarily shown.

[0060] Figure 1A shows a page displayed by a common mobile phone 100, Figure 1B The same page displayed by the folding screen mobile phone 200 is shown. Figure 1CThe same page displayed by the tablet computer 300 is shown. The three electronic devices are equipped with display screens of different sizes, and the display screen area of ​​the ordinary mobile phone, the display screen area of ​​the folding screen mobile phone, and the display screen area of ​​the tablet computer increase in sequence.

[0061] contrast Figure 1A-Figure 1C Although the display screens of foldable phones and tablets are larger, the content they present is the same as that of ordinary phones with smaller screens, and the advantages of large display screens are not reflected.

[0062] Based on this, the following embodiments of the present application provide a page layout method and related devices. The method provides a system-level page layout solution, which does not require application developers to adapt to devices of different sizes or categories, and can fully utilize the characteristics of different display screens to display application interfaces. The display screen can be fully utilized to display different contents of the same page in the same application, thereby increasing the output information density, which in turn increases the output information volume, thereby improving the user's device usage experience.

[0063] The page layout method provided in the embodiment of the present application can be applied to electronic devices.

[0064] The electronic device can be of various types, and the embodiments of the present application do not limit its specific type. For example, the electronic device can be a mobile phone, and can also include a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a smart screen, a wearable device, an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a car machine, a smart headset, a game console, and can also be an Internet of Things (IOT) device or a smart home device such as a smart water heater, a smart lamp, a smart air conditioner, etc. Not limited to this, the electronic device can also include a laptop computer with a touch-sensitive surface or a touch panel, a desktop computer with a touch-sensitive surface or a touch panel, and other non-portable terminal devices, etc.

[0065] The electronic device is equipped with a display screen, and the embodiment of the present application does not limit the area, size, type, and shape of the display screen. For example, the aspect ratio of the display screen of the electronic device can be 16:9, 16:10, 4:3, 16:16, etc. For another example, the display screen of the electronic device can be an inner folding screen or an outer folding screen, a horizontal inner folding screen, a horizontal outer folding screen, a vertical inner folding screen, a pull-out screen, a scroll screen, etc.

[0066] In the page layout method provided in the embodiment of the present application, the electronic device can divide part or all of the content of the same page in the same application into multiple columns, and display the multiple columns of content on the display screen at the same time. When the multiple columns of content are displayed on the display screen at the same time, the columns can slide together in response to user operations, or some of the columns can be fixed while the remaining columns can be slid for display.

[0067] Below, the page layout method is first introduced in conjunction with the user interface exemplarily provided in this application.

[0068] The page layout method of the embodiment of the present application provides two page optimization methods: optimization method 1 and optimization method 2. Among them, optimization method 1 is used to present the effect that the electronic device displays multiple columns of content, and the multiple columns are linked and slidable; optimization method 2 is used to present the effect that the electronic device displays multiple columns of content, and some columns are fixed and the remaining columns are slidable.

[0069] Figure 2A-2E It is used to illustrate the effect of optimization method 1.

[0070] Figure 2A A page 20 is shown as an example.

[0071] The page 20 may be provided by a shopping application. The page 20 may include a plurality of continuous partial pages from top to bottom: a partial page 20 - 1 , a partial page 20 - 2 , and a partial page 20 - 3 .

[0072] The height of the partial page 20 - 1 is slightly lower than the height of the partial page 20 - 2 , and the height of the partial page 20 - 1 is also slightly lower than the height of the partial page 20 - 3 . The partial pages 20 - 2 and 20 - 3 have the same height.

[0073] Partial page 20-1 may include a fixed header 201, which may include one or more of the title portion of page 20, a search box portion, some functional controls, or navigation keys within the application. Partial page 20-3 may include a fixed footer 202, which may include a menu bar at the bottom of page 20 or one or more of the navigation keys within the application. When the electronic device displays the content of page 20, the positions of the fixed header 201 and the fixed footer 202 in the display screen are always fixed and do not move with user operations. In some other embodiments, page 20 may also not include a fixed header, or a fixed bottom, or neither. Whether a page provided by an application includes a fixed header, a fixed footer, and the content of the fixed header and the content of the fixed footer is determined by the application that provides the page.

[0074] Figure 2AThe page 20 provided by the application shown may not be a complete page, but only a part of a complete page. For example, the page 20 may also include a navigation key within the application. For another example, there may be more page content below the partial page 20-3, or there may be more page content above the partial page 20-1. For the convenience of display, Figure 2A Not fully shown.

[0075] Figure 2B-2E The user interface when two electronic devices both display page 20 is exemplarily shown.

[0076] Figure 2B-2C The page displayed by the folding screen mobile phone 200 is shown. Figure 2D-Figure 2E The same page is shown displayed by the tablet computer 300. The two electronic devices are equipped with display screens of different sizes, and the display screen area of ​​the folding screen mobile phone and the display screen area of ​​the tablet computer increase in sequence.

[0077] Figure 2B-2E The same application is installed on both devices. Displaying the same page means that the content displayed on both devices is the same as that of the application. Figure 2A The page 20 shown is provided, and does not mean that the content displayed by two devices is exactly the same.

[0078] Figure 2B The user interface 220 displayed by the foldable screen mobile phone 200 is shown.

[0079] The user interface 220 displays: a status bar 203 , a partial page 20 - 1 , a partial page 20 - 5 , and a fixed footer 202 .

[0080] The status bar 203 may include a cellular signal strength indicator, a Wi-Fi signal strength indicator, a battery indicator, a time indicator, and the like.

[0081] The status bar 203 and the partial page 20-1 are in a row and are located on the left side of the display screen. The partial page 20-5 and the fixed tail 202 are in a row and are located on the right side of the display screen. The right edge of the left column is connected to the left edge of the right column.

[0082] Part 20-5 can be Figure 2A The remaining part of the middle partial page 20-2 after removing the partial content of the same size as the fixed tail 202 at the bottom. In effect, it can be seen that the fixed tail 202 is superimposed and displayed at the bottom of the partial page 20-2, and the bottom content of the partial page 20-2 is blocked by the fixed tail 202.

[0083] Figure 2C The folding screen mobile phone 200 receives the function Figure 2BAfter sliding upward on any column in the user interface 220 shown, the user interface 230 displayed on the foldable screen mobile phone 200.

[0084] The user interface 230 displays: a status bar 203 , a partial page 20 - 6 , a partial page 20 - 7 , and a fixed footer 202 .

[0085] The status bar 203 and the partial page 20-6 are arranged in a row on the left side of the display screen, and the partial page 20-7 and the fixed tail 202 are arranged in a row on the right side of the display screen.

[0086] The partial page 20-6 may include, from top to bottom: the fixed header 201, the lower part of the partial page 20-1, and the upper part of the partial page 20-2. The partial page 20-7 may include, from top to bottom: the lower part of the partial page 20-2 and the upper part of the partial page 20-3. Figure 2A The results of moving the part other than the fixed part of page 20 upward and dividing it into two columns. and Figure 2B In contrast, the two columns of content present a joint sliding effect.

[0087] In some other embodiments, the folding screen mobile phone 200 can receive a signal acting on Figure 2B The user interface 220 is slid upward or to the left, and then the subsequent content of the page 20 except the part of the page 20-1 is divided into two columns for display, so as to present the effect of sliding the entire column.

[0088] Figure 2D The user interface 240 displayed by the tablet computer 300 is shown.

[0089] The user interface 240 displays: a status bar 203, a partial page 20-1, a partial page 20-2, and a partial page 20-3.

[0090] The status bar 203 and the partial page 20-1 are arranged in a column on the left side of the display screen. The partial page 20-2 is arranged in a column in the middle of the display screen. The partial page 20-3 is arranged in a column on the right side of the display screen. The right edge of the left column is connected to the left edge of the middle column. The right edge of the middle column is connected to the left edge of the right column.

[0091] Figure 2E The folding screen mobile phone 200 receives the function Figure 2D After sliding up any column in the user interface 240, the folding screen mobile phone 200 displays the user interface 250. The content displayed in the user interface 250 can be regarded as Figure 2A The results of moving the part other than the fixed part of page 20 upward and dividing it into three columns. and Figure 2D In contrast, the three columns of content present a joint sliding effect.

[0092] In some other embodiments, the folding screen mobile phone 200 can receive a signal acting on Figure 2D The user interface 240 is slid upward or to the left, and then the subsequent content of the page 20 except the part of the page 20-1 is divided into three columns for display, so as to present the effect of sliding the entire column.

[0093] The above introduction Figure 2B-2E In the related description of the present invention, various sliding operations input by the user in the user interface can act on areas other than the fixed parts (such as the status bar 203, the fixed header 201, and the fixed tail 202) in the user interface. For example, Figure 2B The sliding operation shown can be applied to the area other than the fixed header 201 in the left column partial page 20-1, and can also be applied to the right column partial page 20-5. Figure 2D The sliding operation shown can be applied to the area outside the fixed header 201 in the left column partial page 20-1, the middle column partial page 20-2, and can also be applied to the area outside the fixed footer 202 in the right column partial page 20-3.

[0094] Above Figure 2A-2E This is only an example and does not constitute a limitation of this application.

[0095] From the above Figure 2B-2E As can be seen from the user interface shown, optimization method 1 may include at least the following technical effects:

[0096] from Figure 2B-2C , Figure 2D-Figure 2E From the above, the folding screen mobile phone 200 and the tablet computer 300 with a larger display screen cut a page provided by the application into several parts, and display the parts on the display screen at the same time. Figure 2B and Figure 1B , or, contrast Figure 2D and Figure 1C , the embodiments of the present application provide Figure 2B Folding screen mobile phone 200, Figure 2D The tablet computer 300 can display more content, which increases the amount of information output by the electronic device and makes it easier for users to obtain more information.

[0097] contrast Figure 2B and Figure 2D , electronic devices with larger display areas can display more columns and output more information. In this way, the page content can be displayed according to the actual area of ​​the display, making full use of the advantages of the large display.

[0098] Display screens of different sizes display different numbers of columns. While ensuring that the width of a single column displayed on each electronic device and the size of the text in a single column are not much different, users can have a similar experience with the same application on different devices, avoiding the same application having very different user experiences on different devices, and improving user experience.

[0099] Electronic devices with large displays cut pages into multiple columns and display them simultaneously. Compared with a solution that stretches application pages and scales elements within application pages and then displays them in one column, this can avoid problems such as truncation, deformation, blank space, or even unusability of pages displayed on large displays.

[0100] After an electronic device cuts a page into multiple columns and displays them simultaneously, it can respond to the user's sliding operation and display the contents of the multiple columns in a linked sliding manner, thereby presenting a linked content refresh effect. Although it is displayed in multiple columns for the user, the interaction is simple and easy to understand, and it is easy for the user to use the large display screen to view more information.

[0101] Figure 3A-3J It is used to illustrate the effect of optimization method 2.

[0102] Figure 3A-3C Used to exemplify the effect of an electronic device displaying pictures and texts separately.

[0103] Figure 3A A page 30 is shown as an example, and the page 30 has a structure of upper picture and lower text.

[0104] The page 30 may be provided by a social application. The page 30 may include, from top to bottom: a picture area 30 - 1 , and a text area 30 - 2 .

[0105] The picture area 30 - 1 is used to display one or more pictures. When the picture area 30 - 1 is used to display multiple pictures, a picture indicator may be included below the picture to indicate which picture is currently displayed.

[0106] The text area 30-2 may be used to display information output by the content publishing user, as well as comments from other users. The information displayed in the text area 30-2 may include any one or more of the following: text, symbols, emoticons, pictures, animated pictures, etc.

[0107] In some embodiments, the page 30 may further include more content, for example, the page 30 may further include a fixed header 301 and a fixed footer 302. The fixed header 301 may include a navigation key (such as a return key) within the application, a title bar, the name and avatar of the content publishing user, a follow control, a share control, etc. The fixed footer 302 may include a comment box, a like control, a favorite control, a comment control, etc.

[0108] When the electronic device displays the content of page 30, the positions of fixed header 301 and fixed footer 302 in the display screen are always fixed and do not move with user operations. In some other embodiments, page 30 may not include a fixed header, or a fixed footer, or both.

[0109] Figure 3A The page 30 provided by the application shown may not be a complete page, but only a part of a complete page. For example, the picture area 30-1 can also be switched to display other pictures, and there can be more page content below the text area 30-2. Figure 3A Not fully shown.

[0110] The size of the image area 30-1 is relatively large. If the electronic device directly displays the page 30 in a column, the image area 30-1 will occupy most of the display screen, and only a small area of ​​the display screen is left to display the content of the text area 30-2. The information of the text area 30-2 that the user can see is limited. If the user inputs an upward sliding operation to the electronic device, the electronic device can slide the entire page 30 upward to see more content in the text area 30-2, but at the same time, part of the content of the image area 30-1 will also be moved out of the display screen.

[0111] Figure 3B The user interface 310 of the electronic device when displaying the page 30 according to the embodiment of the present application is exemplarily shown.

[0112] Figure 3B The electronic device shown may be a folding screen mobile phone 200. The user interface 310 includes two areas: area 30-3 and area 30-4.

[0113] Area 30-3 is for display Figure 3A The picture in the picture area 30-1 of the folding screen 200 currently displays a picture, and there is a picture indicator at the bottom to indicate which picture the picture is. After the folding screen mobile phone 200 receives the left sliding or right sliding operation acting on the area 30-3, the picture displayed in the area 30-3 can be switched. In this process, the content displayed in the area 30-4 of the right column remains unchanged.

[0114] Area 30-4 is for display Figure 3A The content in the text area 30-2 of the page 30 is currently displayed with information output by the content publisher and comments from other users. After receiving the upward or downward sliding operation on the area 30-4, the folding screen mobile phone 200 can scroll up or down the other content in the text area 30-2 of the display page 30 to refresh the content displayed in the area. In this process, the fixed content displayed in the area 30-3 of the left column remains unchanged.

[0115] Figure 3C The folding screen mobile phone 200 receives the function of Figure 3B After the upward sliding operation of the middle area 30-4, the user interface 320 is displayed. Figure 3C As shown, the content of area 30 - 4 is refreshed, giving the effect of being moved upward.

[0116] Figure 3B and Figure 3C The user interface shown may also include more content, such as a status bar, a navigation bar, a fixed header, a fixed footer, etc. The above content may be displayed in both the column area 30-3 and the area 30-4, or may be displayed in only one of the column areas. Figure 3B and Figure 3C In the example, both the area 30 - 3 and the area 30 - 4 display a status bar, a fixed header, and a fixed footer.

[0117] Figure 3D-Figure 3F Used to exemplify the effect of an electronic device displaying videos and recommended contents in separate columns.

[0118] Figure 3D A page 31 is shown as an example.

[0119] The page 31 may be provided by a video application. The page 31 may include, from top to bottom: a video area 31-1, and a recommended content area 31-2. In some other embodiments, the page 31 may also include more content, for example, the page 31 may also include a navigation key (such as a return key) within the application, a title bar, a video introduction, a comment box, a sharing control, and the like.

[0120] The video area 31 - 1 is used to display video.

[0121] The recommended content area 31-2 may be used to display information of the content publisher (such as user name and image), video introduction, links to other recommended videos, titles and covers, etc. The information displayed in the recommended content area 31-2 may include any one or more of the following: text, symbols, emoticons, pictures, animated images, etc.

[0122] Figure 3D The page 31 provided by the application shown may not be a complete page, but only a part of a complete page. For example, there may be more recommended content below the recommended content area 31-2. Figure 3D Not fully shown.

[0123] The size of the video area 31-1 is relatively large. If the electronic device directly displays the page 31 in a column, the video area 31-1 will occupy most of the display area, and only a small area of ​​the display screen is left to display the content of the recommended content area 31-2. The information of the recommended content area 31-2 that the user can see is limited. If the user inputs an upward sliding operation to the electronic device, the electronic device can slide the entire page 30 upward to see more content in the recommended content area 31-2, but at the same time, part of the content of the video area 31-1 will be moved out of the display screen.

[0124] Figure 3E The user interface 330 of the electronic device when displaying the page 30 according to the embodiment of the present application is exemplarily shown.

[0125] Figure 3E The electronic device shown may be a folding screen mobile phone 200. The user interface 330 includes two areas: area 31-3 and area 31-4.

[0126] Area 31-3 is used for display Figure 3D The video in the video area 31-1 can be played continuously over time, or can be paused, fast-forwarded, volume adjusted, brightness adjusted, progress bar adjusted, etc. according to user operations. In this process, the content displayed in the area 31-4 of the right column remains unchanged.

[0127] Area 31-4 is used for display Figure 3D The content in the recommended content area 31-2 of the page 31 is currently displayed, which includes information of the content publisher (such as user name and image), video introduction, links to other recommended videos, titles and covers, etc. After the folding screen mobile phone 200 receives an upward or downward sliding operation on the area 31-4, it can scroll up or down to display other content in the recommended content area 31-2 of the page 31. In this process, the area 31-3 in the left column does not change with the user's sliding operation, and the video can be played as time changes.

[0128] Figure 3F The folding screen mobile phone 200 receives the function of Figure 3E After the upward sliding operation of the middle area 31-3, the user interface 340 is displayed.

[0129] Figure 3E and Figure 3F The user interface shown may also include more content, such as a status bar, a fixed header, a fixed footer, etc. The above content may be displayed in both the columnar area 31-3 and the area 31-4, or may be displayed in only one of the areas.

[0130] Figure 3G-3JUsed to exemplify the effect of an electronic device displaying videos and comments separately.

[0131] Figure 3G A page 32 is shown as an example.

[0132] The page 32 may be provided by a video application.

[0133] Page 32 may include: video area 32-1. Video area 32-1 is used to display videos, and video area 32-1 may also display: title bar, video introduction, bullet box, view comment control, share control, etc. In some other embodiments, page 32 may also include more content, for example, page 32 may also include navigation keys (such as return key) within the application.

[0134] The View Comments control can be used to view comments on the current video. Figure 3G The picture on the right shows the comments on the current video.

[0135] When the electronic device directly displays page 32 in a column, the video area 32-1 occupies most of the display screen area. When the electronic device receives a user operation on the view comment control, the electronic device will display the comments on the current video included in page 32, and the comments will cover most of the video area 32-1, affecting the user's ability to continue watching the video.

[0136] Figure 3H The user interface 350 when the electronic device displays the page 32 according to the embodiment of the present application is exemplarily shown.

[0137] Figure 3H The electronic device shown may be a folding screen mobile phone 200. The user interface 350 includes an area 32-3, which is used to display Figure 3G Region 32-3 occupies almost the entire area of ​​the display screen.

[0138] Folding screen mobile phone 200 receives the effect on Figure 3H After the user operates the View Comments control in Fig. 3I User interface 360 ​​is shown.

[0139] The user interface 360 ​​includes two areas: area 32 - 4 and area 32 - 5 .

[0140] Area 32-4 is used for display Figure 3GThe content in the video area 32-1 currently displays the information of the content publisher (such as the user name and image), the video introduction, the bullet screen, and some operation controls. The video can be played continuously, or the user can perform operations such as pausing, fast forwarding, adjusting the volume, adjusting the brightness, adjusting the progress bar, and posting comments. In this process, the content displayed in the area 32-5 on the right column remains unchanged.

[0141] Area 32-5 is used to display comments on the current video, which currently displays the information of the user who posted the comment (such as user name and image), comments, comment boxes, and operation controls for comments (such as delete, like, etc.). After the folding screen mobile phone 200 receives an upward or downward sliding operation on area 32-5, it can scroll up or down to display other comments on page 32. In this process, area 32-4 in the left column does not change with the user's sliding operation, and the video can be played over time.

[0142] Figure 3J The folding screen mobile phone 200 receives the function of Fig. 3I After the upward sliding operation of the middle area 32-5, the user interface 370 is displayed.

[0143] Fig. 3I and Figure 3J The user interface shown may also include more content, such as a status bar, a fixed header, a fixed footer, etc. The above content may be displayed in both the columnar area 32-4 and the area 32-5, or may be displayed in only one of the areas.

[0144] Above Figure 3A-3J This is only an example and does not constitute a limitation of this application.

[0145] From the above Figure 3A-3J It can be seen from the user interface shown that optimization method 2 may include at least the following technical effects:

[0146] Electronic devices with larger display screens can display more content by cutting a page provided by an application into several parts and displaying the parts on the display screen at the same time, thereby increasing the information density output by the electronic device and the amount of information output, making it easier for users to obtain more information. In this way, the page content can be displayed according to the actual area of ​​the display screen, making full use of the advantages of the large display screen.

[0147] After an electronic device cuts a page into multiple columns and displays them simultaneously, the multiple columns can give feedback in response to user operations separately without affecting the display of other columns, presenting a column control effect. Although it is a multi-column display for the user, the interaction is simple and easy to understand, and it is easy for the user to view more information using a large display screen.

[0148] After an electronic device cuts a page into multiple columns and displays them simultaneously, it can display pictures, videos, animated images, music playback interfaces and other content fixedly in a certain column, and these contents will not slide with the user's sliding operations on other columns, making it convenient for users to view more content in other columns while viewing pictures, videos, animated images, and music playback interfaces.

[0149] For any of the user interfaces shown above, at least the following extensions can be made:

[0150] When the content is not limited to being displayed in columns, the status bar is displayed in a spliced ​​manner above the page content provided by the application (for example Figure 2B-2E In other embodiments, the status bar may also be displayed in an overlay manner above the page content provided by the application. This may be a transparent overlay or a non-transparent overlay.

[0151] When displaying content in columns, display the status bar at the top of the leftmost column (for example Figure 2B-2E ), in other embodiments, the status bar may also occupy the entire top of the display screen (e.g. Figure 3B-Figure 3C ), located above all columns. Even electronic devices can also not display the status bar (for example Figure 3E , Figure 3H ).

[0152] When displaying content in columns, the fixed header of the application is displayed at the top of the leftmost column (for example Figure 2B-2E ), in other embodiments, the fixed head may also occupy the entire top of the display screen (e.g. Figure 3C ), above all columns.

[0153] When displaying content not limited to columns, display the fixed footer of the application at the bottom of the rightmost column (for example Figure 2B-2E ), in other embodiments, the fixed tail may also occupy the entire bottom of the display screen (eg Figure 3B-Figure 3C ) below all columns.

[0154] Fixed headers can be displayed in a spliced ​​manner above a certain column or all columns, or in an overlay manner above a certain column or all columns. The same is true for fixed footers.

[0155] In other embodiments, the user interface displayed by each electronic device may further include a navigation bar. The navigation bar may be located at the bottom of the rightmost column or at the bottom of all columns. The display logic of the navigation bar is similar to that of the status bar, and reference may be made to the relevant description and extension of the status bar. The difference is that the status bar is displayed at the top, while the navigation bar is displayed at the bottom. The navigation bar may include a return key, a home key, a multitasking key, etc.

[0156] The positions of the status bar and the navigation bar on the display screen can be fixed and do not change with user operations.

[0157] In combination with the user interface introduced above, the page layout method provided in the embodiment of the present application is described in detail below.

[0158] Figure 4 The flow of the page layout method is shown as an example. Figure 4 As shown, the method may include the following steps:

[0159] S101, the electronic device runs a first application.

[0160] The electronic device may run the first application in response to the received user operation. The user operation may include an operation of starting the first application, such as a user operation on the icon of the first application on the desktop (such as a click operation, a touch operation, etc.), a voice command for starting the first application, a gesture, etc. The user operation may also include an operation of switching from other applications to the first application, an operation of switching the first application from the background to the foreground in the multitasking bar, etc.

[0161] The first application can be of any type, and the embodiment of the present application does not limit its specific type.

[0162] According to the provider, the first application can be a system application or a third-party application. Applications provided or developed by the manufacturer of an electronic device can be called system applications of the electronic device; applications developed by other providers can be called third-party applications of the electronic device. Manufacturers of electronic devices can include manufacturers, suppliers, providers or operators of the electronic device.

[0163] According to the business type, the first application can be a shopping application, a social application, a reading application, a browser, an office application, an image processing application, etc.

[0164] S102: The electronic device determines a first page to be displayed.

[0165] The first page is provided by the first application, and may be a main page of the first application or a sub-page, which is not limited in this embodiment of the present application.

[0166] The first page may be a page that needs to be displayed for the first time after the electronic device runs the first application in S101, or may be a page that needs to be displayed after the electronic device runs the first application in S101 and receives an operation for switching pages.

[0167] The content details of the first page are included in the information of the first application. The electronic device can search for the content details of the first page in the stored information of the first application.

[0168] The embodiment of the present application does not limit the content contained in the first page. The content in the first page may include, for example, any one or more of the following: pictures, texts, videos, various functional controls, etc.

[0169] For example, the first page may include Figure 2A Page 20 shown, Figure 3A Page 30 shown, Figure 3D Page 31 or Figure 3G Page 32 is shown.

[0170] Before the electronic device starts any page, it needs to start the corresponding activity, and then use the activity to display the page. Therefore, the electronic device determines the first page to be displayed, and also determines the activity to be started, and can start the activity. In S101, the electronic device starts the activity to support the subsequent layout optimization and display process.

[0171] S103: The electronic device determines whether to optimize the layout of the first page.

[0172] Optimizing the layout of the first page refers to using the page layout method provided in the embodiment of the present application to rearrange the first page, and then displaying the optimized first page.

[0173] The determination method of whether to optimize the first page layout may include at least the following:

[0174] Method 1: The electronic device presets a whitelist, and determines whether to optimize the layout of the first page according to the whitelist.

[0175] In one implementation, the whitelist includes an application list, including one or more application identifiers. If the first application is in the application list, it is confirmed that the layout of the first page is optimized; if the first application is not in the application list, it is confirmed that the layout of the first page is not optimized. In this way, when the electronic device displays any page of any application in the application list, it can use the layout optimization method of the embodiment of the present application to optimize its layout.

[0176] In another implementation, the whitelist includes an application list, and each application in the application list further includes a page list. If the first application is in the application list, and the first page is in the page list corresponding to the first application, then it is confirmed that the layout of the first page is optimized; if the first application is not in the application list, or the first page is not in the page list corresponding to the first application, then it is confirmed that the layout of the first page is not optimized. In this way, when the electronic device displays a page in the page list corresponding to an application, it can use the layout optimization method of the embodiment of the present application to optimize its layout.

[0177] The white list in method 1 may be pre-set by the manufacturer and developer of the electronic device and then stored in the electronic device.

[0178] The white list may also be referred to as other terms, the meaning of which has been explained above and does not constitute a limitation on the present application. The white list may also be referred to as the first list.

[0179] Refer to the following code, which exemplifies a form of pre-setting a whitelist for an electronic device.

[0180]

[0181] In the above code, the page layout optimization functions of APP1, APP2, and APP3 are all enabled (i.e., activated), that is, APP1, App2, and APP3 are all in the list of applications that need to optimize the layout.

[0182] In addition, the video playback page corresponding to the activity named "tv.danmaku.APP1.MainActivityV2" in APP1, the application main page corresponding to the activity named "com.APP2.activity.AppstarterActivity" in APP2, and the application main page corresponding to the activity named "com.APP3.activity.AppStarterActivity" in APP3 are all in the list of pages whose layout needs to be optimized.

[0183] Method 2: The first application provides configuration information, and the electronic device determines whether to optimize the layout of the first page based on the configuration information.

[0184] In one implementation, the configuration information provided by the first application includes: indication information of whether the page layout of the first application needs to be optimized. The indication information can be implemented in a variety of forms, which are not limited here. If the configuration information indicates that the page layout of the first application needs to be optimized, then it is confirmed that the layout of the first page is optimized; if the configuration information indicates that the page layout of the first application does not need to be optimized, then it is confirmed that the layout of the first page is not optimized.

[0185] In another embodiment, the configuration information provided by the first application includes: an identifier of a page in the first application that needs to have its layout optimized, or information indicating whether each page in the first application needs to have its page layout optimized. The page identifier can be implemented in a variety of forms, such as page name, level, etc., which are not limited here. If the configuration information indicates that the layout of the first page of the first application needs to be optimized, then it is confirmed that the layout of the first page is optimized; if the configuration information indicates that the layout of the first page of the first application does not need to be optimized, then it is confirmed that the layout of the first page is not optimized.

[0186] The configuration information provided by the first application in Mode 2 may be pre-set by the provider of the first application and then packaged into the installation package or update package of the first application. In a specific example, the configuration information of the first application may be stored in a file of the first application (eg, Manifests.xml).

[0187] In the above-mentioned method 1 or method 2, whether it is the manufacturer and developer of the electronic device who decides which applications to optimize the page layout, which pages to optimize the layout, etc., or it is the provider of the first application who decides which applications to optimize the page layout, which pages to optimize the layout, etc. for an electronic device, the influencing factors of the decision may include any one or more of the following: the display screen form of various electronic devices, the type of business provided by the first application, the type of page provided by the first application, the page content, and other factors. In this way, the whitelist or configuration information can be flexibly set to allow users to have a good visual experience when using the first application in the electronic device. For example, the provider of a shopping application can set that the shopping application needs to optimize the page layout, and the provider of a video application can set the video playback page in the application (for example Figure 3D Page 31 of Figure 3G Page 32) needs to have its layout optimized.

[0188] In some embodiments, the electronic device may also decide whether to optimize the layout of the first page based on its current state. The state of the electronic device may include the area size of the display screen, the horizontal and vertical screen state of the display screen, the folded state of the display screen, etc. For example, a smaller display screen (such as an ordinary mobile phone display screen) does not optimize the layout in the vertical screen state, but can optimize the layout in the horizontal screen state, that is, the layout can be optimized when the vertical screen state is switched to the horizontal screen state. For another example, the layout can be optimized when the folding display screen switches from the folded state to the unfolded state. For another example, the layout may not be optimized when the tri-fold display screen is fully folded and only one-third of the screen is working, but the layout may be optimized when it is fully unfolded and the entire screen is working.

[0189] Method 3: The electronic device analyzes the page structure of the first page, and determines whether to optimize the layout of the first page according to the page structure of the first page.

[0190] The page structure of the first page is provided by the first application.

[0191] The page structure includes any one or more of the following information: the content of the page, the position of each element in the page, the type of each element, the hierarchical structure between elements, parent-child node relationships, etc.

[0192] In some implementations, the view tree of the first page may reflect its page structure, so the electronic device may parse the view tree of the first page and determine whether to optimize the layout of the first page accordingly.

[0193] In some implementations, if all the content of the first page or more than a certain proportion of the content can be scrolled and displayed in response to user operations, it can be determined that the page layout of the first page needs to be optimized.

[0194] Method 4: The electronic device determines whether to optimize the layout of the first page according to the user operation.

[0195] In one embodiment, the electronic device does not optimize the layout of the first page first, and directly displays the first page according to the default rules. For example, the electronic device displays part of the content of the first page as a column. Since the display screen sizes of different electronic devices are different, the entire page or the elements within the page may need to be stretched, scaled, etc. when displaying the first page. Afterwards, if the user inputs a user operation for optimizing the layout of the first page, the electronic device confirms that the layout of the first page is optimized. The user operation for optimizing the layout of the first page can be implemented in a variety of forms, which are not limited here. For example, the electronic device can provide a system-level layout optimization control when displaying the first page, and the user can click the layout optimization control to trigger the electronic device to optimize the layout of the first page and display the optimized first page.

[0196] In another implementation, the user may also set in advance in the setting application of the electronic device which applications need to optimize the page layout, or which pages of which applications need to optimize the page layout. The electronic device may determine whether to optimize the layout of the first page according to the setting result of the user.

[0197] If the judgment result of S103 is yes, then S103 or subsequent steps are executed.

[0198] If the judgment result of S103 is no, the first page may be displayed according to the default rule.

[0199] S104: The electronic device determines an optimization method for the first page.

[0200] The electronic device of the embodiment of the present application can provide at least two optimization modes: Optimization mode 1, which supports the electronic device to display multiple columns of content and presents the effect of multiple columns being linked and sliding; Optimization mode 2, which supports the electronic device to display multiple columns of content and presents the effect of multiple columns being controlled separately. Optimization mode 1 can also be called the first optimization mode, and optimization mode 2 can also be called the second optimization mode.

[0201] The electronic device may determine the optimization method for the first page in any of the following ways:

[0202] Method 1: The electronic device presets optimization information, and the optimization method for the first page can be queried from the optimization information.

[0203] In one implementation, the optimization information preset by the electronic device indicates the optimization method for one or more applications (including the first application), and the electronic device can query the optimization method for the first application from the preset information and use it as the optimization method for the first page. In this way, when displaying each page of an application, the electronic device can use the same optimization method to optimize the layout of its page.

[0204] In another embodiment, the optimization information preset by the electronic device indicates the optimization method for one or more pages of one or more applications (including the first application), and the electronic device can query the optimization method for the first page of the first application from the preset information. Multiple pages provided by an application can have different optimization methods.

[0205] The optimization information preset in the electronic device in the method 1 can be preset by the manufacturer and developer of the electronic device and then stored in the electronic device.

[0206] Referring to the code provided above, it also illustrates a form of optimization information in an electronic device. The above code shows the optimization methods of three applications, the optimization method of APP1 is "association", which is optimization method 1, and the optimization methods of APP2 and APP3 are "fixoneside", which is optimization method 2.

[0207] Method 2: The first application provides optimization information, and the electronic device can obtain the optimization method for the first page from the optimization information.

[0208] In one implementation, the optimization information provided by the first application indicates an optimization method for one or more applications (including the first application), and the electronic device can query the optimization method for the first application from the optimization information and use it as the optimization method for the first page. In this way, when displaying each page of an application, the electronic device can use the same optimization method to optimize the layout of its page.

[0209] In another embodiment, the optimization information provided by the first application indicates the optimization method for one or more pages of one or more applications (including the first application), and the electronic device can query the optimization method for the first page of the first application from the preset information. Multiple pages provided by an application can have different optimization methods.

[0210] In method 2, the optimization information provided by the first application can be pre-set by the provider of the first application and then packaged into files such as the installation package or update package of the first application.

[0211] In the above-mentioned method 1 or method 2, whether the optimization information is provided by the manufacturer of the electronic device or the developer, the optimization information can be set according to the page structure of each page provided by the application. For example, the pages provided by the shopping application can be scrolled in full screen, so the optimization method of the shopping application can be set to optimization method 1. For another example, the video playback page provided by the video application (for example Figure 3D Page 31 of Figure 3G The page 32) includes a larger area for playing videos, so the optimization mode of the video playing page can be set to optimization mode 2.

[0212] Method 3: The electronic device analyzes the page structure of the first page, and determines an optimization method for the first page according to the page structure of the first page.

[0213] In some implementations, the view tree of the first page may reflect its page structure, so the electronic device may parse the view tree of the first page and determine an optimization method for the first page accordingly.

[0214] In some embodiments, if all the content of the first page or the content exceeding a certain proportion or exceeding the first size can be scrolled and displayed as the user operates, it can be determined that the layout of the first page is optimized in optimization mode 1. The proportion can be set as needed, for example, it can be 80%, 90%, etc. Specifically, the electronic device can directly analyze the proportion of the scrollable content in the first page, or it can also determine the amount of scrollable content by analyzing the proportion of the scroll-view area or the scrollable container. The first size can be set as needed, and the embodiments of the present application are not limited to this.

[0215] In some implementations, if the first page contains scrollable content, and a larger area (e.g., an area exceeding the first size) in the scrollable content is used to display content such as pictures, videos, animated images, and music playback interfaces, it can be determined that the layout of the first page is optimized in optimization mode 2. Specifically, the electronic device can analyze the size of the content such as pictures, videos, animated images, and music playback interfaces in the first page (which may include one or more of the information such as height and width), or analyze the size of the container for holding the content such as pictures, videos, animated images, and music playback interfaces (which may include one or more of the information such as height and width). If the size exceeds a threshold, it is determined that the layout is optimized in optimization mode 2.

[0216] In the previous implementation, a larger area is required for displaying pictures, videos, animated images, music playback interfaces and other contents. Therefore, when there are small areas of pictures and animated images on the first page, for example, when pop-up ads appear, the layout of these contents on the page does not need to be optimized.

[0217] refer to Figure 5 , Figure 5 The process of analyzing the view tree by the electronic device to obtain the page structure of the first page is exemplified. Figure 5 As shown, when the electronic device marks the current first page as a scene with an upper picture and lower text, it can be considered that there is a large area in the first page for displaying pictures, that is, it can be determined to optimize the layout of the first page using optimization method 2.

[0218] Method 4: The electronic device determines an optimization method for the first page according to the user's selection.

[0219] In some implementations, the electronic device may not optimize the layout of the first page first, but directly display the first page according to the default rules, and provide a system-level layout optimization control when displaying the first page. After the user clicks the layout optimization control, the electronic device may provide selection controls for each of multiple optimization methods. The user may click the selection control corresponding to the desired optimization method, triggering the electronic device to optimize the layout of the first page in the selected optimization method and display the optimized first page.

[0220] In other implementations, the user may also long press the picture, video animation, music playback interface, etc. on the first page displayed by the electronic device, and then the electronic device displays the system-level optimization method 2 option, and then the user clicks the optimization method 2 option to trigger the electronic device to optimize the layout of the first page in the optimization method 2. Alternatively, the user long presses the picture, video animation, music playback interface, etc. on the first page displayed by the electronic device or inputs other operations to directly trigger the electronic device to optimize the layout of the first page in the optimization method 2.

[0221] In combination with the previous embodiment, after the user triggers the electronic device to optimize the layout of the first page in optimization mode 2, the electronic device may also generate a temporary configuration file or a fixed configuration file, which is used to indicate that the first page is optimized in optimization mode 2. If a fixed configuration file is generated, when the electronic device subsequently clicks to enter the first page again, the electronic device may directly follow the configuration file and choose to optimize the first page in optimization mode 2 without user triggering.

[0222] Not limited to the optimization method 1 and optimization method 2 described above, in some implementations, if there are more optimization methods, more optimization methods can also be added to the selection of the electronic device in the embodiment of the present application. In some other implementations, the electronic device can also only provide one optimization method, such as only providing optimization method 1 or optimization method 2, so that the electronic device does not need to select from multiple optimization methods, and can directly determine the optimization method to be used.

[0223] Taking the two optimization methods provided in the embodiments of the present application as an example, if it is determined to optimize the layout of the first page using optimization method 1, then execute subsequent steps S105-S107; if it is determined to optimize the layout of the first page using optimization method 2, then execute subsequent steps S108-S110.

[0224] S105, the electronic device optimizes the layout of the first page using optimization method 1, and then displays the optimized first page.

[0225] The electronic device first obtains the view tree structure of the first page, then adjusts the structure of the view tree, and displays content on the display screen based on the adjusted view tree structure.

[0226] S105 may include the following sub-steps:

[0227] Step 1, determine the number of columns n to be displayed.

[0228] In some implementations, the electronic device first obtains one or more information such as the width of the display screen, the device type of the electronic device, and then determines the number of columns n based on the one or more information. If the electronic device is a foldable screen, the display screen width here may refer to the width of the portion of the screen currently in operation for displaying content.

[0229] In one example, the number of columns n ≈ the width of the display screen width ÷ the optimal width. The optimal width may be the optimal screen width for displaying the first page of a single column. When the first page of a single column is displayed at the optimal width, the first page will not have visual problems such as deformation, and a better visual effect may be presented to the user. The optimal width may be related to the content of the first page, such as the interval between internal factors, and may vary with the page to be displayed. The optimal widths corresponding to different electronic devices may also be different. The optimal width may be pre-set by the electronic device, and is not limited here. For example, the optimal width may be set to the width of a display screen with a 16:9 ratio. The number of columns n is approximately equal to the width of the display screen width ÷ the optimal width, and may be calculated by rounding off.

[0230] In another example, the number of columns n is related to the device type of the electronic device, for example, the number of columns n of a two-fold folding mobile phone is 2, the number of columns n of a three-fold folding mobile phone is 3, the number of columns n of a tablet computer is 3, and so on.

[0231] After the number of columns n for column display is determined, the display screen of the electronic device can also be divided into n display areas from left to right. In any two adjacent display areas, the right edge of the previous display area is connected to the left edge of the next display area. The height of each display area is equal to the height of the display screen.

[0232] In some embodiments, the electronic device may set a default width ratio of n display areas and use it to determine the width of each display area. For example, the electronic device may set the width of each display area to be equal. For example, when the number of columns n=2, the electronic device may set the width ratio of two display areas in the display screen to 1:1.

[0233] In other implementations, the electronic device may also adaptively adjust the proportions of the display areas based on the size, format, etc. of the content to be displayed in the first page, which is not limited here.

[0234] The widths of the n display areas in the display screen can be the same or different, and there is no limitation here. If the widths of the display areas are the same or similar, it can be ensured that the width of each display area is not much different from the optimal width, and each column can present a good visual effect to the user.

[0235] Step 2, measure.

[0236] The purposes of measurement include any one or more of the following:

[0237] (1) Determine the size of the container for holding the first page.

[0238] In some embodiments, the area of ​​the container is the same as the full screen area of ​​the display screen. The aspect ratio of the container needs to be re-determined according to the size of the n display areas in the display screen. In some embodiments, the width of the container is 1 / n of the width of the display screen, and the height is n times the height of the display screen. For example, assuming that the aspect ratio of the display screen of the electronic device is 2000*2000, and the number of columns n=2, the aspect ratio of the container determined to carry the display screen content can be modified to 1000*4000 based on the aspect ratio of the display screen. The units of the above-mentioned size values ​​are pixels.

[0239] In other embodiments, the width of the container is 1 / n of the width of the display screen, but the height of the container also needs to take into account the system content. The content provided by the system may include a status bar, a navigation bar, etc. The sum of the size of the container and the size of the system content may be the same as the full screen area of ​​the display screen. This is described below.

[0240] Whether the electronic device displays the status bar and the manner in which the status bar is displayed may depend on the default settings or user settings of the device, and may also depend on the settings of the currently displayed application.

[0241] If the status bar is displayed, the status bar can be displayed in an overlay manner above the page content provided by the application, which can be either a transparent overlay or a non-transparent overlay. When the status bar is displayed in an overlay manner, the electronic device can still measure the container at n times the height.

[0242] Alternatively, the status bar can also be displayed in a mosaic above the page content provided by the application. When the status bar is displayed in a mosaic, if the status bar is only located above a single column, the electronic device can use n times the height minus the value of the status bar height as the height of the container. If the status bar is located above all columns, the electronic device can use n times the height minus n*the value of the status bar height as the height of the container.

[0243] Whether an electronic device displays a navigation bar, and how the navigation bar is displayed, may depend on the default settings or user settings of the device, or on the settings of the currently displayed application. The navigation bar may include a back button, a home button, a multitasking button, etc. The display logic of the navigation bar and the status bar is similar, the difference is that the status bar is displayed at the top, while the navigation bar is displayed at the bottom. For the impact of the navigation bar on the height of the container, please refer to the relevant description and extension of the status bar.

[0244] (2) Obtain the page content to be displayed in the first page.

[0245] The first page may be a long page. Even if it is displayed in columns, the multiple columns displayed by the electronic device are not enough to display all the contents of the first page. Therefore, it is necessary to first determine the page content of the first page that can be displayed on the display screen at one time.

[0246] The electronic device can obtain the page content to be displayed according to the container size determined in (1) above. For example, starting from the top page header of the first page, the page content that is the same height as the container (such as page content with n times the height) is determined as the page content to be displayed. In other embodiments, the electronic device can adjust within a certain range before and after the n times the height value of the display screen to compensate for the deviation caused by scaling and layout adjustment when the electronic device displays n columns of content.

[0247] In some implementations, the first page may contain non-slidable content such as a fixed header and a fixed footer, which may affect the page content that needs to be displayed by the electronic device.

[0248] Whether the first page includes a fixed footer may depend on the settings of the first application. If the first page includes a fixed footer, and the fixed footer is located below a single column, the electronic device may start from the page header, obtain the page content with the container height, and then replace the bottom of the obtained page content with the fixed footer, and the obtained page content is the page content that the electronic device needs to display. If the fixed footer is located below n columns, the electronic device may start from the page header, obtain the page content that is n times the container height minus n*fixed footer height, and then add the fixed footer, which is the page content that the electronic device needs to display.

[0249] The fixed head and fixed tail are similar and will not be described here.

[0250] The first page may also be a short page, and the height of the page content measured by the electronic device to be displayed may be greater than the height of the entire first page. In this case, the electronic device can use the entire content of the first page as the page content to be displayed. In addition, in this case, among the contents displayed in columns, the latter columns contain some blank areas.

[0251] (3) The electronic device places the page content to be displayed determined by (2) into the container of (1).

[0252] During this process, the electronic device can also adaptively adjust one or more of the position, size, margin (outer margin), padding (inner margin), scale (zoom ratio), offset, etc. of each page element in the container. For example, the size of each page element in the container can be the same as the size described by the page structure of the first page, or scaled on this basis. The position of each page element in the container is also affected by the status bar, navigation bar provided by the system, and the fixed header and fixed footer provided by the first application.

[0253] Step 3, layout.

[0254] The layout process can include at least the following operations:

[0255] A. Adjust the hierarchical structure (including parent-child node relationships)

[0256] In some implementations, the electronic device may identify the hierarchical relationship of the measured page content in the first page, which is equivalent to the electronic device adjusting the structure of the view tree of the first page after layout.

[0257] like Figure 6 As shown on the right, it shows an example of how to adjust the view tree. Figure 6 As shown, the adjustment process may include:

[0258] Generate LongScreenView to carry the page content of the first page; place the page content to be displayed measured by the electronic device into LongScreenView; map events for page elements in the second and subsequent columns to SurfaceView to ensure normal event distribution; insert LongScreenView into the root view (RootView).

[0259] LongScreenView can be regarded as a container that carries nodes, and is used to display and draw the page content of the first page to be presented on the display screen. The size of LongScreenView is equal to the container size determined above. LongScreenView can also be called other names, which are not limited here. SurfaceView is a drawing view, which is used to obtain data and draw images. RootView is the manager of the view root node DecorView, and is the operator that implements measurement, layout, and drawing. It is also responsible for communicating with the window manager service (windowmanagerservice, WMS).

[0260] Figure 6 The names of the nodes are only examples and do not constitute a limitation to this application.

[0261] Above Figure 6 Among the nodes, RootView can be called the seventh node, ContentParent can be called the eighth node, and LongScreenView can be called the ninth node. One or more intermediate nodes may be included between RootView and LongScreenView, which is not limited here.

[0262] B. Map the contents displayed in the container to n display areas of the display screen in sequence.

[0263] The display area of ​​the n display areas in the display screen where each page element is located is determined by the position of the page element in the container. For example, if the page element is in the first 1 / n height range of the container, it is mapped to the first display area of ​​the display screen; if the page element is in the first 1 / n to 2 / n height range of the container, it is mapped to the second display area of ​​the display screen, and so on. The mapping process can be handled by the LongScreenView in the view tree mentioned above. Of course, if the display screen also needs to display system content such as the status bar and navigation bar, the display area of ​​the display screen to which each page element is mapped must also consider the height and position of the system content.

[0264] The above measurement and layout results determine that the electronic device can eventually display multiple columns, and the multiple columns can present a joint sliding effect.

[0265] The above measurement and layout processes may take into account one or more attributes such as inner margin, outer margin, zoom ratio, offset, etc. when the electronic device displays content. The above attributes may be set by the electronic device as needed.

[0266] Step 4, drawing.

[0267] The electronic device can draw the page content on the display screen according to the layout result. In addition, it can also decide whether to draw the system content of the status bar and the system bar in addition to the page content according to the structure of the first page, the setting of the electronic device or the setting of the user.

[0268] In some implementations, in addition to the above-mentioned page content, the electronic device may also determine whether to display system content, as well as the display method and location of the system content.

[0269] After the drawing is completed, the electronic device can display the first page after the layout is optimized using the optimization method 1 on the display screen. Specifically, the electronic device divides the measured page content to be displayed into n columns, and displays the n columns of content in order from left to right.

[0270] For example, reference Figure 2B , Figure 2B , Figure 2D , which respectively show the page contents displayed by a common mobile phone 100, a folding screen mobile phone 200, and a tablet computer 300 after optimizing the page layout according to optimization method 1. It can be seen that each electronic device optimizes the page layout according to optimization method 1, which can present the effect of truncating a page into several parts for display.

[0271] refer to Figure 6 , Figure 6 A schematic diagram of a scene of measurement, layout and drawing is shown exemplarily. Figure 6 Take the number of columns n=2 as an example.

[0272] like Figure 6 As shown on the left, when measuring, Figure 6 As shown in the first figure, the container measured by the electronic device is the left part of the first figure. The size of the container is about 1 / 2 the width and 2 times the height of the display screen. The content to be displayed measured by the electronic device includes the first part and the second part. Figure 6 As shown by the arrow in the first figure, the electronic device maps the content of the second part to the right area of ​​the display screen. Figure 6 As shown in the second figure, the electronic device draws the content on the display screen according to the layout results.

[0273] refer to Figure 7 , Figure 7 The flowchart of the electronic device from starting the activity to completing the drawing is shown as an example. Figure 7 The left branch of is the process of the electronic device optimizing the page layout using optimization method 1. It can be seen that the process of the electronic device optimizing the page layout and displaying multiple columns of content using optimization method 1 is supported by this activity.

[0274] Figure 7 addWindow in is used to create a window, which is used to hold the content drawn later. ViewRootImpt is used to create the root view. addview is used to create LongScreenView. DecorView is the root node of the view.

[0275] In some implementations, for the optimization method 1 in S105, there may be the following extension scheme: the bottom of the previous column and the top of the next column in adjacent columns may be the same, so as to present the association between adjacent columns to the user and facilitate the user to receive information. Based on this extension scheme, the measurement, layout, and drawing processes described above will also be adaptively adjusted, which will not be described in detail here.

[0276] In S105, if the electronic device displays the page content of the first page in two columns, the area on the left side of the display screen can be called the first area, and the area on the right side of the display screen can be called the second area. The right edge of the first area is connected to the left edge of the second area.

[0277] If the electronic device displays the page content of the first page in three columns, the area on the left side of the display screen can be called the first area, the area in the middle of the display screen can be called the second area, and the area on the right side of the display screen can be called the third area. The right edge of the first area is connected to the left edge of the second area, and the right edge of the second area is connected to the left edge of the third area.

[0278] The page content from the first page displayed in the first area can be called the first content, the page content from the first page displayed in the second area can be called the second content, and the page content from the first page displayed in the third area can be called the third content.

[0279] For example, Figure 2B The left area of ​​the middle display screen is the first area, and the first content includes page 20 - 1 ; the right area of ​​the display screen is the second area, and the second content includes page 20 - 5 and the fixed tail 202 .

[0280] For example, Figure 2DThe left area of ​​the middle display screen is the first area, and the first content includes page 20-1; the middle area of ​​the display screen is the second area, and the second content includes page 20-2; the right area of ​​the display screen is the third area, and the third content includes page 20-3.

[0281] S106: The electronic device receives a user operation acting on any column.

[0282] The user operation can be applied to any column, such as the first column, the second column, the third column, etc. The user operation can be applied to other areas except the status bar and the navigation bar.

[0283] The user operation may be an operation on a display screen, a voice command, a floating gesture, or other types.

[0284] When the user operation is an operation acting on the display screen, it may include a sliding operation (such as sliding up, sliding down, sliding to the left, sliding to the right, etc.), for example Figure 2B , Figure 2D The upward sliding operation shown in .

[0285] S107, the electronic device updates the displayed multiple columns of content in response to the user operation, so that the multiple columns present a joint sliding effect.

[0286] The electronic device can move the upper part of the content of the latter column in adjacent columns to the lower part of the previous column. Each column moves the content originally at the lower part to the upper part. For the first column among multiple columns, the upper part of the first column is no longer displayed. For the last column among multiple columns, the content of the first page provided by the first application that is located below the content displayed in the last column is refreshed to the bottom of the last column. The length of each column movement is related to the speed and sliding route of the user operation (such as a sliding operation).

[0287] For example, reference Figure 2B-2C The display screen of the foldable screen mobile phone 200 is equally divided into two display areas. The contents displayed in each of the two display areas can be referred to the accompanying drawings and the related description above. After the electronic device receives an upward sliding operation, it can present a joint sliding effect.

[0288] For example, reference Figure 2D-Figure 2E The display screen of the foldable screen mobile phone 200 is equally divided into three display areas. The contents displayed in each of the three display areas can be referred to the accompanying drawings and the related description above. After the electronic device receives an upward sliding operation, it can present a joint sliding effect.

[0289] In other implementations, the electronic device may also directly move the content of the latter column in the adjacent columns to the former column, and refresh the new content in the last column, so that the effect of updating the entire column can be presented.

[0290] In some implementations, after S106, the electronic device may re-execute the measurement, layout, drawing, and other operations in S105. During the measurement process, the measurement starting point is no longer the top header of the first page, but changes with the user operation. If the user operation is an upward sliding operation, the measurement starting point is a position below the top header of the first page. The distance between the position and the header may be related to the speed of the upward sliding operation, the sliding length, and the like.

[0291] S108, the electronic device optimizes the layout of the first page using optimization method 2, and then displays the optimized first page.

[0292] S108 may include the following sub-steps:

[0293] Step 1, determine the number of columns n to be displayed.

[0294] The number of columns n can be 2 or a larger value.

[0295] In some implementations, the electronic device may first obtain one or more information such as the width of the display screen and the device type of the electronic device, and then determine the number of columns n based on the one or more information. The wider the display screen, the larger the number of columns n may be.

[0296] After the number of columns n for column display is determined, the display screen of the electronic device can also be divided into n display areas from left to right. In any two adjacent display areas, the right edge of the previous display area is connected to the left edge of the next display area. The height of each display area is equal to the height of the display screen.

[0297] In some embodiments, the electronic device may set a default width ratio of n display areas and use it to determine the width of each display area. For example, when the number of columns n=2, the electronic device may set the width ratio of two display areas in the display screen to 3:2, 1:1, etc.

[0298] In other implementations, the electronic device may also adaptively adjust the proportions of the display areas based on the size, format, etc. of the content to be displayed in the first page, which is not limited here.

[0299] The widths of the n display areas in the display screen may be the same or different, and there is no limitation here.

[0300] Step 2, measure.

[0301] The purposes of measurement include any one or more of the following:

[0302] (1) Determine the size of the container for holding the first page.

[0303] In some embodiments, the area of ​​the container is the same as the full screen area of ​​the display screen. The aspect ratio of the container needs to be re-determined according to the size of the n display areas in the display screen. In some embodiments, the size of the container can be obtained by splicing the n display areas in the display screen of the electronic device from top to bottom.

[0304] In other implementations, the size of the container also needs to take into account the system content. The method for determining the size of the container can refer to the determination method in the above optimization method 1, which will not be expanded here.

[0305] (2) Obtain the page content to be displayed in the first page.

[0306] (3) The electronic device places the page content to be displayed determined by (2) into the container of (1).

[0307] The logic of this step (2) (3) is the same as that of the optimization method 1 mentioned above. Please refer to the relevant description in the optimization method 1 mentioned above.

[0308] Step 3, layout.

[0309] The layout process can include at least the following operations:

[0310] A. Adjust the hierarchical structure (including parent-child node relationships)

[0311] In some implementations, the electronic device can identify the key elements KeyView that need to be fixedly displayed and the elements that can be scrolled in the measured page content, and can adjust the hierarchical relationship between the two parts. This is equivalent to the electronic device adjusting the structure of the view tree of the first page after layout.

[0312] Among them, the key elements that need to be fixedly displayed may include but are not limited to any one or more of the following: images, videos, animated images, music playback interfaces, etc. in the scrollable area. In some embodiments, the size of the key elements that need to be fixedly displayed is greater than a threshold, and the threshold can be set by the electronic device as needed. For example, only when the size of the image, video, animated image, music playback interface, etc. is greater than half the size of the display screen, it is determined as a key element that needs to be fixedly displayed. Examples of elements that need to be fixedly displayed may include Figure 3A The pictures in the middle picture area 30-1, Figure 3D Video in the middle video area 31-1, Figure 3G The video of the middle video area 32-1.

[0313] The scrollable elements may include but are not limited to any one or more of the following: text (text) other than the key element KeyView that needs to be fixedly displayed in the scrollable area, comments, recommended content, etc. The comments content includes not only text, but also images, emoticons, symbols, etc. of the posting user. Examples of scrollable elements may include Figure 3A The text in the middle picture area 30-2, Figure 3D Recommended content in the middle video area 31-2, Figure 3G Comments in video area 32-1.

[0314] refer to Figure 8 , Figure 8 The following is an example of how to adjust the view tree. Figure 8 The image is the key element KeyView that needs to be displayed fixedly, and the content is the element that can be scrolled.

[0315] like Figure 8 As shown, the adjustment process includes the following steps:

[0316] First, an XSpecialLayout is generated to display the measured page content in multiple columns (such as left and right columns); the XSpecialLayout is added to the common parent node NestedScrollView, and the original part is used as a child node of the XSpecialLayout.

[0317] Specifically,

[0318] The electronic device obtains the node view (viewgroup) that currently needs to be adjusted②;

[0319] Get the information of the parent node parent and child nodes children of node ②;

[0320] Change the parent node parent of ② from ① to ③, and change the parent node parent of ③ to ①;

[0321] Add ③ to the information of ①'s child node children and delete ②;

[0322] Add ② to the information of ③’s child node children.

[0323] Then, move the key element KeyView (such as the image in the figure) that needs to be fixedly displayed upward to become a child node of XSpecialLayout. At this point, the adjustment is complete.

[0324] Figure 8The names of the nodes are only examples and do not constitute a limitation to this application.

[0325] like Figure 8 As shown, since the key element KeyView (such as the image in the figure) is no longer a child node of NestedScrollView and is therefore not in the sliding container, the subsequent key element KeyView will not slide synchronously with the sliding display of the content in the sliding container, but will remain in a fixed position.

[0326] XSpecialLayout can be regarded as a container for carrying nodes, and is used to display and draw the page content of the first page to be presented on the display screen. The size of XSpecialLayout is equal to the container size determined above.

[0327] Figure 8 Among the nodes shown, NestedScrollView and LinearLayout can be collectively referred to as the first node, image can be referred to as the second node, content can be referred to as the third node, and the newly added XSpecialLayout can be referred to as the fourth node. In addition, NestedScrollView can be referred to as the fifth node, and LinearLayout can be referred to as the sixth node.

[0328] In some implementations, the NestedScrollView and LinearLayout may further include one or more intermediate nodes, which is not limited here.

[0329] refer to Fig. 9 , Fig. 9 The following example shows the view tree description code of a page and the partial view tree description code after adjusting the hierarchical structure. It can be seen that adjusting the hierarchical structure of a page means adjusting the view tree structure of the page. Fig. 9 As shown on the left, before the adjustment, ScrollPageLayout included RelativeLayout, that is, the KeyView that needs to be fixedly displayed was not included in the sliding container; after the adjustment, XSpecialLayout was added, and ScrollPageLayout and RelativeLayout are both child nodes of XSpecialLayout. The two are at the same level and are no longer in a relationship of inclusion and being included.

[0330] B. Map the contents displayed in the container to n display areas of the display screen in sequence.

[0331] The n display areas of an electronic device can be divided into fixed areas and slidable areas. The fixed area refers to the area used to display the key element KeyView, and the slidable area refers to the area used to display the scrollable display element. The number of fixed areas and slidable areas can be one or more. For example, when n=2, the display screen can be divided into a left area and a right area, the left area is set as a fixed area, and the right area is set as a slidable area, and of course it can also be vice versa. The positions of the fixed area and the slidable area in the display screen can be set by the electronic device by default or as needed. For another example, when the number of slidable areas is multiple, the multiple slidable areas can display the multiple columns provided by optimization method 1 and present the effect of multiple columns sliding together, which is equivalent to optimization method 1 and optimization method 2 can be implemented in combination.

[0332] Examples of fixed areas may include: Figure 3B Area 30-3, Figure 3E Area 31-3 in Fig. 3I Area 32-4, etc.

[0333] Examples of swipeable areas may include: Figure 3B Area 30-4, Figure 3E Area 31-4, Fig. 3I Area 32-5, etc.

[0334] The electronic device can map the key element KeyView that needs to be fixedly displayed to a fixed area of ​​the display screen. In a specific example, the key element KeyView can be laid out in the center of the display area on the left side of the display screen and displayed in a maximized manner. When the key element KeyView is mapped to a fixed area of ​​the display screen, certain deformation and scaling can be performed. Whether the key element KeyView can be deformed and scaled can be constrained by the application developer.

[0335] The electronic device may map a scrollable displayed element into a slidable area.

[0336] The above measurement and layout processes may take into account one or more attributes such as inner margin, outer margin, zoom ratio, offset, etc. when the electronic device displays content. The above attributes may be set by the electronic device as needed.

[0337] In some implementations, the electronic device may also measure and layout by region. For example, taking the number of columns n=2 as an example, the electronic device may measure and layout for the left display region and for the right display region respectively.

[0338] The above measurement and layout results determine that the electronic device can eventually display multiple columns, and the multiple columns can present an effect in which some columns are fixed and some columns are slidable.

[0339] Step 4, drawing.

[0340] The electronic device can draw the page content on the display screen according to the layout result. In addition, it can also decide whether to draw the system content of the status bar and the system bar in addition to the page content according to the structure of the first page, the setting of the electronic device or the setting of the user.

[0341] refer to Figure 7 , Figure 7 The following example shows the process of an electronic device from starting an activity to completing drawing. Figure 7 The right branch of exemplifies the process of optimizing the page layout of the electronic device using optimization method 2 when the number of columns n=2. During the measurement, layout, and drawing process of optimization method 2, it is determined whether the current node is a newly added XSpecialLayout each time. If so, the subsequent steps will be executed. The process of optimizing the page layout and displaying multiple columns of content by the electronic device using optimization method 2 is supported by the same activity.

[0342] After the drawing is completed, the electronic device can display the first page after the layout is optimized using optimization method 2 on the display screen. Figure 3B , the display screen of the electronic device is equally divided into two areas: area 30-3 and area 30-4. The image displayed in area 30-3 is a key element KeyView that needs to be fixedly displayed, which is located in the center of the area and is reduced compared to page 30.

[0343] refer to Figure 3E , the display screen of the electronic device is divided into two areas at a ratio of about 2:1: area 31-3 and area 31-4. The video displayed in area 31-3 is a key element KeyView that needs to be fixedly displayed, located in the center of the area and reduced compared to page 31. The content displayed in area 31-4 is reduced as a whole compared to page 31.

[0344] refer to Fig. 3I , the display screen of the electronic device is equally divided into two areas at a ratio of about 3:2: area 32-4 and area 32-5. The key element KeyView of the picture displayed in area 32-4 needs to be fixedly displayed, which is located in the center of the area and is reduced compared to page 30.

[0345] refer to Fig.10 , Fig.10 The comparative effect of displaying the same page before and after using the optimization method 2 provided in the present application is exemplified.

[0346] In S108, if the electronic device displays the page content of the first page in two columns, the area on the left side of the display screen can be called the first area, and the area on the right side of the display screen can be called the second area. The right edge of the first area is connected to the left edge of the second area.

[0347] The page content from the first page displayed in the first area may be referred to as the first content, and the page content from the first page displayed in the second area may be referred to as the second content.

[0348] For example, Figure 3B The left area 30-3 of the middle display screen is the first area, and the first content includes the pictures in the area; the right area 30-4 of the display screen is the second area, and the second content includes the description content and comments in the area.

[0349] For example, Figure 3E The left area 31 - 3 of the middle display screen is the first area, and the first content includes the video in the area; the right area 31 - 4 of the display screen is the second area, and the second content includes the recommended content in the area.

[0350] For example, Fig. 3I The left area 32-4 of the middle display screen is the first area, and the first content includes the video in the area; the right area 32-5 of the display screen is the second area, and the second content includes the comments in the area.

[0351] S109, the electronic device receives a user operation acting on the slidable area.

[0352] S110, the electronic device updates the content of the slidable area in response to the user operation, and does not change the content of the fixed area in response to the user operation.

[0353] The user operation acting on the slidable area may be an operation on the display screen, a voice command, a floating gesture, or other types.

[0354] When the user operation is an operation acting on the display screen, it may include a sliding operation (such as sliding up, sliding down, sliding to the left, sliding to the right, etc.), for example Figure 3B The upward sliding operation acting on the area 30-4, Figure 3E The action shown in FIG. 31 is to slide up in area 31-4, Fig. 3I The action shown in FIG. 1 is an upward sliding operation on area 32 - 4 .

[0355] The electronic device updates the content of the slidable area in response to the user operation in a manner that can refer to the manner of updating any single column of content in S107 above, and Figure 3A-3J Related description.

[0356] This user operation is not used to change the content of the fixed area. For example, the content of the fixed area does not slide with the sliding operation or other operations received in the slidable area, but remains fixed. In this way, the user can slide to view other content in the scrollable area while viewing the pictures, videos, animated pictures, and music playback interface in the fixed area.

[0357] In some implementations, after S109 , the electronic device may re-execute the measurement, layout, drawing and other operations in S108 to update the content of the slidable area.

[0358] In some implementations, the content of a fixed area may also be updated in any of the following situations:

[0359] 1. After receiving a user operation, the electronic device can update its content in response to the operation on the fixed area. For example, Figure 3B After receiving the left sliding operation in the area 30-3, the electronic device can update the picture displayed in the area 30-3. Figure 3E Area 31-3 in Fig. 3I 32-4 in can receive an operation for adjusting the video progress, and the electronic device can adjust the video progress according to the operation.

[0360] 2. If a fixed area is used to display a video being played, the content of the fixed area is played over time, which can also be considered as a content update.

[0361] In some implementations, the position of the key element KeyView in the fixed area can also be adjusted according to user operations. Figure 3B After the picture in the area 30-3 in the image is slid upward, the electronic device can move the picture position in the area upward. Figure 3E Area 31-3 in Fig. 3I After selecting the video in 32-4 in the image and sliding upward, the electronic device can move the video position in the area upward.

[0362] In some implementations, the electronic device can simultaneously refresh the content of the fixed area and the slidable area in response to a user operation on the fixed area. Figure 3I-3J In the short video scene shown, when the user inputs an upward sliding operation in area 32-4 on the left side of the display screen, the electronic device can refresh the short video displayed in area 32-4 and simultaneously update the content of area 32-5 to the comments corresponding to the new short video. In this case, it is equivalent to the electronic device obtaining a new first page and performing layout optimization on the new first page in optimization mode 2 before displaying it.

[0363] based on Figure 4 The page layout method shown makes full use of the advantages of large-size display screens, which can increase the information density output by the display screen of the electronic device, thereby increasing the amount of information output, thereby improving the utilization rate of the display screen. The electronic device displays the content of the same page in full screen, which can also bring an exclusive full-screen experience. In addition, the electronic device optimizes the page layout and provides a system-level page layout solution, which does not require application developers to adapt to devices of different sizes or categories, and can reduce the adaptation workload of developers on devices of different sizes. Therefore, this method can reduce the development cost of the application while ensuring the page effect.

[0364] refer to Fig.11 , Fig.11 The flow of another page layout method provided by an embodiment of the present application is exemplarily shown. The method is executed by an electronic device.

[0365] like Fig.11 As shown, the following steps may be specifically included:

[0366] S201, running a first application.

[0367] S202: Obtain a view tree structure of a first page in a first application.

[0368] S203: Adjust the view tree structure of the first page.

[0369] S204, according to the adjusted view tree structure of the first page, display the first content in the first area of ​​the display screen, and display the second content in the second area of ​​the display screen, wherein the right edge of the first area is connected to the left edge of the second area, the first content and the second content are both from the first page, and the first content is located above the second content in the first page.

[0370] Fig.11 The page layout method shown can be seen as Figure 4 A simplified version of the above steps can be found in Figure 4 And related text introduction.

[0371] S201 can be referenced Figure 4 S101. The first application may be a system application or a third-party application. The electronic device may run the first application in response to a user operation, and the embodiment of the present application does not limit the type of the user operation.

[0372] The view tree structure of the first page in S202 may refer to the relevant introduction in S102, and S203 may refer to S105 or S108.

[0373] Fig.11The page layout method shown provides a system-level page layout solution. Application developers do not need to adapt for devices of different sizes or categories. By adjusting the view tree structure, electronic devices can make full use of the display screen to display different contents of the same page in the same application, thereby improving the output information density and the output information volume, thereby improving the user's device usage experience.

[0374] In some implementations, the electronic device may execute S203 to adjust the view tree structure of the first page in any of the following situations: detecting that the display screen is switched from a folded state to an unfolded state; or detecting that the electronic device is switched from a vertical screen state to a horizontal screen state. In this way, after the display screen state is switched, the electronic device can use the display screen to increase the amount of information output.

[0375] In some implementations, the electronic device includes an application framework layer, and the electronic device may execute S203 through the application framework layer to adjust the view tree structure of the first page.

[0376] In some implementations, the electronic device may execute S203 to adjust the view tree structure of the first page in any of the following situations:

[0377] 1. A first application or a first page is searched from a pre-stored first list, where the first list is used to indicate an application or page for which page layout optimization is required.

[0378] The first list is preset in the electronic device. The format and content of the first list can be referred to Figure 4 Related description of method 1 in S103.

[0379] 2. Obtain configuration information of the first application, where the configuration information of the first application is used to instruct the electronic device to optimize the layout of the first page.

[0380] The configuration information is provided by the first application. The form and content of the configuration information can be found in Figure 4 Related description of method 2 in S103.

[0381] 3. A user operation for triggering the electronic device to optimize the layout of the first page is detected.

[0382] There are many ways to implement this user operation. Figure 4 Related description of method 4 in S103.

[0383] In some implementations, the electronic device may further perform any one or more of the following:

[0384] 1. Displaying a status bar on the display screen, wherein the status bar is located at the top of the first area and the second area, or is located only at the top of the first area.

[0385] 2. Displaying a navigation bar on the display screen, wherein the navigation bar is located at the bottom of the first area and the second area, or only at the bottom of the second area.

[0386] 3. Display the header of the first page on the display screen, with the header located at the top position outside the status bar in the first area and the second area, or only located at the top position outside the status bar in the first area; of course, if the status bar is not displayed, the header is located at the top position of the first area and the second area, or only located at the top position of the first area.

[0387] 4. Display the tail of the first page on the display screen, with the tail located at the bottom outside the navigation bar in the first area and the second area, or only at the bottom outside the navigation bar in the second area; of course, if the navigation bar is not displayed, the tail is located at the bottom of the first area and the second area, or only at the bottom of the second area.

[0388] Whether the electronic device displays the status bar, navigation bar, page header, and page footer, and how to display the status bar, navigation bar, page header, and page footer, can refer to the relevant description of the above UI embodiment, and Figure 4 Related description in method embodiment.

[0389] With respect to S203, the present application embodiment provides two methods for adjusting the view tree structure:

[0390] The second optimization method:

[0391] Using the second optimization method, the view tree of the first page provided by the first application obtained by the electronic device may include: a first node, a second node, and a third node; wherein the second node and the third node are both child nodes of the first node, the second node includes the first content, and the third node includes the second content. In addition, the electronic device may adjust the view tree structure of the first page through the following steps: generating a fourth node and adding the fourth node as the parent node of the first node; adjusting the second node from a child node of the first node to a child node of the fourth node, and the fourth node is used to display the first content carried by the second node in the first area, and the second content carried by the third node in the second area.

[0392] In some embodiments, the first node specifically includes: a fifth node and a sixth node, wherein the sixth node is a child node of the fifth node, and the second node and the third node are both child nodes of the sixth node; the fifth node is used to carry the content that can be slidably displayed in the first page, and the sixth node is used to arrange the content carried by the fifth node in a vertical manner. Adding the fourth node as the parent node of the first node and adjusting the second node from a child node of the first node to a child node of the fourth node specifically includes: adding the fourth node as the parent node of the fifth node and adjusting the second node from a child node of the sixth node to a child node of the fourth node.

[0393] In some implementations, after adjusting the view tree structure of the first page using the second optimization method and executing S204, the electronic device can also detect a sliding operation on the second area, slide the second content displayed in the second area, and keep the position of the first content in the first area unchanged. In this way, the electronic device can present an effect in which the content of some areas is fixed and the content of the remaining areas can be slidably displayed, so that the user can view the fixed content in some areas.

[0394] In some implementations, after adjusting the view tree structure of the first page using the second optimization method and executing S204, the electronic device can also detect the user operation acting on the first area, adjust the content displayed in the first area, and keep the second content in the second area unchanged. In this way, the non-sliding area can also interact with the user.

[0395] In some embodiments, the first content includes any one or more of the following: pictures, videos, animated pictures, or music playback interfaces; and / or the second content includes any one or more of the following: description information, comments, or recommended content for the first content. This makes it easier for users to view pictures, videos, animated pictures, or music playback interfaces in a fixed area.

[0396] In some implementations, the electronic device can adjust the view tree structure of the first page using the second optimization method after recognizing that both the first content and the second content can be displayed slidably in the first page provided by the first application, and the size of the first content in the first page is larger than the first size. This can avoid fixedly displaying the smaller-sized content in the first area.

[0397] In some embodiments, the view tree structure of the first page is adjusted using the second optimization method, and when S204 is executed, the heights of the first area and the second area are the same and both equal to the height of the display screen, and the sum of the widths of the first area and the second area equals the width of the display screen, which is equivalent to dividing the display screen into multiple areas in the horizontal direction to display different contents.

[0398] In some embodiments, the view tree structure of the first page is adjusted using the second optimization method, and when S204 is executed, the width of the first area is greater than the width of the second area, which is equivalent to making the first area for displaying fixed content wider than the second area for displaying second content, so that the user can view the fixed content in the first area more conveniently.

[0399] In some implementations, the view tree structure of the first page is adjusted using the second optimization method, and when S204 is executed, the first content is located in the center of the first area. This also allows the user to view the first content more conveniently, presenting a better display effect.

[0400] In some implementations, the electronic device may adjust the view tree structure of the first page using the second optimization method in any of the following situations:

[0401] 1. Query the second optimization method for the first application or the first page from the pre-stored optimization information.

[0402] The optimization information may be pre-stored in the electronic device. The form and function of the optimization information may refer to Figure 4 Related description of method 1 in S104.

[0403] 2. Obtain optimization information provided by the first application, where the optimization information provided by the first application is used to indicate a second optimization method for the first application or the first page.

[0404] The optimization information may be provided by the first application. The form and function of the optimization information may be referred to in Figure 4 Related description of method 2 in S104.

[0405] 3. A user operation for selecting the second optimization mode is detected.

[0406] There are many ways to implement this user operation. Figure 4 Related description of method 4 in S104.

[0407] Regarding the solution of adjusting the view tree structure of the first page using the second optimization method, a detailed example is listed below to assist in the explanation:

[0408] The first page can be referenced Figure 3A Page 30 shown, the first area can refer to Figure 3B The first content of the area 30-3 shown in FIG. 30-3 includes the picture displayed in the area 30-3; the second area can refer to Figure 3B As shown in the area 30 - 4 , the second content includes description content and comments displayed in the area 30 - 4 .

[0409] The first page can also refer to Figure 3DPage 31 shown, the first area can refer to Figure 3E The first content includes a video displayed in the area 31-3; the second area can refer to Figure 3E As shown in the area 31 - 4 , the second content includes recommended content displayed in the area 31 - 4 .

[0410] The first page can also refer to Figure 3G Page 32 shown, the first area can refer to Fig. 3I The first content of the area 32-4 shown in FIG. 32-4 includes a video displayed in the area 32-4; ​​the second area can refer to Fig. 3I As shown in the area 32 - 5 , the second content includes comments displayed in the area 32 - 5 .

[0411] The original view tree structure of the first page can be referenced Figure 8 The leftmost figure shows the adjusted view tree structure. Figure 8 The rightmost figure shows an example of using the second optimization method to adjust the view tree structure of the first page. You can also refer to Fig. 9 The view tree code before and after the adjustment is shown.

[0412] The first optimization method:

[0413] Using the first optimization method, the view tree of the first page obtained by the electronic device may include: a seventh node and an eighth node, wherein the eighth node is a child node of the seventh node, and the eighth node includes the first content and the second content. In addition, the electronic device may adjust the view tree structure of the first page through the following steps: generating a ninth node; adding the ninth node as a child node of the seventh node; adjusting the eighth node from a child node of the seventh node to a child node of the ninth node, and the ninth node is used to display the first content carried by the eighth node in the first area, and the second content carried by the eighth node in the second area.

[0414] In some embodiments, the width of the ninth node is equal to 1 / 2 of the width of the display screen, and the height of the ninth node is equal to 2 times the height of the display screen, or the width of the ninth node is equal to 1 / 3 of the width of the display screen, and the height of the ninth node is equal to 3 times the height of the display screen.

[0415] In some implementations, after adjusting the view tree structure of the first page using the first optimization method and executing S204, the electronic device may also detect a sliding operation applied to the first area or the second area, slide the first content displayed in the first area, and simultaneously slide the second content displayed in the second area. In other words, the electronic device may present a multi-column joint sliding effect.

[0416] In some implementations, the electronic device may use a first optimization method to adjust the view tree structure of the first page after recognizing that both the first content and the second content can be slidably displayed on the first page provided by the first application.

[0417] In some embodiments, the view tree structure of the first page is adjusted using the first optimization method, and when S204 is executed, the height of the first area and the second area are the same, and both are equal to the height of the display screen; the width of the first area and the second area are the same, and both are equal to 1 / 2 of the width of the display screen, which is equivalent to dividing the display screen into two equal parts to display the first content and the second content.

[0418] In some embodiments, when the view tree structure of the first page is adjusted using the first optimization method and S204 is executed, the third content can also be displayed in the third area of ​​the display screen, the left edge of the third area is connected to the right edge of the second area, and the third content is located below the second content in the first page; wherein the heights of the first area, the second area, and the third area are the same and are equal to the height of the display screen; the widths of the first area, the second area, and the third area are the same and are equal to 1 / 3 of the width of the display screen. This is equivalent to dividing the display screen into three equal parts to display the first content, the second content, and the third content.

[0419] In some implementations, the electronic device may adjust the view tree structure of the first page using the first optimization method in any of the following situations:

[0420] 1. Query the first optimization method for the first application or the first page from the pre-stored optimization information.

[0421] The optimization information may be pre-stored in the electronic device. The form and function of the optimization information may refer to Figure 4 Related description of method 1 in S104.

[0422] 2. Obtain optimization information provided by the first application, where the optimization information provided by the first application is used to indicate a first optimization method for the first application or the first page.

[0423] The optimization information may be provided by the first application. The form and function of the optimization information may be referred to in Figure 4 Related description of method 2 in S104.

[0424] 3. A user operation for selecting the first optimization mode is detected.

[0425] There are many ways to implement this user operation. Figure 4 Related description of method 4 in S104.

[0426] Regarding the solution of adjusting the view tree structure of the first page using the first optimization method, a detailed example is listed below to assist in the explanation:

[0427] The first page can be referenced Figure 2A Page 20 is shown.

[0428] The first area can refer to Figure 2B In the left area of ​​the middle display screen, the first content includes page 20 - 1 ; the second area can refer to the right area of ​​the display screen, and the second content includes page 20 - 5 and a fixed tail 202 .

[0429] The first area can also refer to Figure 2D In the left area of ​​the middle display screen, the first content includes page 20-1; the second area can also refer to the middle area of ​​the display screen as the second area, and the second content includes page 20-2; the third area can refer to the right area of ​​the display screen, and the third content includes page 20-3.

[0430] The original view tree structure of the first page and the adjusted view tree structure can be referenced Figure 6 The picture on the far right and the related text description in the previous text.

[0431] The above-mentioned implementation modes can be combined arbitrarily to achieve different technical effects.

[0432] refer to Fig.12 , Fig.12 The hardware structure diagram of the electronic device 1100 provided in the embodiment of the present application. The electronic device 1100 can be used to execute the page layout method described above. The electronic device 1100 can be any electronic device mentioned above, such as a folding screen mobile phone 200, a tablet computer 300, etc.

[0433] like Fig.12As shown, the electronic device 1100 may include: the electronic device 1100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

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

[0435] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0436] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

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

[0438] The wireless communication function of the electronic device 1100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

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

[0440] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniled, microled, micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0441] The display screen 194 may be a folding display screen, for example, an inner folding screen or an outer folding screen, a horizontal inner folding screen, a horizontal outer folding screen, a vertical inner folding screen, a pull-out screen or a scroll screen, etc. There may be many folding principles for the folding display screen 194, which are not limited in the embodiments of the present application.

[0442] The electronic device 1100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0443] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 1100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0444] Video codecs are used to compress or decompress digital videos. The electronic device 1100 may support one or more video codecs. Thus, the electronic device 1100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0445] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 1100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0446] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0447] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.

[0448] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; can be divided into universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.

[0449] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0450] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0451] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 1100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

[0452] The electronic device 1100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0453] In the embodiment of the present application, the processor 110 may be used to execute Figure 4 S101-S104 in the method embodiment. The processor 110 (eg, GPU) may be used to execute S105 an operation of optimizing the layout of the first page using optimization method 1, or to execute S107 an operation of optimizing the layout of the first page using optimization method 2.

[0454] The display screen 194 is used to display the first page optimized by using the optimization method 1 or the optimization method 2. The content displayed by the display screen 194 can refer to the user interface in the above UI embodiment.

[0455] The display screen 194 and other information receiving components (such as the microphone 170C, etc.) can be used to receive user operations. The processor 110 (such as a GPU) and the display screen 194 can also be used to update the displayed content according to the user operations.

[0456] The internal memory 121 may be used to store a preset whitelist, configuration information provided by the first application, preset optimization information, optimization information provided by the first application, and user setting information, etc.

[0457] The specific operations performed by the various components of the electronic device 1100 can be referred to the relevant description above and will not be repeated here.

[0458] The electronic device 1100 may be configured with a software operating system (OS), which may include but is not limited to etc.

[0459] The software system of the electronic device 1100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The present application embodiment takes a mobile operating system with a layered architecture as an example to exemplify the software structure of the electronic device 1100.

[0460] Fig.13 It is a software structure block diagram of the electronic device 1100 according to an embodiment of the present application.

[0461] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the mobile operating system is divided into four layers, from top to bottom: application layer, program framework layer / core service layer, underlying library and runtime, and kernel layer.

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

[0463] like Fig.13 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0464] The program framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The program framework layer includes some predefined functions.

[0465] like Fig.13 As shown, the program framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

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

[0467] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

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

[0469] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).

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

[0471] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0472] The runtime can refer to all code libraries, frameworks, etc. required for the program to run. For example, for the C language, the runtime includes a series of function libraries required for the C program to run. For the Java language, in addition to the core library, the runtime also includes the virtual machine required for the Java program to run. The above core library may include the function functions that the Java language needs to call.

[0473] The underlying library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

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

[0475] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

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

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

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

[0479] In the embodiments of the present application:

[0480] The application program layer may include a first application, and the first application may be a third-party application or a system application.

[0481] The program framework layer mainly includes dynamic layout optimization plug-ins. The dynamic layout optimization plug-in can include the following three parts:

[0482] 1. Scene Recognition Module

[0483] The scene recognition module is used to determine whether to optimize the page and the optimization method to be used. The scene recognition module may further include:

[0484] A configuration management algorithm, used to determine whether to optimize the page and the optimization method to be used based on information preset by the electronic device (such as a whitelist, optimization information) or information provided by the first application (such as configuration information, optimization information);

[0485] Page analysis algorithm, used to analyze the page structure and determine the optimization method for the page according to the page structure;

[0486] The user selection algorithm is used to determine whether to optimize the page and the optimization method to be used based on user operations.

[0487] 2. Layout optimization module

[0488] The layout optimization module is responsible for optimizing the layout of the page using the corresponding optimization method, including measurement, layout, drawing, etc. The layout optimization module may further include:

[0489] View tree optimization algorithm, used to generate corresponding new nodes and adjust the view tree structure;

[0490] Display correction algorithm is used to analyze page layout and adaptively correct properties such as margin (outer margin), padding (inner margin), scale (zoom ratio) to optimize page layout.

[0491] 3. Event Mapping Module

[0492] The event mapping module is used to intercept and map necessary events to ensure correct event distribution.

[0493] The system framework layer may also include a UI system and an input management system.

[0494] The UI system includes a view system, which can be used to complete measurement, layout, drawing and other tasks with the support of dynamic layout optimization plug-ins.

[0495] The input management system includes an input manager for managing input events received by the electronic device. The event mapping module can send the mapping results of the input events to the input manager so that the input manager can respond to these events. The event mapping module and the dynamic layout optimization plug-in can both be located in the view Ext system.

[0496] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0497] The present application also provides an electronic device, which may include: a memory and a processor, wherein the memory may be used to store a computer program; and the processor may be used to call the computer program in the memory, so that the electronic device executes the method of any one of the above embodiments.

[0498] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the electronic device in any of the above embodiments.

[0499] In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.

[0500] The chip system may be composed of the chip, or may include the chip and other discrete devices.

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

[0502] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, 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 may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.

[0503] Exemplarily, the chip system can 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 microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0504] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which enables a computer to execute the method executed by the electronic device in any of the above embodiments when the computer program is executed.

[0505] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device in any of the above embodiments.

[0506] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.

[0507] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.

[0508] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0509] In short, the above is only an embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of this application shall be included in the protection scope of this application.

Claims

1. A page layout method, characterized in that: The method is applied to an electronic device, and the method comprises: Run the first application; Obtaining a view tree structure of a first page in the first application; Adjusting the view tree structure of the first page; According to the adjusted view tree structure of the first page, first content is displayed in a first area of ​​a display screen, and second content is displayed in a second area of ​​the display screen, wherein a right edge of the first area is connected to a left edge of the second area, the first content and the second content are both from the first page, and the first content is located above the second content in the first page.

2. The method according to claim 1, characterized in that Before adjusting the view tree structure of the first page, the method further includes: Detecting that the display screen switches from a folded state to an unfolded state; or, It is detected that the electronic device switches from a portrait mode to a landscape mode.

3. The method according to claim 1 or 2, characterized in that: The electronic device includes an application framework layer, and the electronic device adjusts the view tree structure of the first page through the application framework layer.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: detecting a sliding operation on the second area; The second content displayed in the second area is slid, and the position of the first content in the first area is kept unchanged.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: detecting a user operation acting on the first area; The content displayed in the first area is adjusted, and the second content in the second area is kept unchanged.

6. The method according to any one of claims 1 to 5, characterized in that: The view tree of the first page includes a first node, a second node, and a third node; wherein the second node and the third node are both child nodes of the first node, the second node includes the first content, and the third node includes the second content; The adjusting the view tree structure of the first page specifically includes: Generate a fourth node, and add the fourth node as a parent node of the first node; The second node is adjusted from a child node of the first node to a child node of the fourth node, and the fourth node is used to display the first content carried by the second node in the first area, and to display the second content carried by the third node in the second area.

7. The method according to claim 6, characterized in that The first node specifically includes: a fifth node and a sixth node, wherein the sixth node is a child node of the fifth node, and the second node and the third node are both child nodes of the sixth node; the fifth node is used to carry the content that can be slidably displayed in the first page, and the sixth node is used to arrange the content carried by the fifth node in a vertical manner; Adding the fourth node as a parent node of the first node and adjusting the second node from a child node of the first node to a child node of the fourth node specifically includes: The fourth node is added as a parent node of the fifth node, and the second node is adjusted from a child node of the sixth node to a child node of the fourth node.

8. The method according to any one of claims 1 to 7, characterized in that: The first content includes any one or more of the following: pictures, videos, animated pictures or music playback interface; and / or, The second content includes any one or more of the following: description information, comments or recommended content for the first content.

9. The method according to any one of claims 1 to 8, characterized in that: Before adjusting the view tree structure of the first page, the method further includes: It is recognized that in the first page provided by the first application, both the first content and the second content can be displayed by sliding, and the size of the first content in the first page is larger than the first size.

10. The method according to any one of claims 1 to 9, characterized in that: The heights of the first area and the second area are the same and equal to the height of the display screen, and the sum of the widths of the first area and the second area is equal to the width of the display screen.

11. The method according to claim 10, characterized in that The width of the first region is greater than the width of the second region.

12. The method according to any one of claims 1 to 11, characterized in that: The first content is located at the center of the first area.

13. The method according to any one of claims 1 to 12, characterized in that: Before adjusting the view tree structure of the first page, the method further includes: Querying a second optimization method for the first application or the first page from pre-stored optimization information; or, Obtaining optimization information provided by the first application, where the optimization information provided by the first application is used to indicate a second optimization method for the first application or the first page; or, A user operation for selecting the second optimization mode is detected.

14. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: detecting a sliding operation on the first area or the second area; The first content displayed in the first area is slid, and the second content displayed in the second area is slid at the same time.

15. The method according to any one of claims 1 to 3 and 12, characterized in that: The view tree of the first page includes a seventh node and an eighth node, wherein the eighth node is a child node of the seventh node, and the eighth node includes the first content and the second content; The adjusting the view tree structure of the first page specifically includes: Generate the ninth node; Adding the ninth node as a child node of the seventh node; The eighth node is adjusted from a child node of the seventh node to a child node of the ninth node, and the ninth node is used to display the first content carried by the eighth node in the first area, and to display the second content carried by the eighth node in the second area.

16. The method according to claim 15, characterized in that The width of the ninth node is equal to 1 / 2 of the width of the display screen, and the height of the ninth node is equal to twice the height of the display screen; or, The width of the ninth node is equal to 1 / 3 of the width of the display screen, and the height of the ninth node is equal to 3 times the height of the display screen.

17. The method according to any one of claims 1-3, 14-16, characterized in that: Before adjusting the view tree structure of the first page, the method further includes: It is recognized that in the first page provided by the first application, both the first content and the second content can be displayed in a sliding manner.

18. The method according to any one of claims 1-3, 14-17, characterized in that: The first area and the second area have the same height, which is equal to the height of the display screen; the first area and the second area have the same width, which is equal to 1 / 2 of the width of the display screen.

19. The method according to any one of claims 1-3, 14-17, characterized in that: The method further comprises: Displaying third content in a third area of ​​the display screen, where a left edge of the third area is connected to a right edge of the second area, and the third content is located below the second content in the first page; The heights of the first area, the second area, and the third area are the same and are equal to the height of the display screen; the widths of the first area, the second area, and the third area are the same and are equal to 1 / 3 of the width of the display screen.

20. The method according to any one of claims 1-3, 14-19, characterized in that: Before adjusting the view tree structure of the first page, the method further includes: Querying a first optimization method for the first application or the first page from pre-stored optimization information; or, Obtaining optimization information provided by the first application, where the optimization information provided by the first application is used to indicate a first optimization method for the first application or the first page; or, A user operation for selecting a first optimization mode is detected.

21. The method according to any one of claims 1 to 20, characterized in that: Before adjusting the view tree structure of the first page, the method further includes: Searching for the first application or the first page from a pre-stored first list, where the first list is used to indicate the application or page that needs to optimize the page layout; or, Acquire configuration information of the first application, where the configuration information of the first application is used to instruct the electronic device to optimize the layout of the first page; or, A user operation for triggering the electronic device to optimize the layout of the first page is detected.

22. The method according to any one of claims 1-18, 20-21, characterized in that: The method may further include any one or more of the following: Displaying a status bar on the display screen, wherein the status bar is located at the top of the first area and the second area, or only at the top of the first area; Displaying a navigation bar on the display screen, wherein the navigation bar is located at the bottom of the first area and the second area, or only at the bottom of the second area; Displaying a header of the first page on the display screen, wherein the header is located at a top position outside the status bar in the first area and the second area, or is located only at a top position outside the status bar in the first area; or, The tail of the first page is displayed on the display screen, and the tail is located at a bottom position outside the navigation bar in the first area and the second area, or is located at a bottom position outside the navigation bar only in the second area.

23. An electronic device, characterized in that: include: One or more processors, one or more memories, and a display screen; wherein the display screen and the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in any one of claims 1 to 22.

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

Citation Information

Cited By

  • Multi-system fusion interface display method and intelligent cabin system

    CN121143743A

  • A multi-system fusion interface display method and intelligent cockpit system

    CN121143743B