Interface layout method, electronic device and computer-readable storage medium
By calculating the screen aspect ratio of the second terminal device and determining the display layout style, the problem of interface neatness and ease of use is solved when the same application interface is displayed on multiple devices, and good adaptation and display of the interface on different devices are achieved. Effect.
Patent Information
- Application Number
- CN202011401053.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-02
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-12-02
AI Technical Summary
In a distributed scenario, it is difficult for the existing technology to display the same application interface on multiple devices to ensure that the interface is neat, beautiful, easy to use, and adaptable to the visual effects of different devices. Moreover, the traditional screen projection method can easily cause the interface to display elements. Problems such as misalignment and incomplete display.
By obtaining the display resolution of the second terminal device, calculating its screen aspect ratio, and determining the corresponding display layout style according to the pre-divided proportion interval, selecting visual elements from the application page of the first terminal device for layout, and generating an adaptation The display interface of the device ensures that the visual elements are neat, beautiful and easy to use.
When the same application interface is displayed on multiple devices, it is ensured that the interface is neat, beautiful, and easy to use, adapts to the visual effects of different devices, and avoids the problem of misalignment of interface display elements and incomplete display.
Smart Images

Figure CN114579223B_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of electronic technology, and in particular to an interface layout method, an electronic device and a computer-readable storage medium. [Background technology]
[0002] In a distributed scenario, the interface originally displayed on the mobile phone needs to be expanded to other devices for display, such as car computers, tablets, computers, TVs, AR, VR and other devices. In related technologies, the methods of experiencing the same service on multiple devices usually include the following two: one is to install the client of the service application on multiple devices, but this method requires designers to design and export interface resources on multiple devices, and developers also need to develop multiple sets of layout resources, which leads to the problem of consuming a lot of manpower and material resources. And once this method encounters an interface that is not specifically adapted, problems such as misalignment of interface display elements and incomplete display will arise. The other is screen projection distribution, but the traditional screen projection method is prone to poor visual effects when the same application interface is distributed on different devices, uneven modules on the application interface, misaligned overlap and poor usability. [Summary of the invention]
[0003] In view of this, the present invention provides an interface layout method, an electronic device and a computer-readable storage medium. By setting display layout styles corresponding to different proportion intervals, when the first visual element is laid out according to the display layout style, it is ensured that the first visual element can achieve a visual effect that is neat, beautiful, easy to use, and adapted to the second terminal device.
[0004] On the one hand, an embodiment of the present invention provides an interface layout method, which is applied to a first terminal device, including:
[0005] When the first terminal device is connected to the second terminal device, obtaining the display resolution of the second terminal device;
[0006] Calculating a screen aspect ratio of the second terminal device according to the display resolution, and determining a ratio interval in which the screen aspect ratio is located from a plurality of pre-divided ratio intervals;
[0007] According to the ratio interval of the screen aspect ratio, obtaining a display layout style corresponding to the ratio interval;
[0008] Based on the display layout style, selecting a first visual element from an application page of the first terminal device;
[0009] The first visual elements are laid out according to the display layout style to generate a display interface of the second terminal device.
[0010] As a possible implementation manner, the display layout style includes the number of display windows, the number of grids, the grid width, the margin, and the spacing, wherein the number of grids contained in each display window is different, the margin is used to indicate the distance between the first visual element and the edge of the display interface of the second terminal device, and the spacing is used to indicate the distance between the first visual elements;
[0011] Before the first visual elements are laid out according to the display layout style to generate a display interface of the second terminal device, the method includes:
[0012] The number of grids occupied by the first visual element is determined according to the type of the first visual element, the acquired attribute information of the first visual element and a preset element layout rule, wherein the element layout rule includes layout rules corresponding to multiple types of first visual elements.
[0013] As a possible implementation manner, after determining the number of grids occupied by the first visual element according to the type of the first visual element, the acquired attribute information of the first visual element, and a preset element layout rule, the method includes:
[0014] Acquire device information of the second terminal device, the device information including the size of the display area, the position of the display area, and the device type;
[0015] The position of the first visual element is determined according to the device information and the number of grids occupied by the first visual element, wherein the position includes a display window where the first visual element is located and a position of the display window in a display area of the second terminal device.
[0016] As a possible implementation manner, the laying out the first visual elements according to the display layout style to generate a display interface of the second terminal device includes:
[0017] In the display layout style, multiple first visual elements are laid out based on the acquired position of each first visual element and the number of grids occupied by each first visual element to generate a display interface of the second terminal device, wherein the total number of grids occupied by multiple first visual elements is less than or equal to the number of grids.
[0018] As a possible implementation manner, before determining the number of grids occupied by the first visual element according to the type of the first visual element, the acquired attribute information of the first visual element, and a preset element layout rule, the method further includes:
[0019] identifying a type of each of the first visual elements;
[0020] According to the acquired number of first visual elements of each type and the screen aspect ratio, attribute information of each first visual element is determined, wherein the attribute information includes display status, element width, font size, and scrolling status.
[0021] As a possible implementation manner, after determining the attribute information of each first visual element according to the acquired number of first visual elements of each type and the screen aspect ratio, the method further includes:
[0022] The attribute information of the first visual element to be displayed is modified according to the display resolution and the display requirement, wherein the display requirement is used to indicate the user's display requirement for the content displayed on the display interface of the second terminal device.
[0023] As a possible implementation manner, after laying out the first visual elements according to the display layout style to generate a display interface of the second terminal device, the method further includes:
[0024] The display interface is displayed in a virtual screen, and the display interface is projected to the second terminal device so that the display screen of the second terminal device displays the display interface.
[0025] As a possible implementation manner, after laying out the first visual elements according to the display layout style to generate a display interface of the second terminal device, the method further includes:
[0026] Receive an event for switching the display interface sent by the second terminal device, and according to the event for switching the display interface and based on the display layout style, select a second visual element from the application page of the first terminal device, and layout the second visual element according to the display layout style to generate a display interface for the second terminal device.
[0027] In a second aspect, an embodiment of the present invention provides an electronic device, comprising: a display screen; one or more processors; a memory; multiple applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the device, cause the device to execute the interface layout method in any possible implementation of any of the above aspects.
[0028] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium is used for program code executed by a device, and the program code includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0029] In the technical solution provided by the embodiment of the present invention, when a first terminal device is connected to a second terminal device, the display resolution of the second terminal device is obtained; the screen aspect ratio of the second terminal device is calculated according to the display resolution, and the ratio interval in which the screen aspect ratio is located is determined from multiple pre-divided ratio intervals; according to the ratio interval in which the screen aspect ratio is located, a display layout style corresponding to the ratio interval is obtained; based on the display layout style, a first visual element is selected from an application page of the first terminal device; the first visual element is laid out according to the display layout style to generate a display interface of the second terminal device, and by setting the display layout styles corresponding to different ratio intervals, when the first visual element is laid out according to the display layout style, it is ensured that the first visual element can achieve a visual effect that is neat, beautiful, easy to use, and adapted to the second terminal device.
Brief Description of the Drawings
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 It is a schematic diagram of a related art display layout with poor visual effect;
[0032] Figure 2 is an architectural diagram of an interface layout system provided by an embodiment of the present invention;
[0033] Figure 3 is a flow chart of an interface layout method provided by an embodiment of the present invention;
[0034] Figure 4 is a schematic diagram of a display layout style provided by an embodiment of the present invention;
[0035] Figure 5 is a schematic diagram of a display layout style provided by an embodiment of the present invention;
[0036] Figure 6 is a schematic diagram of a display layout style provided by an embodiment of the present invention;
[0037] Figure 7 is a schematic diagram of a display layout style provided by an embodiment of the present invention;
[0038] Figure 8 is a schematic diagram of a display layout style provided by an embodiment of the present invention;
[0039] Fig. 9is a schematic diagram of a display layout style provided by an embodiment of the present invention;
[0040] Fig.10a is a schematic diagram of a display interface of a certain application provided by an embodiment of the present invention;
[0041] Fig.10b This is a schematic diagram of an effect of selecting a first visual element from a display interface of an application provided by an embodiment of the present invention;
[0042] Figure 11a-Figure 11c It is a schematic diagram of different numbers of tab elements at different display resolutions provided by an embodiment of the present invention;
[0043] Fig.12 This is a schematic diagram of the effect of laying out a first visual element provided by an embodiment of the present invention;
[0044] Fig.13 This is a schematic diagram of the effect of laying out a first visual element provided by an embodiment of the present invention;
[0045] Fig.14 This is a schematic diagram of the effect of laying out a first visual element provided by an embodiment of the present invention;
[0046] Fig.15 This is a schematic diagram of the effect of laying out a first visual element provided by an embodiment of the present invention;
[0047] Fig.16 This is a schematic diagram of the effect of laying out a first visual element provided by an embodiment of the present invention;
[0048] Fig.17 This is a schematic diagram of the effect of laying out a plurality of first visual elements provided by an embodiment of the present invention;
[0049] Fig.18 This is a schematic diagram of the effect of laying out a plurality of first visual elements provided by an embodiment of the present invention;
[0050] Fig.19 is a schematic block diagram of an electronic device provided by an embodiment of the present invention;
[0051] Fig. 20 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. [Specific implementation method]
[0052] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0053] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0055] It should be understood that the term "and / or" used in this article 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 represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0056] Before introducing an interface layout method provided by the present invention, a brief introduction to the interface layout method in the related art is first given.
[0057] In a distributed scenario, it is usually necessary to expand the interface displayed by an application on a certain device to other devices for display. For example, other devices may include car computers, tablets, computers, TVs, or augmented reality (AR) / virtual reality (VR) devices.
[0058] In the above scenario where the display interface of the same application is presented to a second terminal device of different sizes, in the related art, the designer is usually required to export the resources corresponding to the display interface of a certain application, where the resources include information of multiple first visual elements, and then the developer will perform layout according to the device information of other devices and the resources corresponding to the display interface to generate the display interface of different devices. Since the first visual elements are not screened in the related art, it is easy to cause the problem of poor visual effects, for example, Figure 1 As shown, this method easily causes problems such as unevenness, misalignment and overlap of modules on the application interface and poor usability when the same application interface is displayed on different devices. Figure 1 The text and pictures in the website are misaligned and overlapped, resulting in poor visual effects.
[0059] Regarding the above scenario where the display interface of the same application is presented to a second terminal device of different sizes, further, in the related technology, if the virtual screen selects different first visual elements according to the different sizes of the device, it will be difficult to cover devices of all sizes because the selected first visual elements cannot be linearly adaptive when they are laid out. That is to say, in the related technology, the virtual screen will select the most suitable first visual element according to the different sizes of the device, and stretch or scale these first visual elements in proportion, which may easily cause problems such as occlusion between the first visual elements and chaotic layout, and thus the display effect cannot be guaranteed.
[0060] Based on this, the technical problem to be solved by the present invention is how to ensure that the display interface achieves a neat, beautiful, easy-to-use, and visual effect that adapts to the second terminal device when the interface is adapted for multiple second terminal devices. Therefore, an embodiment of the present invention provides an interface layout method, which sets display layout styles corresponding to different proportion intervals so that when the second terminal device can layout the first visual element according to its corresponding display layout style, it ensures that the display interface of the second terminal device can achieve a neat, beautiful, easy-to-use, and visual effect that adapts to the second terminal device.
[0061] The following briefly introduces the scenarios in which the interface layout method provided by the embodiment of the present invention is used.
[0062] The scenario where the display interface of the same application is presented to a second terminal device of a different size through the first terminal device:
[0063] The first terminal device of the embodiment of the present invention can be a mobile phone, a tablet computer, a television, a desktop computer, a wearable device (such as a watch), a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA) and other devices with a display function.
[0064] The second terminal device of the embodiment of the present invention may also be a mobile phone, a tablet computer, a television, a desktop computer, a wearable device (such as a watch), a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA) and other devices with display functions. The embodiment of the present application does not impose any restrictions on the specific type of the first terminal device or the second terminal device.
[0065] In a distributed scenario, it is usually necessary to present the display interface of the same application to second terminal devices of different sizes. For example, taking the second terminal devices of different sizes including second terminal device A, second terminal device B, and second terminal device C as an example, it is necessary to present the display interface of the same application to second terminal device A, second terminal device B, and second terminal device C respectively, and the pages presented by each second terminal device are different.
[0066] Based on the above scenario, an embodiment of the present invention provides an interface layout method, which obtains the display resolution of the second terminal device, calculates the screen aspect ratio of the second terminal device according to the display resolution, and determines the proportion interval in which the screen aspect ratio is located from multiple pre-divided proportion intervals, obtains the display layout style corresponding to the proportion interval according to the proportion interval in which the screen aspect ratio is located, selects a first visual element from the application page, and layouts the first visual element according to the display layout style to generate a display interface of the second terminal device. By setting the display layout styles corresponding to different proportion intervals, when the first visual element is laid out according to the display layout style, the display interfaces presented between the second terminal devices of each size are different, while ensuring that the display interface can achieve a visual effect that is neat, beautiful, easy to use, and adapted to the second terminal device.
[0067] Compared with the related art, the interface layout method provided by the embodiment of the present invention aims at the scenario where the first terminal device presents the display interface of the same application to the second terminal device of different sizes. The present invention can determine the display layout style corresponding to the second terminal device by calculating the screen aspect ratio of the second terminal device, and by setting the display layout styles corresponding to different proportion intervals, when the first visual elements are laid out according to the display layout style, the display interfaces presented between the second terminal devices of each size are different. That is to say, the technical solution of the embodiment of the present invention is not the solution of the related art of reducing or enlarging the first visual elements according to the display resolution of the second terminal device. The embodiment of the present invention recombines and arranges the first visual elements, thereby ensuring that the display interface can achieve a visual effect that is neat, beautiful, easy to use, and adapted to the second terminal device.
[0068] Figure 2 An architectural diagram of an interface layout system provided by an embodiment of the present invention, such as Figure 2 As shown, the system 100 includes: a first terminal device 110 and a second terminal device 120 .
[0069] In an embodiment of the present invention, the first terminal device 110 includes an interaction module 1101, a processing module 1102, a storage module 1103, a display module 1104, and a screen projection module 1105. Among them, the interaction module 1101 is used to interact with the second terminal device 120, the processing module 1102 is used to calculate the screen aspect ratio of the second terminal device 120, determine the ratio interval in which the screen aspect ratio is located, and obtain the display layout style corresponding to the ratio interval from the storage module 1103. The storage module 1103 is used to store the display layout style corresponding to each ratio interval. The display module 1104 is used to display the display interface in the virtual screen. The screen projection module 1105 is used to project the display interface of the virtual screen to the second terminal device 120 through the screen projection module 1105, so that the second terminal device 120 displays the display interface.
[0070] In the embodiment of the present invention, the second terminal device 120 includes an interaction module 1201 and a display module 1202. The interaction module 1201 is used to send the display resolution of itself (the second terminal device 120) to the first terminal device 110. The interaction module 1201 is also used to receive the display interface of the first terminal device 110 through the virtual screen projection. The display module 1202 is used to display the display interface.
[0071] Specifically, the first terminal device 110 sends an information acquisition request to the second terminal device 120 through the interaction module 1101. In response to the information acquisition request, the second terminal device 120 sends the display resolution of the second terminal device 120 to the first terminal device 110, so that the first terminal device 110 obtains the display resolution of the second terminal device 120.
[0072] Furthermore, the first terminal device 110 calculates the screen aspect ratio of the second terminal device 120 according to the display resolution through the processing module 1102, and determines the proportion interval in which the screen aspect ratio is located from multiple pre-divided proportion intervals, and obtains the display layout style corresponding to the proportion interval according to the proportion interval in which the screen aspect ratio is located.
[0073] The first terminal device 110 also selects a first visual element from an application page through the interaction module 1101, wherein the application page may include an application page of the first terminal device and may also include an application page of the second terminal device. That is to say, the present invention does not limit the device to which the application page belongs.
[0074] The first terminal device 110 arranges the first visual elements according to the display layout style through the processing module 1102 to generate a display interface of the second terminal device 120 .
[0075] The first terminal device 110 displays a display interface in a virtual screen through the display module 1104 , and projects the display interface to the second terminal device through the projection module 1105 of the virtual screen, so that the display screen of the second terminal device 120 displays the display interface.
[0076] In the embodiment of the present invention, through the above-mentioned system architecture 100, the display resolution of the second terminal device is obtained, the screen aspect ratio of the second terminal device is calculated according to the display resolution, and the ratio interval where the screen aspect ratio is located is determined from multiple pre-divided ratio intervals, and the display layout style corresponding to the ratio interval is obtained according to the ratio interval where the screen aspect ratio is located, and the first visual element is selected from the application page, and the first visual element is laid out according to the display layout style to generate a display interface of the second terminal device. Figure 3 , including steps 102 to 114, the process of the interface layout method is described in detail.
[0077] Figure 3 A flowchart of an interface layout method provided by an embodiment of the present invention is applied to a first terminal device, such as Figure 3 As shown, the method includes:
[0078] Step 102: When the first terminal device is connected to a second terminal device, a display resolution of the second terminal device is obtained.
[0079] In the embodiment of the present invention, based on Figure 2 On the basis of, when the first terminal device is connected to the second terminal device, the display resolution of the second terminal device can be obtained. For example, the display resolution of the second terminal device A is 2160*1620, and the width and height of the second terminal device A can be determined to be 2160 and 1620 respectively from the display resolution.
[0080] Step 104: Calculate the screen aspect ratio of the second terminal device according to the display resolution, and determine the ratio interval in which the screen aspect ratio is located from a plurality of pre-divided ratio intervals.
[0081] In the embodiment of the present invention, for example, after determining that the width of the second terminal device A is 2160 and the height is 1620 according to the display resolution of the second terminal device A, the screen aspect ratio of the second terminal device can be calculated according to the width and height of the second terminal device A, that is, the screen aspect ratio = 2160 / 1620≈1.33. After the screen aspect ratio of the second terminal device A is calculated, the ratio interval in which the screen aspect ratio is located is determined from a plurality of pre-divided ratio intervals.
[0082] The process of determining a plurality of pre-divided ratio intervals may include: determining a plurality of ratio intervals by counting the aspect ratios of common devices and dividing the ratio intervals according to the aspect ratios of common devices. Specifically, the following table 1 shows the resolutions of common devices and the corresponding aspect ratios, as shown in the following table 1:
[0083] Table 1
[0084]
[0085]
[0086] That is to say, through the statistics of Table 1 above, 6 proportion intervals can be determined, wherein the 6 proportion intervals include the first proportion interval, the second proportion interval, the third proportion interval, the fourth proportion interval, the fifth proportion interval and the sixth proportion interval. Among them, the first proportion interval: aspect ratio <1, the second proportion interval: 1≤ aspect ratio <1.33, the third proportion interval: 1.33≤ aspect ratio <1.78, the fourth proportion interval: 1.78≤ aspect ratio <2.66, the fifth proportion interval: 2.66≤ aspect ratio <3, the sixth proportion interval: aspect ratio ≥3. In addition, other proportion intervals can be divided according to the aspect ratio of other devices, and the embodiment of the present invention is not limited to this.
[0087] Therefore, when the screen aspect ratio of the second terminal device A is calculated to be 1.33, the ratio interval in which the screen aspect ratio is located is determined to be the third ratio interval from the above multiple ratio intervals.
[0088] Step 106: Obtain a display layout style corresponding to the ratio interval according to the ratio interval of the screen aspect ratio.
[0089] In an embodiment of the present invention, the display layout style includes display windows, the number of grids, the grid width, margins, and spacings, wherein each display window includes a different number of grids, the margins are used to indicate the distance between the first visual elements, and the spacings are used to indicate the distance between the first visual elements and the edge of the display interface. It should be noted that the number of display windows, the number of grids, the grid width, the margin size, and the spacing size included in the display layout style corresponding to each proportional interval can be set according to requirements, and the embodiment of the present invention does not limit this.
[0090] As an alternative, for example, Figure 4 As shown, when the ratio interval of the screen aspect ratio is the first ratio interval, that is, when the screen aspect ratio is the ratio interval of the aspect ratio <1, the display layout style corresponding to the ratio interval includes: the number of display windows 1 includes 1, the number of grids 2 includes 8, the size of margin 3 includes 34dp, and the size of spacing 4 includes 20dp. It should be noted that the grid width can be calculated comprehensively according to the width of the display resolution, the number of grids, the size of the margins, and the size of the spacing. Specifically, grid width = (display window width - (number of margins * margin size) - (number of spacings * spacing size)) / grid data. Taking the width of display window 1 as 760dp as an example, when the number of grids 2 includes 8, the size of margin 3 includes 34dp, and the size of spacing 4 includes 20dp, it can be seen that when the number of grids is 8, the spacing data formed between the grids is 7, and the margin data is 2, then the grid width = (760dp-(2*34dp)-(7*20dp)) / 8=69dp.
[0091] For example, Figure 5As shown, when the ratio interval of the screen aspect ratio is the second ratio interval, that is, when the ratio interval of the screen aspect ratio is 1≤aspect ratio<1.33, the display layout style corresponding to the ratio interval includes: the number of display windows 1 includes 1, the number of grids 2 includes 8, the size of margin 3 includes 40dp, and the size of spacing 4 includes 20dp. It should be noted that the grid width can be calculated based on the width of the display resolution, the number of grids, the size of margins, and the size of spacing. Taking the width of display window 1 as 760dp as an example, when the number of grids 2 includes 8, the size of margin 3 includes 40dp, and the size of spacing 4 includes 20dp, the grid width = (760dp-(2*40dp)-(7*20dp)) / 8≈67dp.
[0092] For example, Figure 6 As shown, when the ratio interval of the screen aspect ratio is the third ratio interval, that is, when the screen aspect ratio is 1.33≤aspect ratio<1.78, the display layout style corresponding to the ratio interval includes: the number of display windows 1 includes 1, the number of grids 2 includes 8, the size of margin 3 includes 50dp, and the size of spacing 4 includes 30dp. It should be noted that the grid width can be calculated based on the width of the display resolution, the number of grids, the size of margins, and the size of spacing. Taking the width of display window 1 as 760dp as an example, when the number of grids 2 includes 8, the size of margin 3 includes 50dp, and the size of spacing 4 includes 30dp, the grid width = (760dp-(2*50dp)-(7*30dp)) / 8≈56dp.
[0093] For example, Figure 7 As shown, when the screen aspect ratio is in the fourth ratio interval, that is, when the screen aspect ratio is in the ratio interval of 1.78≤aspect ratio<2.66, the display layout style corresponding to the ratio interval includes: the number of display windows 1 includes 1, the number of grids 2 includes 12, the size of margin 3 includes 54dp, and the size of spacing 4 includes 32dp. It should be noted that the grid width can be calculated based on the width of the display resolution, the number of grids, the size of margins, and the size of spacing. Taking the width of display window 1 as 760dp as an example, when the number of grids 2 includes 12, the size of margin 3 includes 34dp, and the size of spacing 4 includes 20dp, the grid width = (760dp-(2*34dp)-(11*20dp)) / 12≈39dp.
[0094] For example, Figure 8As shown, when the ratio interval of the screen aspect ratio is the fifth ratio interval, that is, when the screen aspect ratio is 2.66≤aspect ratio<3, the display layout style corresponding to the ratio interval includes: the number of display windows includes 2, the number of grids 2 of the first display window 1 includes 12, the size of the margin 3 of the first display window 1 includes 21dp, the size of the spacing 4 of the first display window 1 includes 16dp, the number of grids 6 of the second display window 5 includes 4, the size of the margin 7 of the second display window 5 includes 21dp, the size of the spacing 8 of the second display window 5 includes 16dp, and the column spacing 9 between the second display window 5 and the first display window 1 includes 16dp. It should be noted that the grid width can be calculated comprehensively according to the width of the display resolution, the number of grids, the size of the margins, and the size of the spacing. Taking the width of the first display window 1 as 760dp as an example, when the number of grids 2 includes 12, the size of margins 3 includes 21dp, and the size of spacing 4 includes 16dp, the grid width in the first display window 1 = (760dp-(2*21dp)-(11*16dp)) / 12≈45dp. Taking the width of the second display window 5 as 300dp as an example, when the number of grids 6 includes 4, the size of margins 7 includes 21dp, and the size of spacing 8 includes 16dp, the grid width in the second display window 5 = (300dp-(2*21dp)-(3*16dp)) / 4≈52dp.
[0095] For example, Fig. 9 As shown, when the ratio interval of the screen aspect ratio is the sixth ratio interval, that is, when the screen aspect ratio is the ratio interval of the aspect ratio ≥ 3, the display layout style corresponding to the ratio interval includes: the number of display windows includes 2, the number of grids 2 of the first display window 1 includes 12, the size of the margin 3 of the first display window 1 includes 28dp, the size of the spacing 4 of the first display window 1 includes 14dp, the number of grids 6 of the second display window 5 includes 4, the size of the margin 7 of the second display window 5 includes 28dp, the size of the spacing 8 of the second display window 5 includes 14dp, and the column spacing 9 between the second display window 5 and the first display window 1 includes 16dp. It should be noted that the grid width can be calculated comprehensively according to the width of the display resolution, the number of grids, the size of the margins, and the size of the spacing. Taking the width of the first display window 1 as 760dp as an example, when the number of grids 2 includes 12, the size of margins 3 includes 28dp, and the size of spacing 4 includes 14dp, the grid width in the first display window 1 = (760dp-(2*28dp)-(11*14dp)) / 12≈69dp. Taking the width of the second display window 5 as 300dp as an example, when the number of grids 6 includes 4, the size of margins 7 includes 28dp, and the size of spacing 8 includes 14dp, the grid width in the second display window 5 = (300dp-(2*28dp)-(3*14dp)) / 4≈50dp.
[0096] It should be noted that when the aspect ratio is ≥ 2.66, the display interface needs to be divided into columns, that is, the display interface in the initial state includes one display window, and after the display interface is divided into columns, the display interface may include two display windows. For example, taking the two display windows including the first display window and the second display window as an example, the column spacing between the first display window and the second display window (the new display window generated after the column division) is 16dp by default.
[0097] Furthermore, in addition to the above-mentioned column division operation, it is also necessary to limit the aspect ratio of the second display window. Figure 8 As shown, when 2.66≤aspect ratio<3, the screen aspect ratio of the second display window 5 is 4:3 by default. Fig. 9 As shown, when the aspect ratio value is ≥3, the screen aspect ratio of the second display window 5 is 1:1 by default.
[0098] In an embodiment of the present invention, by dividing the display interface into columns, the problem of poor layout effect caused by the display interface being too wide or too narrow in the subsequent layout process is avoided. That is to say, by dividing the display interface into columns, the multiple display windows divided out will not be too narrow or too wide, so that when the first visual element is subsequently laid out, it is ensured that the first visual element can achieve a visual effect that is neat, beautiful, easy to use, and adapted to the second terminal device.
[0099] Step 108: Select a first visual element from an application page of the first terminal device based on the display layout style.
[0100] In this step, the first visual element may include one visual element or a group of visual elements.
[0101] In an embodiment of the present invention, when the display interface of the same application is presented on devices of different sizes through a virtual screen, the virtual screen will select different first visual elements according to the different sizes of the devices. For example, when the display interface of a certain application is larger than the display interface of the second terminal device, if the first visual element is directly reduced in proportion, it will cause problems such as occlusion and chaotic layout of the first visual element, thereby failing to ensure the display effect. Therefore, it is necessary to select the first visual element from the application page of the first terminal device to adapt to the display interface of the second terminal.
[0102] For example, Fig.10a A schematic diagram of a display interface of an application, such as Fig.10a As shown, in Fig.10aIn the embodiment, the display interface of the application includes multiple first visual elements, for example, the multiple first visual elements include a first visual element A, a first visual element B, a first visual element C, a first visual element D, a first visual element E, a first visual element F, a first visual element G, a first visual element H, a first visual element I, a first visual element J, a first visual element K, a first visual element L, a first visual element M, a first visual element N, a first visual element O, a first visual element P, a first visual element Q, a first visual element R, a first visual element S, a first visual element T, a first visual element U and a first visual element V. Fig.10b is a schematic diagram of selecting a first visual element from the display interface of the application, such as Fig.10b As shown, in Fig.10b In the example, only 12 first visual elements are selected from the display interface of the application, wherein the 12 first visual elements include: first visual element G, first visual element H, first visual element I, first visual element J, first visual element K, first visual element L, first visual element Q, first visual element R, first visual element S, first visual element T, first visual element U and first visual element V. It should be noted that Fig.10b The first visual element selected is only for illustration. In addition, specified elements can be selected according to needs.
[0103] Step 110: Lay out the first visual elements according to the display layout style to generate a display interface of the second terminal device.
[0104] In an embodiment of the present invention, for example, in the above embodiment, only the first visual element G, the first visual element H, the first visual element I, the first visual element J, the first visual element K, the first visual element L, the first visual element Q, the first visual element R, the first visual element S, the first visual element T, the first visual element U and the first visual element V are selected from the display interface of the application. Therefore, the execution process of step 110 is to layout the first visual element G, the first visual element H, the first visual element I, the first visual element J, the first visual element K, the first visual element L, the first visual element Q, the first visual element R, the first visual element S, the first visual element T, the first visual element U and the first visual element V according to the display layout style corresponding to the second terminal device A to generate the display interface of the second terminal device A.
[0105] Specifically, the execution process of step 110 may include:
[0106] Step 1101: Identify the type of each first visual element.
[0107] In an embodiment of the present invention, the type of the first visual element may include types such as cards, tabs, and play bars. Specifically, the method of identifying the type of each first visual element may include: obtaining feature information of the first visual element, and determining the type of the first visual element according to the feature information. For example, the first visual element R is a "recommend" button, and by clicking the "recommend" button, it is possible to jump to the next page, that is, the feature information of the first visual element R includes a link to be jumped, then it is determined that the type of the first visual element R includes a tab, that is, the first visual element R is a tab element. Similarly, by obtaining the feature information of each first visual element, the type of each first visual element is determined according to the feature information. For example, it can be determined that the types of the first visual element G, the first visual element H, the first visual element I, the first visual element J, the first visual element K, and the first visual element L include cards, the type of the first visual element Q includes a play bar, and the types of the first visual element R, the first visual element S, the first visual element T, the first visual element U, and the first visual element V include tabs.
[0108] Step 1102: Determine attribute information of each first visual element according to the acquired number of first visual elements of each type and the screen aspect ratio, wherein the attribute information includes display status, element width, font size, and scrolling status.
[0109] In the embodiment of the present invention, through the above step 1101, it can be determined that the types of the first visual element G, the first visual element H, the first visual element I, the first visual element J, the first visual element K, and the first visual element L include cards, the type of the first visual element Q includes a play bar, and the types of the first visual element R, the first visual element S, the first visual element T, the first visual element U, and the first visual element V include tabs. That is, the number of card elements is 6, the number of play bar elements is 1, and the number of tab elements is 5.
[0110] Further, based on determining the number of first visual elements of each type, the screen aspect ratio is combined to determine the attribute information of each first visual element. The attribute information includes display status, element width, font size, and scrolling status. It should be noted that the attribute information may include other information in addition to the above information, which is not limited in the embodiment of the present invention.
[0111] Among them, the display status is used to indicate whether the first visual element is displayed, and the display status may include display or non-display. The method of "determining the display status of the first visual element" can be determined by determining the correspondence between each screen aspect ratio and the number of first visual elements of each type, so that after determining the second terminal device of a certain aspect ratio, the number of first visual elements corresponding to it can be determined. That is to say, the display status of the first visual elements within the prescribed number is display, and the display status of the first visual elements outside the prescribed number is non-display. For example, when the aspect ratio of a second terminal device is <1, the number of card elements corresponding to it is 6, and when the number of card elements obtained in step 1102 is 8, the display status of the first 6 card elements is display, and the display status of the remaining 2 card elements is non-display. Among them, the element width is used to indicate the width of the first visual element. Among them, the method of calculating the element width can be implemented by the following two steps:
[0112] Step 1. Set the base resolution (e.g. 1920*720 for horizontal screen and 720*1920 for vertical screen), set the base width of each type of element, and calculate the number of elements per row according to the formula: DEFAULT_SIZE*x+gap*(X1-1)=width / scale-margin–margin, where DEFAULT_SIZE represents the base width of the element, gap represents the spacing, width represents the width of the second terminal device, scale represents the coefficient of the aspect ratio of the second terminal device relative to the aspect ratio of the base device, margin represents the margin, and X1 represents the number of elements per row.
[0113] Step 2: After calculating the standard number of elements per row, assume that the element width of the element is y, and calculate the element width of the element and the actual number of elements per row through Formula 2: y / scale*x+gap*(x-1)=width / scale-margin–margin. It should be noted that in the calculation process of the second step, two x values need to be substituted to determine the y value, and the x values substituted for calculation are the two integers closest to X1, and then the width closest to DEFAULT_SIZE is determined according to the calculation result of Formula 2, and the element width is used as the element width of the element, and the number of elements per row corresponding to the element width is used as the number of elements per row of the second terminal device. For example, if X1 calculated by Formula 1 is 3.2, then x=3 and x=4 are substituted into Formula 2 respectively to obtain two widths, and the width closest to DEFAULT_SIZE is used as the element width of the element, and the number of elements per row corresponding to the element width is used as the number of elements per row of the second terminal device.
[0114] Through the above method, the element width corresponding to each type of first visual element and the number of elements in each row in the second terminal device with different aspect ratios can be determined.
[0115] The font size can be adjusted according to the coefficient of the aspect ratio of the second terminal device relative to the aspect ratio of the reference device. For example, if the font size of a first visual element in a certain application is 5, and if the coefficient of the aspect ratio of the second terminal device relative to the aspect ratio of the reference device is 1.5, the initial font size of the first visual element is increased by 1.5 times to obtain the font size of the first visual element in the second terminal device.
[0116] Among them, the scrolling state is used to indicate whether the first visual element supports scrolling, and the scrolling state may include supporting scrolling or not supporting scrolling. The scrolling state of the first visual element can be determined by determining the correspondence between each screen aspect ratio and the number of first visual elements of each type, so that after determining the second terminal device of a certain aspect ratio, the number of first visual elements corresponding to it can be determined. In other words, the scrolling state of the first visual elements within the specified number is not supporting scrolling, and the scrolling state of the first visual elements exceeding the specified number is supporting scrolling. For example, when the aspect ratio of a second terminal device is less than 1, the number of card elements corresponding to it is 6. When the number of card elements obtained in step 1102 is 8, since the display state of the first 6 card elements is displayed, the display state of the remaining 2 card elements is not displayed. Therefore, it is necessary to set the scrolling state of these 8 card elements to support scrolling so that the remaining two card elements can be displayed by sliding.
[0117] It should be noted that the attribute information includes not only display status, element width, font size, and scroll status, but also other information, such as color information, etc. In addition, it should be noted that the process of determining the attribute information is different for different types of first visual elements. The following is an example of the process of determining the attribute information for different types of first visual elements:
[0118] As an optional solution, taking the card element as an example, before executing step 1102, it also includes: determining the correspondence between each screen aspect ratio and the number of each type of first visual elements. For example, under the premise of ensuring that the card elements can achieve the visual effects of being neat, beautiful, easy to use, and adaptable to the second terminal device, the correspondence between each screen aspect ratio and the number of card elements determined through research and development testing is shown in Table 2 below:
[0119] Table 2
[0120] Aspect Ratio Number of card columns Number of card rows Number of cards Aspect ratio < 1 3 2 6 1≤Aspect ratio<1.33 3 2 6 1.33≤Aspect ratio<1.78 4 1 4 1.78≤Aspect ratio<2.66 4 1 4 2.66≤Aspect ratio<3 4 1 4 Aspect ratio ≥ 3 6 1 6
[0121] Specifically, as shown in Table 2 above, when the screen aspect ratio includes an aspect ratio of less than 1, the number of card columns is 3 and the number of card rows is 2, that is, the number of cards is 6; when the screen aspect ratio includes 1≤aspect ratio<1.33, the number of card columns is 3 and the number of card rows is 2, that is, the number of cards is 6; when the screen aspect ratio includes 1.33≤aspect ratio<1.78, the number of card columns is 4 and the number of card rows is 1, that is, the number of cards is 4; when the screen aspect ratio includes 1.78≤aspect ratio<2.66, the number of card columns is 4 and the number of card rows is 1, that is, the number of cards is 4; when the screen aspect ratio includes 2.66≤aspect ratio<3, the number of card columns is 4 and the number of card rows is 1, that is, the number of cards is 4; when the screen aspect ratio includes an aspect ratio≥3, the number of card columns is 6 and the number of card rows is 1, that is, the number of cards is 6. In other words, based on Table 2 above, it is possible to ensure that the card elements can achieve a visual effect that is neat, beautiful, easy to use, and adaptable to the second terminal device. For example, taking the screen aspect ratio including the aspect ratio <1 as an example, if the number of card columns is set to 4 and the number of card rows is set to 2, since the width of the display interface is not enough to clearly display 4 cards, it is easy to cause the card elements to be blurred and the usability is poor.
[0122] Based on Table 2 above, during the execution of step 1102, when the number of acquired card elements is 6 (first visual element G, first visual element H, first visual element I, first visual element J, first visual element K and first visual element L) and the screen aspect ratio includes 1.33≤aspect ratio<1.78, it is determined that the number of displayable card elements is 4. Therefore, it is necessary to set the display status of the first 4 card elements from the acquired 6 card elements to display, and set the display status of the remaining two card elements to non-display. For example, the display status of the first visual element K and the first visual element L is set to non-display. Furthermore, since the number of displayable card elements is 6, the attribute information of the two card elements, the first visual element K and the first visual element L, can be set to support scrolling. In other words, the remaining two card elements (first visual element K and first visual element L) can be displayed by sliding.
[0123] Furthermore, after determining the display state and scrolling state of the card element, it is also necessary to calculate the element width and font size corresponding to the four displayed card elements. Specifically, the element width corresponding to the four displayed card elements can be calculated according to the above method. In addition, the font size can be adjusted accordingly according to the coefficient of the aspect ratio of the second terminal device relative to the aspect ratio of the reference device.
[0124] As another optional solution, taking the page tab element as an example, before executing step 1102, the method further includes: determining a rule for changing the aspect ratio of different numbers of page tab elements on the same screen.
[0125] For example, Fig.11a What is provided is the changing rules of different numbers of tab elements when the screen aspect ratio is 0.75 (for example, the display resolution is 960*1280), such as Fig.11a As shown, for a display interface with a screen aspect ratio of 0.75, the number of tab elements that can be displayed is set to 4. Thus, when the number of tab elements is less than or equal to 4, the tab elements can be fully displayed and scrolling is not supported, for example Fig.11a As shown in Tab A1-Tab B1, Tab A2-Tab C2, and Tab A3-Tab D3, since the number of tabs in each group is less than 4, each tab can be fully displayed without scrolling. It should be noted that the number of tab elements that can be displayed can be set according to demand, and the above is only an example and is not specifically limited.
[0126] For example, as shown in Tab A4-Tab E4, when the number of tab elements is greater than 4, since the width of the display screen is not sufficient to display more than 4 tab elements, the remaining tab elements (Tab E4) need to be set to not be displayed, and the displayed tab elements (Tab A4-Tab D4) are set to support scrolling so that the user can display the remaining tab elements (Tab E4) by sliding. It should be noted that since the number of displayable tab elements is 4, after the remaining tab elements (Tab E4) are displayed, Tab A4 is not displayed due to scrolling, while Tab B4 and Tab C4 continue to be displayed.
[0127] Furthermore, if there is no limit on the number of tab elements that can be displayed, the display state and scrolling state of the tab elements can be determined according to the number of tab elements and the screen aspect ratio, and then the width of each tab element can be determined according to the display layout style and the number of tab elements displayed. Fig.11a Taking tab A5 to tab E5 as an example, taking the tab elements including 5 as an example, the element width of each tab element is calculated according to the width of the second terminal device and the spacing and margin of the display layout style, that is, by the formula w=(W-2L-4S) / 5, wherein w represents the element width of each tab element, W represents the width of the target device, L represents the margin, and S represents the spacing. It can be understood that multiple tab elements are evenly divided, that is, Fig.11aAs shown in the tabs A5 to E5 in the figure, tabs A5 to E5 can be fully displayed, and the element width of each tab is less than 2 grids, and each tab is in the state of being. In addition, when using this method, if there are many tab elements, the number of tab elements to be displayed can be set (for example, set to 4 or 5) so that other tab elements that are not displayed can be displayed by the user sliding.
[0128] It should be noted that if the number of tab elements is less than 4, the element width of the tab element can be determined by the set reference width and the display resolution of the second terminal device. For example, the element width of the tab element used in the embodiment of the present invention is 2 grids. In addition, it can be set according to the needs. For example, if the set reference width is 2 grids, and the display interface of the second terminal device is wider, the element width of the tab element can be set to 3 grids. The embodiment of the present invention does not limit this, it is only for example. In addition, it should be noted that the element width of the tab element will not be greater than the maximum width boundary value, nor will it be less than the minimum width boundary value. In other words, the element width of the tab element will not increase infinitely as the width of the second terminal device increases, nor will it decrease infinitely as the width of the second terminal device decreases.
[0129] Specifically, taking the example of setting the number of displayable tab elements to 5, when the number of tab elements obtained above (first visual element R, first visual element S, first visual element T, first visual element U and first visual element V) is 5, if the screen aspect ratio of the second terminal device is 0.75 at this time, and the number of displayable tabs is 5, then the first visual element R, the first visual element S, the first visual element T, the first visual element U and the first visual element V can all be displayed in the display interface of the second terminal device, that is, the attribute information of the first visual element R, the first visual element S, the first visual element T, the first visual element U and the first visual element V are all displayed, and on the basis that multiple tab elements can be fully displayed, the attribute information of the first visual element R, the first visual element S, the first visual element T, the first visual element U and the first visual element V do not support scrolling.
[0130] Similarly, based on the above method, by determining the change rules of the aspect ratios of different numbers of tab elements in other screens, the attribute information of different numbers of tab elements in different screens can be determined. For the change rules of the aspect ratios of different numbers of tab elements in other screens, see Fig.11b and Fig.11c As shown, it specifically introduces how to determine the attribute information of different numbers of tab elements at different screen aspect ratios.
[0131] For example, Fig.11b What is provided is the change rules of different number of tab elements when the screen aspect ratio is 1.33 (for example, the display resolution is 1024*768). Fig.11b For example, for a display interface with a screen aspect ratio of 1.33, the number of tab elements that can be displayed is set to 4. Therefore, when the number of tab elements is less than or equal to 4, the tab elements can be fully displayed and scrolling is not supported, for example Fig.11b As shown in Tab A1-Tab B1, Tab A2-Tab C2, and Tab A3-Tab D3, since the number of tabs in each group is less than 4, each tab can be fully displayed without scrolling. It should be noted that the number of tab elements that can be displayed can be set according to demand, and the above is only an example and is not specifically limited.
[0132] For example, as shown in Tab A4-Tab E4, when the number of tab elements is greater than 4, since the width of the display screen is not sufficient to display more than 4 tab elements, the remaining tab elements (Tab E4) need to be set to not be displayed, and the displayed tab elements (Tab A4-Tab D4) are set to support scrolling so that the user can display the remaining tab elements (Tab E4) by sliding. It should be noted that since the number of displayable tab elements is 4, after the remaining tab elements (Tab E4) are displayed, Tab A4 is not displayed due to scrolling, while Tab B4 and Tab C4 continue to be displayed.
[0133] For example, Fig.11c What is provided is the change rules of different numbers of tab elements when the screen aspect ratio is 1.77 (for example, the display resolution is 1920*1080). Fig.11c For example, for a display interface with a screen aspect ratio of 1.77, the number of tab elements that can be displayed is set to 6. Therefore, when the number of tab elements is less than or equal to 6, the tab elements can be fully displayed and scrolling is not supported, for example Fig.11c As shown in Tab A1-Tab B1, Tab A2-Tab C2, and Tab A3-Tab D3, since the number of tabs in each group is less than 4, each tab can be fully displayed without scrolling. It should be noted that the number of tab elements that can be displayed can be set according to demand, and the above is only an example and is not specifically limited.
[0134] For example, as shown in Tab A4-Tab G4, when the number of tab elements is greater than 6, since the width of the display screen is not sufficient to display more than 6 tab elements, the remaining tab elements (Tab G4) need to be set to not be displayed, and the displayed tab elements (Tab A4-Tab F4) are set to support scrolling so that the user can display the remaining tab elements (Tab G4) by sliding.
[0135] The above-mentioned rules for changing the aspect ratio of other screens with different numbers of tab elements are also applicable to the display interface of multiple display windows. Specifically, the number of displayable tabs can be set by determining the aspect ratio of each display window, and the present invention will not elaborate on this.
[0136] It should be noted that, for elements of other types except tab elements and card elements, the process of determining the attribute information of the first visual element of this type can be specifically determined on the basis of determining the attribute information of each first visual element according to the number of first visual elements of each type obtained and the screen aspect ratio. For example, for the play bar element, in general, the number of play bar elements is 1, so the play bar element can be accommodated regardless of the screen size. Further, the attribute information of the play bar element is determined based on the number of play bar elements and the screen aspect ratio, wherein the attribute information is used for the play bar element to be displayable, the element width is the screen width, the font size is adjustable, and scrolling is not supported. In addition, it should be noted that in addition to the above-mentioned display status, element width, font size and scrolling status, the attribute information may also include other information, for example, the attribute information may also include color information, which is not limited in the embodiments of the present invention.
[0137] In an embodiment of the present invention, after step 1102, it also includes: modifying the attribute information of the first visual element to be displayed according to the display resolution and display requirements, and the display requirements are used to indicate the user's display requirements for the content displayed on the display interface of the second terminal device.
[0138] In an embodiment of the present invention, for example, in the above embodiment, the displayed tab elements include a first visual element R, a first visual element S, a first visual element T, a first visual element U, and a first visual element V. For example, taking the tab element including the tab element of music software as an example, the first visual element R represents "recommendation", the first visual element S represents "ranking", the first visual element T represents "radio", the first visual element U represents "discovery", and the first visual element V represents "mine". For example, when the current scene is a car scene, according to the display requirements of the car scene, the demand for content such as "discovery" and "ranking" is low, so the attribute information of the first visual element S and the first visual element U can be modified according to the display requirements to not display. In addition, for the displayable card elements (first visual element R, first visual element T, and first visual element V), the font size and scrolling state of the first visual element can be set according to the requirements. For example, the font size of the first visual element R obtained is 20. Since the display resolution of the second terminal device is smaller than the application interface, the size of the first visual element R can be adjusted accordingly, for example, the font size of the first visual element R is adjusted to 15.
[0139] In addition, the attribute information of the displayable first visual element can also be modified according to the display resolution. For example, when the width of the display resolution of the second terminal device is smaller than the width of the display interface of the application, if all the acquired first visual elements are displayed, the width of the second terminal device is not enough to accommodate all the first visual elements, resulting in overlapping of the displayed first visual elements. Therefore, on the basis of determining the attribute information of each first visual element, the attribute information of the displayable first visual element can also be modified according to the display resolution.
[0140] Step 1103: determine the number of grids occupied by the first visual element according to the type of the first visual element, the acquired attribute information of the first visual element and the preset element layout rules, wherein the element layout rules include layout rules corresponding to multiple types of first visual elements.
[0141] In an embodiment of the present invention, the element layout rules include layout rules corresponding to multiple types of first visual elements. In step 1103, it is first determined whether the attribute information of the first visual element is displayable, and further, the number of grids occupied by the displayable first visual element is determined. In other words, for the first visual element whose attribute information is not displayed, it is not necessary to determine the number of grids occupied by the first visual element. It should be noted that the process of determining the number of grids occupied by different types of first visual elements is different, as follows:
[0142] As an optional solution, taking the card element as an example, the element layout rule includes the correspondence between the number of card elements and the grids. Among them, the specific derivation process of the correspondence can determine the relationship between the number of first visual elements of each type and the number of grids through the correspondence between each screen aspect ratio and the number of card elements and the number of grids and the grid width corresponding to each screen aspect ratio. For example, when the screen aspect ratio includes 1.33≤aspect ratio<1.78, the number of card columns is 4, the number of card rows is 1, that is, the number of cards is 4, the number of display windows includes 1, the number of grids includes 8, the margin size includes 50dp, and the spacing size includes 30dp. Since the number of grids is 8 and the number of cards is 4, it can be calculated that the number of grids occupied by each card element is 2, that is, the height of each card element is 2 times the grid width.
[0143] For example, based on the above embodiment, when the screen aspect ratio includes 1.33≤aspect ratio<1.78, the first visual elements that can be displayed include: first visual element G, first visual element H, first visual element I and first visual element J. Since the display layout style corresponding to the screen aspect ratio includes 8 grids, it can be calculated that the number of grids occupied by the first visual element G, the first visual element H, the first visual element I and the first visual element J are all 2, that is, the height of each card element is twice the grid width. Fig.12 As shown, in Fig.12 2 represents the grid, 3 represents the margin, 4 represents the spacing, and 1 represents the display interface 1 of the second terminal device. Fig.12 The number of grids occupied by the first visual element G, the first visual element H, the first visual element I, and the first visual element J is 2. Similarly, the number of grids occupied by the first visual element G, the first visual element H, the first visual element I, and the first visual element J at other screen aspect ratios can be determined. For example, when the screen aspect ratio is 2.66 (display resolution 1920*1080), the number of grids occupied by the first visual element G, the first visual element H, the first visual element I, and the first visual element J is 3.
[0144] As another optional solution, taking the tab element as an example, the element layout rule includes the correspondence between different numbers of tab elements and different screen aspect ratios. Figure 11a-Figure 11c As shown by Figure 11a-Figure 11cIt can be seen that when the number of tab elements is 2, the number of grids occupied by the display screen at different screen aspect ratios is 2. When the number of tab elements is 3, the number of grids occupied by the display screen at different screen aspect ratios is 2. When the number of tab elements is 4, the number of grids occupied by the display screen at different screen aspect ratios is 2. When the number of tab elements is 5, the calculated element width can be determined as the number of grids occupied by the tab elements. It should be noted that the number of grids occupied by the tab elements is not an integer at this time.
[0145] For example, based on the above embodiment, it can be known that according to the display requirements, it is determined that the tab elements that can be displayed include the first visual element R, the first visual element T and the first visual element V, that is, the number of tab elements that can be displayed is 3. Fig.11a - Fig.11c The corresponding relationship between different numbers of tab elements and different screen aspect ratios is shown. It can be seen that the number of grids occupied by the first visual element R, the first visual element T, and the first visual element V are all 2. Therefore, taking the display resolution of 1920*1080 as an example, that is, when the screen aspect ratio is 1.77, Fig.13 As shown, in Fig.13 2 represents the grid, 3 represents the margin, 4 represents the spacing, and 1 represents the display interface 1 of the second terminal device. Fig.13 In FIG. 1 , the number of grids occupied by the first visual element R, the first visual element T, and the first visual element V are all 2 grids.
[0146] As another optional solution, taking the play bar element as an example, in general, the number of play bar elements is 1, so the play bar element can be accommodated regardless of the screen size. Therefore, when it is determined that the element type is a play bar, it can be determined that the number of grids occupied by the play bar element is the number of grids in the display layout style corresponding to the second terminal device.
[0147] For example, based on the above embodiment, it can be known that according to the display requirements, it is determined that the play bar element that can be displayed includes the first visual element Q, that is, the play bar element that can be displayed is 1. For example, when the display resolution includes 1920*1080, that is, when the screen aspect ratio is 1.77, Fig.14 As shown, in Fig.14 2 represents the grid, 3 represents the margin, 4 represents the spacing, and 1 represents the display interface 1 of the second terminal device. Fig.14 In the example, the number of grids occupied by the first visual element Q is 12. For example, when the display resolution is 1920*720, that is, the screen aspect ratio is 2.66, Fig.15 As shown, in Fig.15In , 2 represents the grid of the first display window 1, 3 represents the margin of the first display window 1, 4 represents the spacing of the first display window 1, 1 represents the first display window 1 of the second terminal device, 5 represents the second display window of the second terminal device, 6 represents the grid of the second display window 5, 7 represents the spacing of the second display window 5, 8 represents the spacing of the second display window 5, and 9 represents the column spacing between the first display window 1 and the second display window 5. Fig.15 In the example, when the first visual element Q is placed in the second display window 5, the number of grids occupied by the first visual element Q is 4. That is, the number of grids occupied by the play bar element is the number of grids of the display window where the play bar element is located.
[0148] It should be noted that when the play bar element includes multiple sub-elements, the positions of the sub-elements can be adaptively adjusted according to the size of the grids occupied, and each sub-element occupies a specified number of grids. The layout of the sub-elements in the embodiment of the present invention is not repeated, and the layout between the sub-elements can be obtained by referring to the layout between the elements. Fig.15 For example, when the number of grids is 4 and the number of buttons is 3, the buttons can be divided equally with reference to the above embodiment to obtain the width of each button (the number of grids it occupies). Specifically, the formula w=(W-2L-3S) / 3 is used, where w represents the width of each button, W represents the width of the second display window 5, L represents the margin, S represents the spacing, 2 represents that the second display window 5 has 2 margins, and 3 represents that the second display window 5 has 3 margins. After calculating the width of the button, the number of grids occupied by each button is obtained. It should be noted that the number of grids obtained in this process is not an integer.
[0149] Step 1104: Obtain device information of the second terminal device, where the device information includes the size of the display area, the position of the display area, and the device type.
[0150] In the embodiment of the present invention, the device information may include other information in addition to the display area size, the display area position or the device type, which is not limited in the embodiment of the present invention.
[0151] Step 1105: determine the position of the first visual element according to the device information and the number of grids occupied by the first visual element, wherein the position includes the display window where the first visual element is located and the position of the display window in the display area of the second terminal device.
[0152] In an embodiment of the present invention, the first visual element, for example, when the device type of the second terminal device includes a vehicle computer, due to the vehicle computer scenario, it is usually necessary to layout the first visual element in the left half of the display interface (the driver is located on the left side of the vehicle) for display, and on this basis, the position of the first visual element is determined according to the display interval size and position in the device information, wherein the position includes the display window where the first visual element is located and the position in the display window.
[0153] As an optional solution, taking the car scene as an example, Fig.16 As shown, the first visual element R, the first visual element T and the first visual element V are displayed on the left, which is convenient for the driver to operate the display interface and improves the user experience.
[0154] Step 1106: In the display layout style, multiple first visual elements are laid out according to the position of each first visual element and the number of grids occupied by each first visual element to generate a display interface of the second terminal device.
[0155] In the embodiment of the present invention, the margin is used to indicate the distance between the first visual elements, and the spacing is used to indicate the distance between the first visual element and the edge of the display interface. The total number of grids occupied by the plurality of first visual elements is less than or equal to the number of grids.
[0156] In an embodiment of the present invention, based on the above steps, after determining the positions and the number of grids occupied by multiple tab elements (first visual element R, first visual element T and first visual element V), multiple card elements (first visual element G, first visual element H, first visual element I and first visual element J) and a play bar element (first visual element Q), step 1106 is executed to layout the multiple first visual elements to generate a display interface of the second terminal device.
[0157] For example, take the display layout style corresponding to the display resolution of 1920*1080 as an example. Fig.17 As shown, in Fig.17 2 represents the grid, 3 represents the margin, 4 represents the spacing, and 1 represents the display interface 1 of the second terminal device. Fig.17 , the number of grids occupied by the first visual element R, the first visual element T and the first visual element V is 2 grids each, and the first visual element R, the first visual element T and the first visual element V are located in the upper left corner of the display interface 1, the number of grids occupied by the first visual element G, the first visual element H, the first visual element I and the first visual element J is 3 grids, and the number of grids occupied by the first visual element Q is 12 grids, that is, the first visual element Q occupies all the grids of the display interface 1.
[0158] For example, take the display layout style corresponding to the display resolution of 1920*720 as an example. Fig.18 As shown, in Fig.18 , 2 represents the grid of the first display window 1, 3 represents the margin of the first display window 1, 4 represents the spacing of the first display window 1, 1 represents the first display window 1 of the second terminal device, 5 represents the second display window of the second terminal device, 6 represents the grid of the second display window 5, 7 represents the spacing of the second display window 5, 8 represents the spacing of the second display window 5, and 9 represents the column spacing between the first display window 1 and the second display window 5. Fig.18 , the number of grids occupied by the first visual element R, the first visual element T and the first visual element V are all 2 grids and the first visual element R, the first visual element T and the first visual element V are located in the upper left corner of the first display window 1, the number of grids occupied by the first visual element G, the first visual element H, the first visual element I and the first visual element J are 3 grids and the first visual element G, the first visual element H, the first visual element I and the first visual element J are located in the first display window 1, the number of grids occupied by the first visual element Q is 4 grids and the first visual element Q is located in the second display window 5, that is, the first visual element Q occupies the grids of the second display window 5.
[0159] It should be noted that the arrangement order of the tab elements, card elements and play bar elements can be set according to the needs, for example, the play bar elements are displayed first, then the card elements are displayed, and finally the tab elements are displayed. It should also be noted that when the display interface includes multiple display windows, the position of the first visual element can be adjusted according to the number of first visual elements that can be displayed, so as to avoid placing multiple first visual elements in the same display window, resulting in poor layout effect.
[0160] In the embodiment of the present invention, the first visual element is laid out by the above method. Compared with the related art, the embodiment of the present invention adopts the aspect ratio division standard, and the above method can adapt to multiple second terminal devices of different sizes. Furthermore, the interface layout method provided by the embodiment of the present invention can also select the first visual element, modify the attribute information of the first visual element, and lay out the first visual element according to the display layout style, thereby ensuring that the first visual element can achieve a visual effect that is neat, beautiful, easy to use, and adapted to the second terminal device.
[0161] In the embodiment of the present invention, after step 110, further comprising:
[0162] Step 112: display the display interface in a virtual screen, and project the display interface to the second terminal device so that the display screen of the second terminal device displays the display interface.
[0163] In an embodiment of the present invention, a virtual screen is created on a first terminal device, and the virtual screen is used to project a display interface to a second terminal device to achieve mirroring presentation of the second terminal device.
[0164] In the embodiment of the present invention, after step 110, further comprising:
[0165] Step 114: Receive an event for switching the display interface sent by the second terminal device, and based on the event for switching the display interface and based on the display layout style, select a second visual element from the application page of the first terminal device, and layout the second visual element according to the display layout style to generate a display interface for the second terminal device.
[0166] In this step, the second visual element may include one visual element or a group of visual elements.
[0167] In the embodiment of the present invention, it is considered that the user will slide on the second terminal device to switch to the next display interface. Therefore, in order to ensure that the next display interface can also achieve the visual effect of neatness, beauty and ease of use of the second visual element, the second terminal device needs to send the first terminal device an event for switching the display interface, so that the next display interface of the second terminal device can be generated based on the processing operation of the first terminal device. It is also understood that each time a page is switched, the interface layout method provided by the embodiment of the present invention can be executed.
[0168] It should be noted that, in addition to the event for switching the display interface, which can execute the above-mentioned interface layout method, other events for ensuring the friendliness of the display interface are all within the scope of protection of the embodiments of the present invention.
[0169] In an embodiment of the present invention, when a first terminal device is connected to a second terminal device, a display resolution of the second terminal device is obtained; a screen aspect ratio of the second terminal device is calculated according to the display resolution, and a ratio interval in which the screen aspect ratio is located is determined from a plurality of pre-divided ratio intervals; a display layout style corresponding to the ratio interval is obtained according to the ratio interval in which the screen aspect ratio is located; based on the display layout style, a first visual element is selected from an application page of the first terminal device; the first visual element is laid out according to the display layout style to generate a display interface of the second terminal device, and by setting display layout styles corresponding to different ratio intervals, when the first visual element is laid out according to the display layout style, it is ensured that the first visual element can achieve a visual effect that is neat, beautiful, easy to use, and adapted to the second terminal device.
[0170] Fig.19FIG. 1 is a schematic block diagram of an electronic device 110 provided in one embodiment of the present invention. It should be understood that the electronic device 110 is capable of executing Figure 3 To avoid repetition, the various steps in the interface layout method are not described in detail here. Fig.19 As shown, the electronic device 110 includes: an interaction unit 401 , a processing unit 402 and a display unit 403 .
[0171] The interaction unit 401 is used to obtain the display resolution of the second terminal device when the first terminal device is connected to the second terminal device.
[0172] The processing unit 402 is used to calculate the screen aspect ratio of the second terminal device according to the display resolution, and determine the proportion interval in which the screen aspect ratio is located from multiple pre-divided proportion intervals; according to the proportion interval in which the screen aspect ratio is located, obtain the display layout style corresponding to the proportion interval.
[0173] The interaction unit 401 is further configured to select a first visual element from an application page of the first terminal device based on the display layout style.
[0174] The processing unit 402 is further configured to layout the first visual elements according to the display layout style to generate a display interface of the second terminal device.
[0175] In an embodiment of the present invention, the display layout style includes the number of display windows, the number of grids, the grid width, the margin, and the spacing, wherein each display window includes a different number of grids, the margin is used to indicate the distance between the first visual element and the edge of the display interface of the second terminal device, and the spacing is used to indicate the distance between the first visual elements;
[0176] The processing unit 402 is specifically used to determine the number of grids occupied by the first visual element according to the type of the first visual element, the acquired attribute information of the first visual element and the preset element layout rules, wherein the element layout rules include layout rules corresponding to multiple types of first visual elements.
[0177] In the embodiment of the present invention, the interaction unit 401 is further configured to obtain device information of the second terminal device, where the device information includes the size of the display area, the position of the display area, and the device type.
[0178] The processing unit 402 is also used to determine the position of the first visual element based on the device information and the number of grids occupied by the first visual element, wherein the position includes the display window where the first visual element is located and the position of the display window in the display area of the second terminal device.
[0179] In the embodiment of the present invention,
[0180] The processing unit 402 is specifically used to layout multiple first visual elements in the display layout style according to the acquired position of each first visual element and the number of grids occupied by each first visual element, so as to generate a display interface of the second terminal device, wherein the total number of grids occupied by the multiple first visual elements is less than or equal to the number of grids.
[0181] In an embodiment of the present invention, the processing unit 402 is also used to identify the type of each first visual element; based on the acquired number of first visual elements of each type and the screen aspect ratio, determine the attribute information of each first visual element, wherein the attribute information includes display status, element width, font size and scrolling status.
[0182] In an embodiment of the present invention, the processing unit 402 is further used to modify the attribute information of the first visual element to be displayed according to the display resolution and display requirements, and the display requirements are used to indicate the user's display requirements for the content displayed on the display interface of the second terminal device.
[0183] In the embodiment of the present invention, the display unit 403 is used to display the display interface on the virtual screen.
[0184] The processing unit 402 is further configured to project the display interface to the second terminal device so that the display screen of the second terminal device displays the display interface.
[0185] The interaction unit 401 is also used to receive an event for switching the display interface sent by the second terminal device, and according to the event for switching the display interface, based on the display layout style, select a second visual element from the application page of the first terminal device, and layout the second visual element according to the display layout style to generate a display interface for the second terminal device.
[0186] In the embodiment of the present invention, the reverse control event includes a display interface switching event.
[0187] It should be understood that the electronic device 110 here is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this. For example, a "unit" can be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a proprietary processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit, and / or other suitable components that support the described functions.
[0188] Therefore, the units of each example described in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0189] An embodiment of the present invention further provides an electronic device, which may be a first terminal device or a circuit device built into the first terminal device. The device may be used to execute the functions / steps in the above method embodiment.
[0190] Fig. 20 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Fig. 20 As shown, the electronic device 900 includes a processor 910 and a transceiver 920. Optionally, the electronic device 900 may also include a memory 930. The processor 910, the transceiver 920 and the memory 930 may communicate with each other through an internal connection path to transmit control and / or data signals, and the memory 930 is used to store a computer program, and the processor 910 is used to call and run the computer program from the memory 930.
[0191] Optionally, the electronic device 900 may further include an antenna 940 for transmitting the wireless signal output by the transceiver 920 .
[0192] The processor 910 and the memory 930 may be combined into a processing device, or more commonly, they are independent components. The processor 910 is used to execute the program code stored in the memory 930 to implement the above functions. In specific implementation, the memory 930 may also be integrated into the processor 910, or may be independent of the processor 910. Fig.19 Corresponding to the processing unit 402 in the electronic device 110.
[0193] In addition, in order to make the functions of the electronic device 900 more complete, the electronic device 900 may further include one or more of an input unit 960, a display unit 970, an audio circuit 980, a camera 990, and a sensor 901, and the audio circuit may further include a speaker 982, a microphone 984, and the like. The display unit 970 may include a display screen, and the display unit 970 may be connected to a display device 980. Fig.19 Corresponding to the display unit 403 in the electronic device 110.
[0194] Optionally, the electronic device 900 may further include a power supply 950 for providing power to various devices or circuits in the first terminal device.
[0195] It should be understood that Fig. 20 The electronic device 900 shown can implement Figure 3 The various processes of the method embodiment shown. The operations and / or functions of the various units in the electronic device 900 are respectively to implement the corresponding processes in the above method embodiment. For details, please refer to the description in the above method embodiment. To avoid repetition, the detailed description is appropriately omitted here.
[0196] It should be understood that Fig. 20 The processor 910 in the electronic device 900 shown may be a system on a chip (SOC), which may include a central processing unit (CPU), and may further include other types of processors, the CPU may be called a main CPU. The processors of each part cooperate to implement the previous method flow, and each processor may selectively execute a part of the software driver.
[0197] In summary, the various processors or processing units within the processor 910 can work together to implement the previous method flow, and the corresponding software programs of the various processors or processing units can be stored in the memory 930.
[0198] The present invention also provides a computer-readable storage medium in which instructions are stored. When the instructions are executed on a computer, the computer executes the above-mentioned Figure 3 The various steps in the interface layout method shown.
[0199] In the above embodiments, the processor 910 involved may include, for example, a central processing unit (CPU), a microprocessor, a microcontroller or a digital signal processor, and may also include a GPU, an NPU and an ISP. The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as application-specific integrated circuits (ASICs), or one or more integrated circuits for controlling the execution of the program of the technical solution of the present invention. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a memory.
[0200] The memory may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.
[0201] In the embodiments of the present invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. A and B may be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c may be single or multiple.
[0202] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0203] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0204] In several embodiments provided by the present invention, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0205] The above is only a specific embodiment of the present invention. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. An interface layout method, applied to a first terminal device, characterized in that: include: When the first terminal device is connected to the second terminal device, obtaining the display resolution of the second terminal device; Calculating the screen aspect ratio of the second terminal device according to the display resolution, and determining the ratio interval in which the screen aspect ratio is located from a plurality of pre-divided ratio intervals; wherein: the plurality of pre-divided ratio intervals are obtained according to the aspect ratios of a plurality of terminal devices; According to the ratio interval in which the screen aspect ratio value is located, a display layout style corresponding to the ratio interval is obtained; wherein, if the screen aspect ratio is in the target ratio interval, the obtained display layout style includes at least two display windows; the display layout style includes the number of display windows, the number of grids, the grid width, the margin and the spacing, wherein the number of grids contained in each display window is different, the margin is used to indicate the distance between the first visual element and the edge of the display interface of the second terminal device, and the spacing is used to indicate the distance between the first visual elements; Based on the display layout style, selecting a first visual element from an application page of the first terminal device; Determining whether the first visual element is a displayable element according to a preset element layout rule; If so, then determine the number of grids occupied by the first visual element according to the type of the first visual element, the acquired attribute information of the first visual element, and the preset element layout rules, wherein the element layout rules include layout rules corresponding to multiple types of first visual elements; obtain device information of the second terminal device, the device information including the size of the display area, the position of the display area, and the device type; determine the position of the first visual element according to the device information and the number of grids occupied by the first visual element, the position including the display window in which the first visual element is located and the position of the display window in the display area of the second terminal device; and layout the first visual elements according to the display layout style to generate a display interface of the second terminal device.
2. The method according to claim 1, characterized in that: The step of laying out the first visual elements according to the display layout style to generate a display interface of the second terminal device includes: In the display layout style, multiple first visual elements are laid out based on the acquired position of each first visual element and the number of grids occupied by each first visual element to generate a display interface of the second terminal device, wherein the total number of grids occupied by multiple first visual elements is less than or equal to the number of grids.
3. The method according to claim 1, characterized in that Before determining the number of grids occupied by the first visual element according to the type of the first visual element, the acquired attribute information of the first visual element and the preset element layout rule, the method further includes: identifying a type of each of the first visual elements; According to the acquired number of first visual elements of each type and the screen aspect ratio, attribute information of each first visual element is determined, wherein the attribute information includes display status, element width, font size, and scrolling status.
4. The method according to claim 3, characterized in that After determining the attribute information of each first visual element according to the acquired number of first visual elements of each type and the screen aspect ratio, the method further includes: The attribute information of the first visual element to be displayed is modified according to the display resolution and the display requirement, wherein the display requirement is used to indicate the user's display requirement for the content displayed on the display interface of the second terminal device.
5. The method according to claim 1, characterized in that After the first visual elements are laid out according to the display layout style to generate a display interface of the second terminal device, the method further includes: The display interface is displayed in a virtual screen, and the display interface is projected to the second terminal device so that the display screen of the second terminal device displays the display interface.
6. The method according to claim 1, characterized in that After the first visual elements are laid out according to the display layout style to generate a display interface of the second terminal device, the method further includes: Receive an event for switching the display interface sent by the second terminal device, and according to the event for switching the display interface and based on the display layout style, select a second visual element from the application page of the first terminal device, and layout the second visual element according to the display layout style to generate a display interface for the second terminal device.
7. An electronic device, characterized in that: include: Display screen; one or more processors; Memory; And one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the device, enable the device to execute the interface layout method described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the interface layout method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Page adaptation method and device, equipment and storage medium
CN110147230A
Interface generation method and equipment
CN110554816A
Display interface adaptation method, display interface adaptation design method and electronic equipment
CN111190681A
Interface layout method, device and system
CN111399789A
Screen display method and device, terminal equipment and storage medium
CN111986601A
