Adaptive display method and device for application page

By creating a virtual view tree in the terminal device and adjusting the strategy according to the page element attributes, the problem of poor application page display on devices with different screen sizes is solved, efficient adaptive display is achieved, and development costs and workload are reduced.

WO2024193215A1PCT designated stage expired Publication Date: 2024-09-26HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/073222
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-20
Filing Date
2024-01-19
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

When the existing technology displays application pages on devices with different screen sizes, it is prone to problems such as oversized images, oversized fonts, excessive white space, page deformation, and unreasonable alignment, resulting in poor user experience. Adaptation requires increased development costs and workload.

Method used

By creating a virtual view tree in the terminal device and determining the adjustment strategy based on the attributes of the page elements, measurement and layout can be achieved without invading the original application. Page elements can be dynamically adjusted to adapt to different screen sizes, maintaining the original layout while optimizing the display effect.

Benefits of technology

It can adapt to page display of different screen sizes without increasing development costs, improve user experience, reduce development workload, and is suitable for any application page and screen size.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024073222_26092024_PF_FP
    Figure CN2024073222_26092024_PF_FP
Patent Text Reader

Abstract

An adaptive display method and device for an application page, relating to the technical field of terminals. The adaptive adjustment of an application page can be conveniently and quickly performed while reducing the application page development costs. In the present application, the following five steps can be added to a conventional application page drawing process for a terminal device: zooming, constructing a virtual view tree, marking element attributes, determining an adjustment strategy, performing measurement and layout, and mapping. Provided is a method having high universality and compatibility and capable of adaptively displaying an application page on a terminal side without changing the original application page layout, so as to conveniently and quickly perform the adaptive adjustment of an application page while reducing the application page development costs. Moreover, according to the scheme, a minority of key parameters can be modified on the basis of a preset more refined adjustment strategy, and a more targeted and fine-grained adjustment strategy is used for page elements of different attributes on an application page to be adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

Adaptive application page display method and device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 20, 2023, with application number 202310303867.3 and application name “A method and device for displaying an adaptive application page”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a method and device for adaptively displaying application pages. Background Art

[0003] With the rapid and diversified development of terminal device hardware and software technologies, terminal devices of different screen sizes (such as foldable screen mobile phones, tablets, etc.) can achieve a variety of functions based on the software running on them. However, when the same application page is displayed on screens of different sizes, if corresponding adaptation adjustments are not made, there may be problems such as the black border area being too large as shown in Figure 1 (a), or the large image and large font problem caused by overall enlargement as shown in Figure 1 (b). Or there may also be other problems such as excessive white space as shown in Figure 2 (a) due to overall reduction, or problems such as misalignment of page elements, page deformation, and unreasonable gaps between page elements as shown in Figure 2 (b) due to adjustments based on other preset strategies (such as centering strategies), affecting the user's perception of the application. In some cases, the unreasonable layout of the application interface may also result in less content being displayed in the display area where the page is located, and the display area where the page is located is not fully utilized.

[0004] Currently, to better adapt app pages to screens of varying sizes, developers often develop app pages tailored to the screen size. While this approach can achieve better display quality, it significantly increases the developer's workload and incurs high initial development costs.

[0005] Summary of the Invention

[0006] The present application provides an adaptive application page display method and device, which can conveniently and quickly perform adaptive adjustment of application pages while saving application page development costs.

[0007] To achieve the above objectives, this application adopts the following technical solutions:

[0008] In a first aspect, an adaptive application page display method is provided, which can be applied to a terminal device, and the method includes: the terminal device obtains page information of an application page including a target page area; the terminal device creates, measures and layouts a first application view tree of the target page area based on the above page information; the terminal device creates a virtual view tree corresponding to the first application view tree, wherein the virtual view tree includes view components in the first application view tree; the terminal device determines an adjustment strategy based on element attributes of elements in the target page area; the terminal device measures and layouts the virtual view tree based on the determined adjustment strategy; the terminal device maps the view components in the virtual view tree to the first application view tree to obtain a second application view tree; the terminal device draws the above application page based on the second application view tree.

[0009] The first application view tree is the view tree of the original application interface, and the second application view tree is the view tree of the application interface after adaptive layout adjustment based on this solution.

[0010] The solution provided by the first aspect above allows the terminal device to implement the measurement and layout process without intruding into the original application by adding key steps such as building a virtual view tree and determining the adjustment strategy based on the element attributes to the conventional application page drawing process. Therefore, there is no need for the application developer to carry out additional application page development, which greatly reduces the development cost of the application page. In addition, the method provides a universal application page adjustment solution, so it has strong compatibility and versatility and can be applied to any application page and any screen size. In addition, the solution can make use of the capabilities of existing basic controls, retain most of the parameters, modify a small number of key parameters based on a more refined adjustment strategy that is pre-set, and adopt a more targeted and fine-grained adjustment strategy for the page elements with different attributes on the application page to be adjusted. While retaining the original layout method to the greatest extent, it improves the problems of large images and large fonts, excessive white space, deformation, and unreasonable alignment that exist in conventional technologies when displaying pages.

[0011] As a possible implementation, the target page area is the entire page area of ​​the application page; or the target page area is a partial page area of ​​the application page. In other words, based on the solution provided by this application, not only can the entire application page be adaptively adjusted conveniently and quickly, but also partial page areas of the application page can be adaptively adjusted, which is highly flexible and versatile.

[0012] As a possible implementation, the target page area includes one or more controls, which include one or more of the following page elements: text, icons, and images. This application supports adaptive adjustment of application pages that include any type of elements, with high flexibility and versatility.

[0013] As a possible implementation method, the terminal device determines an adjustment strategy based on the element attributes of the elements in the target page area, including: the terminal device determines the adjustment strategy based on one or more of the type of elements in the target page area, the layout of the elements, and the size of the elements. Based on this, the terminal device can modify a small number of key parameters based on a more refined adjustment strategy, and adopt a more targeted and fine-grained adjustment strategy for page elements with different attributes on the application page to be adjusted, while retaining the original layout to the greatest extent possible, while improving the problems of large images and large fonts, excessive white space, deformation, unreasonable alignment, etc. in the page display of conventional technologies.

[0014] As a possible implementation, the layout of the above elements includes one or more of the following: linear layout, single frame layout, relative layout, constraint layout, and table layout. This application supports adaptive adjustment of application pages using any layout method, with high flexibility and strong versatility.

[0015] As a possible implementation method, the terminal device determines an adjustment strategy based on the element attributes of the elements in the target page area, including: the terminal device maintains the layout of the elements in the target page area unchanged; for elements in the target page area whose element type is text or icon, the terminal device adopts an adjustment strategy that maintains the aspect ratio; and / or, for elements in the target page area whose element type is a picture and the size of the picture meets the preset conditions, the terminal device adopts an adjustment strategy that maintains the aspect ratio. Based on this, the terminal device can modify a small part of the key parameters based on a more refined adjustment strategy, and adopt a more targeted and fine-grained adjustment strategy for page elements with different attributes on the application page to be adjusted, while retaining the original layout to the greatest extent, improving the problems of large images and large fonts, excessive white space, deformation, unreasonable alignment, etc. in the page display in conventional technologies.

[0016] As one possible implementation, the terminal device maintains the layout of elements in the target page area unchanged, including maintaining the alignment of elements in the target page area unchanged. This allows the terminal device to retain the original layout to the greatest extent possible, reducing the terminal device's workload and potentially minimizing issues that may arise during application page display.

[0017] As one possible implementation, the terminal device creates a virtual view tree corresponding to the first application view tree, including: obtaining the positional relationships between view components in the first application view tree; and creating one or more containers based on the positional relationships to serve as parent controls for the view components. This constructs a virtual view tree with a layout hierarchy, facilitating refined adjustments to elements in subsequent target page area display adjustments, significantly reducing the computational complexity of these adjustments and improving their efficiency.

[0018] As a possible implementation, the terminal device obtains the positional relationship between view components in the first application view tree by: obtaining the positional relationship from a layout file in the page information; or obtaining the positional relationship by analyzing the relative positions of the view components in the first application view tree. This facilitates the terminal device to construct a more scientific virtual view tree with a layout hierarchy.

[0019] As one possible implementation, the terminal device maps a view component in the virtual view tree to the first application view tree, including: the terminal device determines a scale value and a translation value of the view component by analyzing changes in the position of the view component in the first application view tree and the virtual view tree; and the terminal device maps the view component in the virtual view tree to the first application view tree based on the scale value and the translation value. In this way, the terminal device can accurately map the virtual view tree to the first application view tree.

[0020] As a possible implementation manner, the terminal device obtains the page information of the application page, including: the terminal device obtains the page information of the application page from the application server corresponding to the application page.

[0021] In a second aspect, a terminal device is provided, which includes: a memory for storing computer program instructions; a processor for executing the computer program instructions to support the terminal device to perform the following operations: obtaining page information of an application page including a target page area; creating, measuring and laying out a first application view tree of the target page area based on the above page information; creating a virtual view tree corresponding to the first application view tree, wherein the virtual view tree includes view components in the first application view tree; determining an adjustment strategy based on element attributes of elements in the target page area; measuring and laying out the virtual view tree based on the determined adjustment strategy; mapping the view components in the virtual view tree to the first application view tree to obtain a second application view tree; and drawing the above application page based on the second application view tree.

[0022] The solution provided in the second aspect above allows the terminal device to implement the measurement and layout process without intruding into the original application by adding key steps such as building a virtual view tree and determining the adjustment strategy based on the element attributes to the conventional application page drawing process. Therefore, there is no need for the application developer to develop additional application pages, which greatly reduces the development cost of the application page. In addition, the method provides a universal application page adjustment solution, so it has strong compatibility and versatility and can be applied to any application page and any screen size. In addition, the solution can make use of the capabilities of existing basic controls, retain most of the parameters, modify a small number of key parameters based on a more refined adjustment strategy that is pre-set, and adopt a more targeted and fine-grained adjustment strategy for page elements with different attributes on the application page to be adjusted. While retaining the original layout method to the greatest extent, it improves the problems of large images and large fonts, excessive white space, deformation, and unreasonable alignment that exist in conventional technologies when displaying pages.

[0023] As a possible implementation manner, the terminal device further includes: a display screen, configured to display the application page drawn according to the second application view tree.

[0024] As a possible implementation, the target page area is the entire page area of ​​the application page; or the target page area is a partial page area of ​​the application page. In other words, based on the solution provided by this application, not only can the entire application page be adaptively adjusted conveniently and quickly, but also partial page areas of the application page can be adaptively adjusted, which is highly flexible and versatile.

[0025] As a possible implementation, the target page area includes one or more controls, which include one or more of the following page elements: text, icons, and images. This application supports adaptive adjustment of application pages that include any type of elements, with high flexibility and versatility.

[0026] As a possible implementation method, the processor determines the adjustment strategy based on the element attributes of the elements in the target page area, including: the processor determines the adjustment strategy based on one or more of the type of elements in the target page area, the layout of the elements, and the size of the elements. Based on this, the terminal device can modify a small number of key parameters based on a more refined adjustment strategy, and adopt a more targeted and fine-grained adjustment strategy for page elements with different attributes on the application page to be adjusted, while retaining the original layout to the greatest extent possible, while improving the problems of large images and large fonts, excessive white space, deformation, unreasonable alignment, etc. in the page display of conventional technologies.

[0027] As a possible implementation, the layout of the above elements includes one or more of the following: linear layout, single frame layout, relative layout, constraint layout, and table layout. This application supports adaptive adjustment of application pages using any layout method, with high flexibility and strong versatility.

[0028] As a possible implementation method, the processor determines an adjustment strategy based on the element attributes of the elements in the target page area, including: the processor maintains the layout of the elements in the target page area unchanged; for elements in the target page area whose element type is text or icon, the processor adopts an adjustment strategy that maintains the aspect ratio; and / or, for elements in the target page area whose element type is a picture and the size of the picture meets the preset conditions, the processor adopts an adjustment strategy that maintains the aspect ratio. Based on this, the terminal device can modify a small part of the key parameters based on a more refined adjustment strategy, and adopt a more targeted and fine-grained adjustment strategy for page elements with different attributes on the application page to be adjusted, while retaining the original layout to the greatest extent, it improves the problems of large images and large fonts, excessive white space, deformation, unreasonable alignment, etc. in the page display of conventional technologies.

[0029] As one possible implementation, the processor maintains the layout of elements in the target page area unchanged, including maintaining the alignment of elements in the target page area unchanged. This allows the terminal device to retain the original layout to the greatest extent possible, reducing the workload of the terminal device and minimizing potential issues that may arise during application page display.

[0030] As one possible implementation, the processor creates a virtual view tree corresponding to the first application view tree, including: obtaining the positional relationships between view components in the first application view tree; and creating one or more containers based on the positional relationships to serve as parent controls for the view components. This constructs a virtual view tree with a layout hierarchy, facilitating refined adjustments to elements in subsequent target page area display adjustments, significantly reducing the computational complexity of these adjustments and improving their efficiency.

[0031] As a possible implementation, the processor obtains the positional relationship between view components in the first application view tree, including: obtaining the positional relationship from a layout file in the page information; or obtaining the positional relationship by analyzing the relative positions of the view components in the first application view tree. This facilitates the terminal device to construct a more scientific virtual view tree with a layout hierarchy.

[0032] As one possible implementation, the processor maps the view component in the virtual view tree to the first application view tree, including: the processor determining a scale value and a translation value of the view component by analyzing a position change of the view component in the first application view tree and the virtual view tree; and mapping the view component in the virtual view tree to the first application view tree based on the scale value and the translation value. Based on this, the terminal device can accurately map the virtual view tree to the first application view tree.

[0033] According to a third aspect, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method according to any possible implementation of the first aspect is implemented.

[0034] According to a fourth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to implement the method according to any possible implementation of the first aspect.

[0035] In a fifth aspect, a chip system is provided, comprising a processing circuit and a storage medium storing computer program instructions; when the computer program instructions are executed by the processor, the method according to any possible implementation of the first aspect is implemented. The chip system may be composed of a chip alone or may include a chip and other discrete components. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a schematic diagram of two common application page display effects;

[0037] Figure 2 is a schematic diagram of the display effects of two other common application pages;

[0038] FIG3 is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;

[0039] FIG4 is a schematic diagram of a software structure of a terminal device provided in an embodiment of the present application;

[0040] FIG5A is a schematic diagram of a conventional application page drawing process;

[0041] FIG5B is a schematic diagram of the structure of a view tree (ViewTree) provided in an embodiment of the present application;

[0042] FIG5C is a schematic diagram of related parameters of a page element provided in an embodiment of the present application;

[0043] FIG6 is a schematic diagram of an application page drawing process provided by an embodiment of the present application;

[0044] FIG7 is a schematic diagram of a zoom effect of a target page area provided in an embodiment of the present application;

[0045] FIG8 is a schematic diagram of a virtual ViewTree construction result provided in an embodiment of the present application;

[0046] FIG9A is an example diagram of the effect of adding auxiliary controls according to an embodiment of the present application;

[0047] FIG9B is another example diagram of the effect of adding auxiliary controls according to an embodiment of the present application;

[0048] FIG10 is an example diagram of element attributes corresponding to elements in a target page area provided by an embodiment of the present application;

[0049] FIG11 is a schematic diagram of properties of an element in a control in a virtual ViewTree provided in an embodiment of the present application;

[0050] FIG12 is a schematic diagram showing the effect of layout of a virtual ViewTree according to an embodiment of the present application;

[0051] FIG13 is a schematic diagram of the effect of layout of a virtual ViewTree provided by an embodiment of the present application;

[0052] FIG14 is a schematic diagram of an application page display effect provided in an embodiment of the present application;

[0053] FIG15 is a schematic diagram of another application page display effect provided in an embodiment of the present application;

[0054] FIG16 is a schematic diagram of another application page display effect provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0056] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0057] In order to adapt the application interface to screens of different sizes without increasing additional development costs, an embodiment of the present application provides an adaptive application page display method. This method does not change the original layout of the application. When the application page is displayed on the device side, the layout display of the application page is adjusted in real time according to the page layout of the application and the screen size of the device.

[0058] In some embodiments, the method can be implemented based on the improvement of the framework (FWK) layer of the terminal device. For example, the manufacturer of the terminal device can improve the FWK layer by improving the open source project, such as Open Source Project It is optimized by the Open Source Project (AOSP) and integrated into the framework layer of the terminal device to achieve the function of adjusting the layout display of the application page in real time according to the application page layout and the screen size of the device.

[0059] Because this method doesn't alter the original app layout, only the layout of the app page displayed on the device, it eliminates the need for app developers to develop additional app pages, significantly reducing development costs. Furthermore, this method provides a universal app page adjustment solution, making it highly compatible and versatile, applicable to any app page and screen size.

[0060] In addition, in some embodiments, an adaptive application page display method provided by the embodiments of the present application can be based on a pre-set more refined adjustment strategy, and adopt a more targeted adjustment strategy for page elements with different attributes on the application page to be adjusted, so that the element proportions, sizes, layouts and other aspects can be displayed to the user in a more reasonable and beautiful effect, thereby improving the user's visual experience during the use of the application.

[0061] The terminal device described in the embodiments of the present application may include, but is not limited to, a smartphone (including a foldable screen phone and a non-foldable screen phone), a netbook, a tablet computer, a smart watch, a smart bracelet, a phone watch, a smart camera, a PDA, a personal computer (PC), a personal digital assistant (PDA), a portable multimedia player (PMP), an augmented reality (AR) / virtual reality (VR) device, a television, a projection device, or a somatosensory game console in a human-computer interaction scenario. Alternatively, the terminal device may also be an electronic device including a camera of other types or structures, which is not limited in the embodiments of the present application.

[0062] Please refer to FIG3 , which shows a schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application.

[0063] As shown in FIG3 , the terminal device may include a processor 310, a memory (including an external memory interface 320 and an internal memory 321), a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera 393, a display screen 394, etc. The sensor module 380 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0064] It should be understood that the structures illustrated in the embodiments of the present invention do not constitute specific limitations on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

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

[0066] Processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 310 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 310. If processor 310 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 310 latency, and thus improves system efficiency.

[0067] In some embodiments, the processor 310 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0068] It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only for illustrative purposes and does not constitute a structural limitation on the terminal device. In other embodiments of the present application, the terminal device may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.

[0069] The charging management module 340 is configured to receive charging input from a charger. The power management module 341 is configured to connect the battery 342, the charging management module 340, and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340 to power the processor 310, the internal memory 321, the display 394, the camera 393, and the wireless communication module 360.

[0070] The wireless communication function of the terminal device can be implemented through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem processor and baseband processor.

[0071] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0072] The mobile communication module 350 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to terminal devices. The mobile communication module 350 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the processor 310. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the same device as at least some of the modules of the processor 310.

[0073] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 370A, the receiver 370B, etc.) or displays an image or video through the display screen 394. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 310 and be provided in the same device as the mobile communication module 350 or other functional modules.

[0074] The wireless communication module 360 ​​can provide wireless communication solutions including wireless local area networks (WLAN) (such as WiFi networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied to the terminal device. The wireless communication module 360 ​​can be one or more devices integrating at least one communication processing module. The wireless communication module 360 ​​receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310. The wireless communication module 360 ​​can also receive the signal to be sent from the processor 310, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0075] In some embodiments, antenna 1 of the terminal device is coupled to mobile communication module 350, and antenna 2 is coupled to wireless communication module 360, so that the terminal device can communicate with a network and other devices via wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite-based augmentation system (SBAS).

[0076] The terminal device implements display functionality through a GPU, display screen 394, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs that execute program instructions to generate or modify display information.

[0077] Display screen 394 is used to display images, videos, etc. Display screen 394 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, the terminal device can include one or N display screens 394, where N is a positive integer greater than one.

[0078] In the embodiment of the present application, the terminal device can display an interface through the display screen 394, such as an application page after adaptively adjusting the layout. The terminal device can implement a shooting function through the ISP, camera 393, video codec, GPU, display screen 394 and application processor.

[0079] The external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 310 via the external memory interface 320 to implement data storage. For example, files such as music and videos can be stored on the external memory card.

[0080] Internal memory 321 can be used to store computer executable program code. For example, the computer program may include an operating system program and an application program. The operating system may include but is not limited to OS and other operating systems. Among them, the executable program code includes instructions. The processor 310 executes various functional applications and data processing of the terminal device by running the instructions stored in the internal memory 321. The internal memory 321 may include a program storage area and a data storage area. Among them, the program storage area can store the operating system, at least one application required for a function, etc. The data storage area can store data created during the use of the terminal device (such as interface data, etc.). In addition, the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 310 executes various functional applications and data processing of the terminal device by running the instructions stored in the internal memory 321, and / or the instructions stored in the memory provided in the processor.

[0081] The terminal device can implement audio functions such as music playback and recording through the audio module 370, speaker 370A, receiver 370B, microphone 370C, and application processor. For the specific working principles and functions of the audio module 370, speaker 370A, receiver 370B, and microphone 370C, please refer to the description in conventional technology.

[0082] In addition, for the introduction of hardware such as the button 390, the motor 391, and the indicator 392, reference can be made to conventional technology, and the embodiments of this application will not be repeated.

[0083] It should be understood that the structure illustrated in FIG3 of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or may combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0084] As a possible example, please refer to Figure 4, which shows a schematic diagram of the software structure of a terminal device provided in an embodiment of the present application. As shown in Figure 4, the operating system of the terminal device may include an application layer, a framework layer (framework, FWK), a system library, a runtime, and a kernel layer.

[0085] The application layer may include a series of applications, such as the camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. shown in Figure 4. For the convenience of description, the application is referred to as application below. The above application can be a native application (such as an application integrated into the operating system) or a third-party application (such as an application downloaded and installed by the user through the application store), which is not limited in the embodiments of this application.

[0086] The framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 4, the framework layer may include a window manager, content provider, view system, telephony manager, resource manager, notification manager, etc.

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

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

[0089] The view system includes visual controls, such as those for displaying text and images. The view system can be used to build application interfaces. A display interface can be composed of one or more views. For example, a display interface for a text notification icon might include a view for displaying text and a view for displaying an image.

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

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

[0092] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the Notification Manager can be used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating the device, or flashing indicator lights.

[0093] The runtime consists of a core library and a virtual machine. The runtime is responsible for system scheduling and management. The core library consists of two parts: one for the Java language's function calls and the other for the operating system's core library.

[0094] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).

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

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

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

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

[0099] The kernel layer is the layer between hardware and software. The kernel layer may include input / output device drivers (such as keyboard drivers, touch screen drivers, microphone drivers, etc.), audio drivers (such as headphone drivers, speaker drivers, etc.), sensor drivers, etc.

[0100] It should be noted that Figure 4 is merely an example of a software structure diagram for a terminal device, which simply lists the layers and software modules relevant to the present application. In actual applications, the operating system of the terminal device may further include other layers, and each layer may further include other software modules for implementing one or more functions or services. This embodiment of the present application does not specifically limit this.

[0101] In addition, in actual applications, the terminal device may also be a terminal device that supports ecological integration. For example, in an ecological integration scenario such as a simulator scenario or a container scenario, a first operating system (also called a Host system) may be installed in the terminal device, and a second operating system (i.e., a Guest system) may be installed in the simulator or container, that is, the terminal device may include a host (Host) and a client (Guest). The application page described in the embodiment of the present application may be a page of an application installed in the Host system, or a page of an application installed in the Guest system. As a possible example, a simulator scenario or a container scenario such as Mobile application engine scenario.

[0102] The adaptive application page display method provided in the embodiment of the present application can be applied to electronic devices such as mobile phones, tablet computers, or foldable screen mobile phones, and can be specifically applied to scenarios where application program interfaces are displayed on electronic devices. In some application scenarios, the method provided in the embodiment of the present application can be applied to foldable screen mobile phones; for example, the screen aspect ratio of a foldable screen mobile phone is different when it is in the folded state and when it is in the unfolded state. The foldable screen mobile phone is displayed based on the original display data of the application interface in both the folded state and the unfolded state, and display abnormalities may occur when the foldable screen mobile phone is in the unfolded state. It can be understood that this application does not limit the type of electronic device.

[0103] In other application scenarios, the method provided in the embodiment of the present application can also be applied to scenarios where the application interface displayed on a mobile phone is projected onto other electronic devices, such as scenarios where the screen is projected onto a large screen. Based on the fact that mobile phones generally have long and narrow characteristics, and large screens generally have large-screen characteristics, projecting the application interface displayed on a mobile phone onto a large screen may also cause abnormal display problems as described in the aforementioned scenario where a folding-screen mobile phone changes from a folded state to an unfolded state. Based on the method provided in the embodiment of the present application, the original layout of the application may not be changed. When the application page is displayed on the device side, the layout display of the application page is adjusted in real time according to the page layout of the application and the screen size of the device. In some application scenarios, the method provided in the embodiment of the present application can also be applied to scenarios where a mobile phone is turned from a vertical screen to a horizontal screen. The embodiment of the present application does not impose specific restrictions on this.

[0104] The following will describe in detail an adaptive application page display method provided by an embodiment of the present application with reference to specific drawings.

[0105] Typically, as shown in FIG5A , an application page needs to go through the following steps 1 to 4 before being displayed:

[0106] Step 1: Set layout parameters and build the application view tree (ViewTree).

[0107] Typically, after an application is started, the terminal device first creates the application's ViewTree. For example, the terminal device may traverse the application's layout file, set layout parameters, and then create the ViewTree.

[0108] Among them, as shown in Figure 5B, ViewTree is a tree-like hierarchical structure formed by combining and nesting different View components (ViewItem) and / or View groups (ViewGroup). Among them, the ViewItem or ViewGroup in the ViewTree is used to present elements in the ViewTree user interface (UI) (hereinafter referred to as the UI interface). ViewGroup can contain a group of ViewItem and / or ViewGroup, and ViewGroup itself is an extension of View. ViewItem or ViewGroup can be customized and pre-set according to the actual application interface requirements. For example, ViewItem can be a statically defined tree, a dynamically constructed tree, a data-bound tree, etc., which is not limited in this application. Exemplarily, ViewItem can be used to present menus, search keys, icons, characters (such as text), etc. on the UI interface. ViewGroup can be used to present menu bars, search bars, text boxes, etc. on the UI interface.

[0109] Generally, ViewTree can include three basic component types: root component, parent component and leaf component. These three component types constitute multiple levels of ViewTree. Among them, the root component is the top-level parent node in ViewTree. The root component is a node in ViewTree with child nodes and an empty Parent attribute value. The parent component is a specific node in ViewTree with child nodes. The leaf component is a node in ViewTree without child nodes. For example, the root component is used to render the menu bar on the UI interface, the parent component is used to render the menu in the menu bar, and the leaf component is used to render the text corresponding to the menu.

[0110] Among them, the elements on the application page can include icons, characters (such as text), pictures, etc., which are not limited in this application. The elements on the application page are usually displayed in the corresponding view control (also called container), such as the menu bar, menu, search box, search button, etc., which are not limited in this application.

[0111] Generally, the position and size of an element are mainly represented by parameter A, parameter B, parameter C and parameter D.

[0112] Taking the current element as 501 shown in Figure 5C, and element 501 being a child node of view control 502 as an example, as shown in Figure 5C, parameter A is used to represent the distance between the leftmost end of element 501's own layout area and the leftmost end of the parent container (i.e., view control 502). Parameter A is like the left parameter. Parameter B is used to represent the distance between the topmost end of element 501's own layout area and the topmost end of the parent container. Parameter B is like the top parameter. Parameter C is used to represent the distance between the rightmost end of element 501's own layout area and the leftmost end of the parent container (i.e., view control 502). Parameter C is like the right parameter. Parameter D is used to represent the distance between the bottommost end of element 501's own layout area and the topmost end of the parent container (i.e., view control 502). Parameter D is like the bottom parameter. As shown in Figure 5C, the rectangular area described by (parameter A, parameter B, parameter C, parameter D) is the area where element 501 can be laid out in the parent container (i.e., view control 502).

[0113] In some embodiments, the position and size of an element may also be represented by parameters A, B, E, and F. As shown in FIG5C , parameter E is used to represent the width of the current element, such as the width parameter. Parameter F is used to represent the height of the current element, such as the height parameter.

[0114] In some embodiments, the position and size of an element may also be represented by parameter C, parameter D, parameter E, and parameter F.

[0115] In some embodiments, the position and size of an element may also be represented by parameter A, parameter D, parameter E, and parameter F.

[0116] In some embodiments, the position and size of an element may also be represented by parameter C, parameter B, parameter E, and parameter F.

[0117] Among them, width = right-left, that is, parameter E = parameter C - parameter A. Height = bottom-top, that is, parameter F = parameter D - parameter B.

[0118] Step 2: Measure the application ViewTree.

[0119] Among them, step 2 is used to calculate the display size of each element on the application page (such as menu bar, menu, search box, search key, icon, character, etc.).

[0120] As an example, a terminal device can use the measure method to measure each element on an app page based on the app's layout file and the element attribute settings in the code. The measure method calls the onMeasure method to measure each element on the app page. The onMeasure method takes two parameters: widthMeasureSpec and heightMeasureSpec, which represent the width and height measurement specifications, respectively.

[0121] Step 3: Layout the application ViewTree.

[0122] Wherein, step 3 is used to determine the specific position range of the element on the original application page based on the information obtained by measurement.

[0123] As an example, a terminal device can use the layout method to lay out an application page. In the layout method, the position of the four vertices of an element can be set using the setFrame method. Once the four vertices of the element are determined, its position within the parent container is also determined. Then, the onLayout method can be called to determine the specific position range of the element.

[0124] Step 4: Draw.

[0125] Among them, step 4 is used to draw each element on the canvas after determining the position range of each element on the application page, and construct a drawing instruction.

[0126] As an example, the terminal device can complete the drawing of various elements on the canvas through the draw method.

[0127] Among them, regarding the specific process of constructing, measuring, laying out and drawing ViewTree, reference can be made to conventional technologies, and the embodiments of this application do not limit it.

[0128] Based on an adaptive application page display method provided by an embodiment of the present application, the terminal device adjusts the drawing level of the ViewTree that has been measured and laid out before drawing the application page. For example, the terminal device can first scale the layout of the ViewTree of the application page (i.e., the application ViewTree), build a virtual ViewTree for mapping the original application page, and then determine the respective adjustment strategies according to the respective attributes of the elements in the virtual ViewTree, and measure and layout the virtual ViewTree based on the determined adjustment strategy, and finally map the layout result of the virtual ViewTree to the application ViewTree. Based on this, the original layout of the application can be kept unchanged. When the application page is displayed on the device side, the layout display adjustment of the application page can be performed in real time according to the page layout of the application and the screen size of the device.

[0129] For example, please refer to Figure 6, which shows a schematic diagram of an application page drawing process provided by an embodiment of the present application. As shown in Figure 6, in an adaptive application page display method provided by an embodiment of the present application, the application page needs to perform steps A to F before drawing:

[0130] Step A: Scaling.

[0131] Scaling refers to scaling the outermost container of the target page area in the application page. Scaling may include, but is not limited to, one or more of vertical reduction, vertical expansion, horizontal reduction, and horizontal expansion. For example, the outermost container of the target page area may be scaled exponentially based on the width and height stretch coefficients using a free stretching algorithm.

[0132] The target page area refers to the page area of ​​the application page whose layout is to be adjusted. For example, the target page area may have layout issues such as unreasonable element size and position. The target page area can be the entire application page or a part of the application page, and the embodiments of the present application are not limited thereto.

[0133] As an example, the terminal device may determine the target page area based on pre-set rules. The pre-set rules may include a large difference in the ratio of the element size to other elements, excessive white space between elements, etc. The specific principles and methods for determining the target page area by the terminal device are not limited in the embodiments of the present application.

[0134] As an example, the terminal device may scale the target page area based on one or more of the following information: the screen size of the terminal device, the size / position / etc. of elements in the application page.

[0135] For example, taking the vertical reduction of the target page area as an example, as shown in FIG7 , the terminal device may reduce the outermost container of the target page area 700A on the Y-axis to obtain a scaled page area 700B.

[0136] It can be understood that, generally, after the outermost container of the target page area is reduced on the Y-axis, all sub-elements in the target page area will be reduced synchronously. Therefore, as shown in Figure 7, after the outermost container of the target page area is reduced on the Y-axis, the elements in the target page area will be deformed.

[0137] Step B: Build a virtual view tree (ViewTree).

[0138] The virtual ViewTree is a mapping of the application ViewTree corresponding to the zoomed target page area, and includes each ViewItem in the application ViewTree corresponding to the target page area.

[0139] In some embodiments, the terminal device may use a recursion algorithm to obtain the hierarchical structure of the application ViewTree corresponding to the target page area, and then construct a virtual ViewTree with a layout hierarchy according to the hierarchical structure.

[0140] For example, please refer to Figure 8, which shows a schematic diagram of a virtual ViewTree construction result, wherein (a) in Figure 8 is the target page area, and (b) in Figure 8 is the constructed virtual ViewTree.

[0141] It should be noted that, in some embodiments, assuming that the structure of the application ViewTree corresponding to the target page area is a flat structure with a relatively simple hierarchical structure, the terminal device may not be restricted by the layout file of the application page when constructing the virtual ViewTree. Instead, it may make full use of existing information, such as the layout file of the original application page or the layout of each element in the original application page, to dig out the relevant information of the hierarchical structure, thereby constructing a virtual ViewTree with a layout hierarchy.

[0142] In some embodiments, the layout file of the application page includes relevant information of its hierarchical structure. In this case, the terminal device can directly construct a virtual ViewTree with a layout hierarchy according to the relevant information of its hierarchical structure.

[0143] In some embodiments, the layout file of the application page does not include information about its hierarchical structure. In this case, the terminal device can analyze the layout of each element in the target page area, determine the appropriate hierarchy, and add a container for auxiliary layout (hereinafter referred to as "control for auxiliary layout") to construct a virtual ViewTree with a layout hierarchy.

[0144] For example, assuming that the structure of the application ViewTree corresponding to the target page area is a flat structure with a relatively simple hierarchical structure as shown in (a) of Figure 9A, when the terminal device constructs the virtual ViewTree, it can add multiple controls for auxiliary layout (such as auxiliary control 1, auxiliary control 2, auxiliary control 3 and auxiliary control 4) based on the relevant information of the hierarchical structure included in the layout file or based on other methods, so as to construct a virtual ViewTree with a rich layout hierarchy as shown in (b) of Figure 9A.

[0145] For another example, assuming that the structure of the application ViewTree corresponding to the target page area is as shown in (a) in Figure 9B, when the terminal device constructs the virtual ViewTree, it can add multiple controls for auxiliary layout (such as auxiliary control 5 and auxiliary control 6) based on the relevant information of the hierarchical structure included in the layout file or based on other methods, so as to construct a virtual ViewTree with a richer layout hierarchy as shown in (b) in Figure 9B.

[0146] It can be understood that compared to the flat structure with only two levels as shown in Figure 9A (a), the hierarchical structure shown in Figure 9A (b) has a richer layout hierarchy due to the addition of auxiliary controls 1, auxiliary controls 2, auxiliary controls 3 and auxiliary controls 4 for auxiliary layout. For example, the three squares in the lower right corner shown in Figure 9A (b) are actually laid out according to the rule of "located in the auxiliary control 4 in the lower right corner, one centered and upper, one centered and lower left, and one centered and lower right". Similarly, the hierarchical structure shown in Figure 9B (b) has a richer layout hierarchy due to the addition of auxiliary controls 5 and 6 for auxiliary layout. This layout strategy is not limited to the limitations of the ViewTree flat layout, and can provide great convenience for the refined adjustment of elements in the subsequent display adjustment of the target page area, and can greatly reduce the amount of calculation for the display adjustment of the target page area, thereby improving the efficiency of the adjustment.

[0147] Step C: Determine the adjustment strategy according to the element attributes of the elements in the target page area.

[0148] Elements in the target page area may include, but are not limited to, characters (e.g., text), icons, images, backgrounds (e.g., background scenery, rounded background frames, etc.). Element attributes may include, but are not limited to, element type, element layout, element size, etc. Element types include, but are not limited to, characters (e.g., text), icons, images, backgrounds (e.g., background scenery, rounded background frames, etc.).

[0149] The layout of the elements may include, but is not limited to, one or more of LinearLayout, FrameLayout, RelativeLayout, ConstraintLayout, and TableLayout.

[0150] Linear layout refers to the linear arrangement of elements in the horizontal or vertical direction. When the elements are arranged horizontally, the display order of the elements is from left to right. When the controls are arranged vertically, the display order of the elements is from top to bottom. Single-frame layout refers to the layout in which controls are superimposed on each other. Relative layout refers to a blank area on the specified screen and filling it with a single element. Constrained layout refers to constraining the layout of elements by setting a constraint set (ConstraintSet). The constraints in the constraint set are used to constrain but not limited to the left margin, right margin, top margin, bottom margin, and alignment. Table layout refers to arranging elements in a table format. For example, the target page area can be divided into multiple cells by rows and columns, and each cell can be used to layout elements.

[0151] For example, please refer to Figure 10, which shows an example diagram of element attributes corresponding to elements in a target page area provided by an embodiment of the present application. The target page area shown in Figure 10 includes a background, a picture, text, and an icon.

[0152] It is understandable that elements of different types, sizes, and proportions have different strict requirements for aspect ratio during layout. For example, according to page layout conventions and user visual habits, text, icons, and images (such as larger images (referred to as "large images")) usually need to maintain an aspect ratio to ensure that they are presented to users in a more aesthetically pleasing way, while backgrounds and large images do not have particularly strict requirements for aspect ratio, so in some cases, their aspect ratio does not need to be maintained. In addition, controls used to assist in layout do not need to maintain an aspect ratio, so their aspect ratio does not need to be maintained.

[0153] In addition, elements with different alignment relationships have different strict requirements for the positional relationship between elements during layout. For example, for multiple elements that are evenly distributed, according to page layout conventions and user visual habits, it is usually necessary to keep their even distribution unchanged. Therefore, when adjusting the display of the target page area, it is necessary to keep the even distribution between the multiple elements. For another example, for multiple elements with an alignment relationship, according to page layout conventions and user visual habits, it is usually necessary to keep their alignment relationship unchanged. Therefore, when adjusting the display of the target page area, it is necessary to keep the alignment relationship between the multiple elements.

[0154] Based on the above considerations, the solution provided by the embodiment of the present application can adopt a pre-set more refined adjustment strategy in a targeted manner by determining the element attributes of the elements in the target page area, and adopt a more targeted adjustment strategy for the page elements with different attributes on the virtual ViewTree and the view controls in which they are located, so that they can be displayed to the user in a more reasonable and beautiful way in terms of proportion, size, layout and other aspects, thereby improving the user's visual experience during the use of the application.

[0155] Step D: Measure the virtual ViewTree.

[0156] Among them, step D is used to fine-tune the layout and measurement-related properties in the original layout of the application page (ie, the application ViewTree) according to the adjustment strategy corresponding to the element properties, and obtain the properties of each control and the elements in the control in the virtual ViewTree.

[0157] For example, the terminal device can copy the layout and measurement-related properties in the application ViewTree after processing in step A, and then make corresponding fine-tuning according to the adjustment strategy corresponding to the element properties to obtain the measurement results of the virtual ViewTree. As an example, please refer to Figure 11, which takes the target page area as shown in (a) of Figure 8 as an example, showing a schematic diagram of the properties of elements in a control in a virtual ViewTree provided by an embodiment of the present application.

[0158] For example, layout and measurement related properties include margin, padding, layout parameters, weight, gravity, and orientation.

[0159] Layout parameters represent information such as an element's position, height, and width. Weight represents the weight of an element within a linear layout. Gravity indicates the element's display position. An element's height and width are related to its relationship to its containing control. For example, if the element's relationship to its containing control is determined by the parent layout (match_parent), the element and its containing control have the same height and width, meaning the element's height and width are determined by the containing control. Alternatively, an element's height and width can be related to its content. For example, if the element's layout parameter is determined by content (wrap_content), the element's containing control can precisely contain the element's content, meaning the element's content determines the control's height and width. Orientation indicates the element's arrangement direction, with horizontal indicating horizontal arrangement and vertical indicating vertical arrangement.

[0160] It is understandable that since the outermost container of the target page area has been scaled in step A, all sub-elements in the target page area will be scaled synchronously. In step D, by performing special processing on elements with special requirements, it is possible to ensure that all sub-elements in the target page area are displayed in normal proportions. For example, for elements that need to maintain an aspect ratio, it is necessary to fine-tune the corresponding properties, such as scaling the margins, padding, height, and width according to the scaling ratio (also known as the scaling value) to keep the aspect ratio unchanged.

[0161] As an example, taking the reduction of the target page area on the Y-axis as shown in Figure 7, in order to fine-tune the elements with special attributes in the target page area to improve the user's viewing experience during the use of the application, the following Table 1 takes the sub-elements in the first column of controls in the virtual ViewTree as an example, showing examples of adjustment strategies corresponding to elements with several different layout methods; the following Table 2 takes the first column of controls in the virtual ViewTree as an example, showing examples of adjustment strategies corresponding to controls where elements with several different layout methods are located.

[0162] Table 1

[0163] Among them, "N / A" shown in Table 1 means that no adjustment is involved in the corresponding attribute.

[0164] As shown in Table 1, terminal devices can use corresponding adjustment strategies to adjust the left and right margins, width, weight, and center of gravity of elements based on different element layout methods, and perform special processing on elements with special requirements (such as maintaining the aspect ratio). Taking LinearLayout as an example, in order to ensure that the aspect ratio of some elements remains unchanged, the terminal device can make its left and right margins = original left and right margins × scaling ratio, and make the width = original width × r when the width is greater than 0. When the relationship between the element and its control is match_parent or wrap_content, the original width, weight, and center of gravity are maintained. In particular, evenly distributed elements do not need to be scaled.

[0165] Table 2

[0166] Among them, "N / A" shown in Table 2 means that no adjustment is involved in the corresponding attributes.

[0167] It should be noted that the other layout groups (OtherViewGroup) shown in Table 1 and Table 2 refer to ViewGroups other than other specific types of layout methods. The adjustment strategy corresponding to OtherViewGroup is intended to provide a fallback effect, that is, when encountering an unknown layout method, a basic strategy of fixed position centering and scaling can be adopted. OtherViewGroup can be understood as a special FrameLayout. When adjusting the controls where the elements of OtherViewGroup are located, the width and height can be manually specified, for example, width and height = original width and height × r.

[0168] Furthermore, the other layouts (OtherView) shown in Table 2 refer to Views that do not include child elements, such as text views (TextView), image views (ImageView), etc. For OtherView, in order to ensure that its aspect ratio remains unchanged, the terminal device can set its width and height to be equal to the original width and height × r.

[0169] In addition, it should be noted that Tables 1 and 2 are only examples of adjustment strategies for elements with several different layout methods and the controls in which they are located. The embodiments of the present application do not limit the specific layout method of the elements, and the embodiments of the present application do not limit the specific adjustment strategies adopted for elements with different attributes. Custom settings can be made based on user usage habits, application requirements, business needs, and device software / hardware adjustments.

[0170] Step E: Layout the virtual ViewTree.

[0171] Wherein, step E is used to determine the specific position range of each control on the virtual ViewTree based on the information obtained by measuring the virtual ViewTree.

[0172] As an example, after adjusting the elements and their controls based on the properties of the elements shown in Figure 11, the adjusted virtual ViewTree shown in Figure 12 (b) can be obtained. As shown in Figure 12, compared with the virtual ViewTree before measurement and layout shown in Figure 12 (a), the layout proportions, position distribution, and sizes of the view controls in the virtual ViewTree after measurement and layout shown in Figure 12 (b) are more coordinated.

[0173] Step F: Scale the map.

[0174] Among them, step F is used to map the laid out virtual ViewTree to the application ViewTree corresponding to the target page area in the application page, obtain the values ​​that each control should scale and translate, and apply them to the application ViewTree.

[0175] As an example, as shown in FIG13 , the terminal device can calculate the position of each control in the application ViewTree and the virtual ViewTree after layout by comparing the application ViewTree and the virtual ViewTree after layout (such as the control rectangle, the reference point can be set as the upper left corner of the control). Then, the scale value is calculated based on the width of the control in the application ViewTree (recorded as the old width) and the width in the virtual ViewTree after layout (recorded as the new width); and the translation value is calculated based on the horizontal distance between the coordinates of the center point of the control in the application ViewTree (recorded as the old coordinates) and the coordinates in the virtual ViewTree after layout (recorded as the new coordinates). That is, the scale value = new width / old width, and the translation value = new coordinates - old coordinates.

[0176] It should be noted that Figure 13 only uses one possible element layout as an example to illustrate the scale value for a control. The scale value above is the final value. In actual applications, when calculating the element's scale value, the specific result depends on whether the element has a parent container in the ViewTree and the scale value of the parent container. The same applies to the translation value.

[0177] In other words, the actual scale of an element is determined by multiplying all the scale values ​​from itself to the root component. Therefore, when calculating the actual scale of an element, it is necessary to consider all the scale values ​​set from itself to the root component. For example, the scale value of an element can be determined according to the following formula: scale value = displayScale / ((parent scale value) * (parent-parent scale value) * (parent-parent-parent scale value) * ... * (root component scale value)).

[0178] For example, for an element without a parent container like the one shown in Figure 13, if we want the final displayed width of the element to be 0.6 times its original width, we can directly set the element's scale value to 0.6. In other words, for a situation like the one shown in Figure 13, the element's scale value of 0.6 is the scale value (denoted as displayScale) when the final virtual layout is mapped to the original layout.

[0179] For example, for an element with a first-level parent container, suppose we want the final displayed width of an element to be 0.6 times the original width (i.e. displayScale = 0.6), and the parent container has already set the width scale to 0.6 times, then the width of the child element does not need to be adjusted again, that is, the element's scale value is 1.

[0180] For example, for an element with a first-level parent container, suppose we want the final displayed width of an element to be 0.6 times the original width (i.e. displayScale = 0.6), and the parent container has set the width scaling value to 2 times, then the scaling value of the child element is 0.6 / 2 = 0.3.

[0181] It can be understood that based on the adaptive application page display method provided in the embodiments of this application, the terminal device can implement the measurement and layout process without intruding the original application by adding the five steps of scaling → constructing a virtual ViewTree → marking element attributes → determining the adjustment strategy → measuring and layout → mapping to the conventional application page drawing process. Therefore, there is no need for application developers to perform additional application page development, which greatly reduces the development cost of application pages. In addition, the method provides a universal application page adjustment solution, so it is highly compatible and versatile and can be applied to any application page and screen of any size.

[0182] Moreover, the solution can leverage the capabilities of existing basic controls, retain most parameters, and modify a small number of key parameters based on a pre-set, more refined adjustment strategy. This allows for a more targeted, fine-grained adjustment strategy to be adopted for page elements with different attributes on the application page to be adjusted, while preserving the original layout to the greatest extent possible. This improves the problems of large images and large fonts, excessive white space, deformation, and unreasonable alignment that exist in conventional technologies when displaying pages. For example, as shown in FIG14 , compared to the original target page area shown in FIG14 (a), based on an adaptive application page display method provided by an embodiment of the present application, as shown in FIG14 (b), when displaying the target page area, the terminal device can maintain the alignment of the target page area consistent with the original layout while allowing the element proportions, sizes, layouts, and other aspects to be displayed to the user in a more reasonable and aesthetically pleasing manner, such as reasonable alignment, normal size and proportion, no abnormal truncation, and no large areas of white space, thereby improving the user's visual experience during the use of the application.

[0183] On the other hand, based on the solution provided by the embodiment of the present application, after display adjustments are made to the target page area with large images, large fonts, and excessive white space, in some scenarios, such as the sliding page scenario shown in Figure 15 (a) and the grid scenario / list scenario shown in Figure 16 (a), the saved screen area can display more page content. As shown in Figure 15 (b) and Figure 16 (b), the solution provided by the embodiment of the present application can also more effectively and reasonably utilize the screen of the terminal device in various complex scenarios.

[0184] It should be understood that the various schemes of the embodiments of the present application can be reasonably combined and used, and the explanations or descriptions of the various terms appearing in the embodiments can be referenced or explained with each other in the various embodiments, without limitation to this.

[0185] It should also be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0186] It is understandable that, in order to implement the functions of any of the above-mentioned embodiments, the terminal device includes hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0187] The embodiments of the present application can divide the terminal device into functional modules. For example, each functional module can be divided into corresponding functional modules, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical functional division. In actual implementation, other division methods may be used.

[0188] It should also be understood that the various modules in the terminal device can be implemented in software and / or hardware, without specific limitation. In other words, the electronic device is presented in the form of functional modules. The "module" here can refer to an application-specific integrated circuit (ASIC), a circuit, a processor and memory that executes one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above-mentioned functions.

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

[0190] The steps of the method or algorithm described in conjunction with the embodiments of the present application can be implemented in hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device. Of course, the processor and the storage medium can also exist as discrete components.

[0191] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

Claims

1. An adaptive application page display method, characterized in that: The method comprises: Acquire page information of an application page, wherein the application page includes a target page area; Creating, measuring and laying out a first application view tree of the target page area according to the page information; Creating a virtual view tree corresponding to the first application view tree, wherein the virtual view tree includes view components in the first application view tree; Determining an adjustment strategy according to element attributes of elements in the target page area; Measuring and laying out the virtual view tree based on the adjustment strategy; Mapping the view components in the virtual view tree to the first application view tree to obtain a second application view tree; The application page is drawn according to the second application view tree.

2. The method according to claim 1, characterized in that: The target page area is the entire page area of ​​the application page; or, The target page area is a partial page area of ​​the application page.

3. The method according to claim 1 or 2, characterized in that: The target page area includes one or more controls, and the one or more controls include one or more of the following page elements: text, icon, and picture.

4. The method according to claim 3, characterized in that The determining the adjustment strategy according to the element attributes of the elements in the target page area includes: The adjustment strategy is determined according to one or more of the type of elements, the layout mode of elements and the size of elements in the target page area.

5. The method according to claim 4, characterized in that The layout modes of the elements include one or more of the following: linear layout, single-frame layout, relative layout, constraint layout and table layout.

6. The method according to any one of claims 1 to 5, characterized in that The determining the adjustment strategy according to the element attributes of the elements in the target page area includes: Keeping the layout of elements in the target page area unchanged; For elements in the target page area whose element type is text or icon, an adjustment strategy of maintaining the aspect ratio is adopted; and / or, for elements in the target page area whose element type is picture and the size of the picture meets the preset conditions, an adjustment strategy of maintaining the aspect ratio is adopted.

7. The method according to claim 6, characterized in that The maintaining the layout of the elements in the target page area unchanged includes: The alignment of the elements in the target page area is maintained unchanged.

8. The method according to any one of claims 1 to 7, characterized in that The creating a virtual view tree corresponding to the first application view tree includes: Obtaining the positional relationship between view components in the first application view tree; According to the positional relationship, one or more containers are created to serve as parent controls of the view component.

9. The method according to claim 8, characterized in that The obtaining the positional relationship between view components in the first application view tree includes: Acquire the positional relationship from the layout file in the page information; or, The positional relationship is obtained by analyzing the relative positions of the view components in the first application view tree.

10. The method according to any one of claims 1 to 9, characterized in that Mapping the view components in the virtual view tree to the first application view tree includes: Determine a zoom value and a translation value of the view component by analyzing a position change of the view component in the first application view tree and the virtual view tree; Mapping the view components in the virtual view tree to the first application view tree according to the zoom value and the translation value.

11. The method according to any one of claims 1 to 10, characterized in that The method is applied to a terminal device, and obtaining page information of an application page includes: The terminal device obtains page information of the application page from the application server corresponding to the application page.

12. A terminal device, characterized in that: The terminal device comprises: Display screen, used for interface display; a memory for storing computer program instructions; A processor, configured to execute the computer program instructions to support the terminal device to implement the method as described in any one of claims 1-11.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processing circuit, the method according to any one of claims 1 to 11 is implemented.

14. A computer program product comprising instructions, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 11.

15. A chip system, characterized in that: The chip system includes a processing circuit and a storage medium, wherein the storage medium stores computer program instructions; when the computer program instructions are executed by the processing circuit, the method as described in any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Page conversion method and page conversion device

    CN110442343A

  • Display interface layout method and electronic equipment

    CN112698828A

  • Interface rendering method and device based on iOS application

    CN114020358A

  • Page layout file generation method and device, electronic equipment and readable storage medium

    CN114444000A

  • Page layout adjustment method and device

    CN114564263A

Cited By

  • Method and system for automatically optimizing user interface

    CN119248269A