CN114510311A - Page adaptation display method, computing device and storage medium - Google Patents

Page adaptation display method, computing device and storage medium Download PDF

Info

Publication number
CN114510311A
CN114510311A CN202210142544.6A CN202210142544A CN114510311A CN 114510311 A CN114510311 A CN 114510311A CN 202210142544 A CN202210142544 A CN 202210142544A CN 114510311 A CN114510311 A CN 114510311A
Authority
CN
China
Prior art keywords
display
page
style
window
view
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210142544.6A
Other languages
Chinese (zh)
Inventor
刘泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhangyue Technology Co Ltd
Original Assignee
Zhangyue Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhangyue Technology Co Ltd filed Critical Zhangyue Technology Co Ltd
Priority to CN202210142544.6A priority Critical patent/CN114510311A/en
Publication of CN114510311A publication Critical patent/CN114510311A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations

Abstract

The invention discloses a page adaptation display method, a computing device and a storage medium, wherein the page adaptation display method comprises the following steps: obtaining window width information of a page window through a page listener registered in the page window; determining a matched display style according to the window width information; and sending the change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information. By utilizing the technical scheme provided by the invention, a more appropriate display style can be determined for the page window for rendering display according to the monitored window width information, the dynamic adaptation of the page style is realized, and a more attractive page display effect can be provided for a user.

Description

Page adaptation display method, computing device and storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a page adaptation display method, a computing device and a storage medium.
Background
User terminal devices with different screen sizes have been developed in the prior art to meet the personalized requirements of users for screen sizes. For example, a screen with a larger size, such as a folding screen device or a PAD, can provide a better human-computer interaction experience. The screen width and height of the large-screen device can be dynamically switched, such as horizontal and vertical screen rotation, multi-size screen division, page window display in a floating window mode and the like. However, in the prior art, the client mostly adopts a fixed page style to display a page window, and when the client is used in a large window size of a large-screen device, the problems of transverse elongation of a UI, unattractive page display and the like occur, and the elastic change of a multi-size window cannot be satisfied, which results in poor user interaction experience.
Disclosure of Invention
In view of the above, the present invention has been made to provide a page adaptation display method, a computing device and a storage medium that overcome or at least partially solve the above-mentioned problems.
According to one aspect of the invention, a page adaptation display method is provided, which comprises the following steps:
obtaining window width information of a page window through a page listener registered in the page window;
determining a matched display style according to the window width information;
and sending the change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
According to another aspect of the present invention, there is provided a computing device comprising: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the following operations:
obtaining window width information of a page window through a page listener registered in the page window;
determining a matched display style according to the window width information;
and sending the change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
According to another aspect of the embodiments of the present invention, there is provided a computer storage medium, in which at least one executable instruction is stored, and the executable instruction causes a processor to perform operations corresponding to the above page adaptation display method.
According to the technical scheme provided by the invention, the window width information of the page window is monitored, so that the window width information can be conveniently and accurately acquired in real time; according to the window width information, a more appropriate display style is determined for the page window for rendering display, dynamic adaptation of the page style is achieved, elastic change of the multi-size window is met, a more attractive page display effect can be provided for a user, and user interaction experience is effectively improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating a page adaptation display method according to a first embodiment of the present invention;
fig. 2a is a first flowchart illustrating a page adaptation display method according to a second embodiment of the present invention;
FIG. 2b is a flowchart illustrating a second page adaptation display method according to the second embodiment of the present invention;
FIG. 2c shows a first display diagram of a page window;
FIG. 2d shows a second display diagram of a page window;
FIG. 2e shows a third display diagram of a page window;
FIG. 2f shows a fourth display view of a page window;
fig. 3 is a schematic structural diagram of a computing device according to a fourth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Example one
Fig. 1 is a flowchart illustrating a page adaptation display method according to a first embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step S101, obtaining the window width information of the page window through the page listener registered in the page window.
In this embodiment, the adaptive display of the page window is implemented based on the window width information of the page window of the client in the user terminal device, and in step S101, the window width information of the page window needs to be monitored, where the user terminal device may be a terminal device such as a mobile phone, a PAD, an e-book reader, or the like. The client provides a program installed in the user terminal equipment for providing services for the user, such as an electronic book reading APP (application). Specifically, a page listener can be registered in a page window of the client and the window width information of the page window can be monitored through the page listener, so as to realize real-time monitoring of the window width information.
And step S102, determining a matched display style according to the window width information.
After the window width information is monitored, the matched display style can be determined according to the window width information. In an alternative embodiment, the matching display style may be searched for from a plurality of preset page display styles preset for the page window according to the window width information. In another alternative embodiment, the matching display style may be determined in a real-time calculation manner according to the window width information, for example, for each display view in the page window, the number of corresponding display objects that can be accommodated by the display view is calculated in real time according to the window width information, and the matching display style is set for the display view according to the number of the display objects.
And step S103, sending the change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
After the display style is determined, a change signal may be issued to each display view in the page window, where the change signal carries information related to the display style, and the related information may specifically include a style identifier of the display style, and the like. And each display view carries out view rendering processing according to the related information in the variation signal by using the rendering mechanism of each display view. By using the method, a more appropriate display style can be dynamically determined for the current page window of the client to perform rendering display according to the size information of the page window in the current screen, so that the dynamic adaptation of the page style of the client is realized.
By using the page adaptation display method provided by the embodiment, the window width information of the page window is monitored, so that the window width information can be conveniently and accurately acquired in real time; according to the window width information, a more appropriate display style is determined for the page window for rendering display, dynamic adaptation of the page style is achieved, elastic change of the multi-size window is met, a more attractive page display effect can be provided for a user, and user interaction experience is effectively improved.
Example two
Fig. 2a is a schematic flowchart illustrating a first page adaptation display method according to a second embodiment of the present invention, and as shown in fig. 2a, the method includes the following steps:
step S201, register an empty view in the root view of the page window as a page listener, and obtain the window width information of the page window by calling a measurement method in the page listener.
In order to implement dynamic adaptation of the display style of the page window, the window width information of the page window needs to be acquired. The window width information may use screen width dp (i.e., application displayable width information) or smalestwidth (i.e., minimum width qualifier) or decorview width information (i.e., width information of the window root view), etc.
In the prior art, a client generally obtains window width information by executing an oncoconfigurable changed method when configuration information changes, but for different user terminal devices produced by different existing vendors and clients of different versions installed on the same user terminal device, the screenwidth dp and smalllestwidth obtained by executing the oncoconfigurable changed method may be inaccurate, while decoview refers to a root view of a page window, and it may be necessary to measure decoview width information multiple times, so that accurate acquisition of window width information cannot be conveniently achieved by adopting the existing window change monitoring method.
In this embodiment, a page listener that registers a global page lifecycle is used to implement listening to window width information. The empty view can be registered in the root view of the page window to serve as a page listener, and the window width information of the page window is obtained in the page listener by calling a measuring method. The width and height of the blank view can be set by those skilled in the art according to actual needs. For example, the height of the empty view may be 1 pixel, and the width may be the same as the width of the page window, and this empty view does not contain any display content, but is only used for listening to the window width information of the page window.
Fig. 2b is a flowchart illustrating a second page adaptation display method according to a second embodiment of the present invention, as shown in fig. 2b, when the client is started, the entry file (i.e., Application) of the client is executed first, an onCreate method is called to represent the beginning of a life cycle, and the onCreate method is a callback function called during creation and mainly performs some necessary initialization work; when a page window (namely Activity) is created, calling an onCreate method corresponding to the Activity; ActivateLifecycleCallbacks are interfaces used for monitoring the life cycle callbacks of all Activities, register ActivateLifecycleCallbacks are another interface of Application, register the page listener, all the life cycles of Activities in the customer end will be monitored; after the onCreate method corresponding to Activity is called, the onActiyCreated method is called, and the onActiyCreated method creates a callback function for the page; then, registering an empty View (namely, an empty View) in a root View (namely, a decoview) of the page window; when the page window changes, the empty view calls an onMeasure measurement method to obtain the window width information of the page window.
The empty view is added in the root view of the page window to serve as the page listener, so that the method and the device are not only suitable for monitoring the window width information of the page window of the client, but also suitable for monitoring the window width information of the page window provided by the three-party library, and accurate acquisition of the window width information is achieved. The three-party library refers to an open source library outside a client development company.
Step S202, according to the window width information, a matched display style is determined.
In an optional implementation manner, in order to conveniently and quickly determine the matched display style, a plurality of preset page display styles may be set for the page window in advance, and after the window width information is monitored, the matched display style is searched for from the plurality of preset page display styles corresponding to the page window according to the window width information. The preset page display styles may be set according to the number of reference objects that can be accommodated under different window width information of the page window, with the width of the reference object as a basic unit. The reference object can be selected by those skilled in the art according to actual needs, and is not limited herein. For example, if the client is an e-book reading client, an e-book cover with a standard size may be selected as a reference object; if the client is a shopping client, the commodity introduction picture with the standard size can be selected as a reference object. Taking the reference object as the cover of the electronic book as an example, a first page display style corresponding to the window width capable of accommodating 4 covers of the electronic book, a second page display style corresponding to the window width capable of accommodating 6 covers of the electronic book, a third page display style corresponding to the window width capable of accommodating 8 covers of the electronic book, and the like can be set in advance for the page window, that is, the first page display style is a display style corresponding to the width of 4 covers of the electronic book, the second page display style is a display style corresponding to the width of 6 covers of the electronic book, and the third page display style is a display style corresponding to the width of 8 covers of the electronic book.
Specifically, the number of reference objects that can be accommodated under the window width information can be calculated from the window width information and the width information of the reference objects; and then, determining the preset page display style corresponding to the number of the reference objects in the plurality of preset page display styles as a matched display style. And if the preset page display styles corresponding to the number are not found in the preset page display styles, taking the preset page display styles most similar to the number as the preset page display styles corresponding to the number. Assuming that the plurality of preset page display styles comprise display styles corresponding to 4 e-book cover widths, display styles corresponding to 6 e-book cover widths and display styles corresponding to 8 e-book cover widths, if the number of the e-book covers which can be accommodated under the window width information is calculated to be 8, determining the display styles corresponding to the 8 e-book cover widths as matched display styles; if the number of the electronic book covers which can be accommodated under the window width information is 9 and the display styles corresponding to the widths of the 9 electronic book covers are not included in the plurality of preset page display styles, the display styles corresponding to the widths of the 8 electronic book covers can be determined to be matched display styles.
Wherein, the preset page display style comprises: the number of display objects contained in each display view of the page window, the display position of each display object, and the arrangement manner. The arrangement mode can comprise an up-down arrangement mode, a left-right arrangement mode, whether a left-right sliding mode is started or not and the like. The specific style content of the preset page display style can be set by those skilled in the art according to actual needs, and is not limited herein.
In another optional implementation manner, for each display view in the page window, the number of corresponding display objects that can be accommodated by the display view may be calculated according to the window width information, and a matching display style may be set for the display view according to the number of the display objects. The page window may include one or more display views (i.e., views), and View width information of some display views may be the same as or different from window width information of the page window. Specifically, for each display view in a page window, calculating view width information of the display view according to the window width information and a preset width ratio of the display view in the page window; then, according to the view width information and the object width information of the display objects contained in the display view, the number of the display objects which can be contained in the display view is calculated; and then setting the display position and arrangement mode of the display objects according to the number of the display objects to obtain the display style matched with the display view, and setting a corresponding style configuration file. Wherein the display style includes: the number of display objects included in the display view, the display position of each display object, and the arrangement manner. The arrangement mode can comprise an up-down arrangement mode, a left-right arrangement mode, whether a left-right sliding mode is started or not and the like.
If a certain display view in a page window is assumed, a display object contained in the display view is an electronic book cover, if a preset width ratio of the display view in the page window is 1, view width information of the display view is the same as window width information, and then 8 electronic book covers can be accommodated in the display view through calculation according to the view width information of the display view and the width information of the electronic book covers contained in the display view; and then setting the display positions and the arrangement mode of the 8 electronic book covers of the display view under the condition of accommodating the 8 electronic book covers in real time to obtain a display style, wherein the display style is the display style matched with the display view.
Step S203, sending the variation signal carrying the style identifier to each display view in the page window, so that each display view can obtain the style configuration file corresponding to the style identifier, and perform view rendering processing according to the style configuration file.
After the display style is determined, a change signal can be issued to each display view in the page window, wherein the change signal carries the style identification of the display style. The person skilled in the art can set the style identification according to actual needs. For example, for a preset page display style, the style identifier may be set according to the number of reference objects corresponding to the preset page display style. After each display view obtains the issued change signal, the style identification is extracted from the change signal, the style configuration file corresponding to the style identification is obtained, and view rendering processing is carried out according to the style configuration file.
In the existing delivery mode, the delivery is usually performed by defining a general interface, but the mode has high code invasiveness and high manual maintenance cost, and the interface rewriting delivery method needs to be implemented at a style transformation place and needs to be manually called circularly.
In order to implement the issue conveniently, in this embodiment, the issue is implemented based on a window change issue mode of the system. As shown in fig. 2b, after the empty view calls the onMeasure measurement method to obtain the window width information of the page window, the calculation is performed according to the window width information, the matched display style is determined, and the style identifier of the display style is recorded. Specifically, the Activity may include Fragment page Fragment and multiple views, and the Fragment may further include multiple views, and issue the variation signal to each View by layer. After the Activities, fragments and Views receive the sent change signals, rewriting the system onConfiguration method in each Activities, fragments and Views, and obtaining the style configuration file of the display style and making corresponding changes in the method. Wherein the onConfiguration method is a configuration function.
Considering that when a page window changes, in the process of monitoring the window width information of the page window, the page listener may measure the window width information multiple times, and in order to avoid performing repeated re-rendering on the display view in the page window multiple times, in this embodiment, whether to re-render the display view may be determined according to whether the style identifier in the variation signal is consistent with the style identifier in the previous variation signal. Specifically, after the page listener measures the window width information each time, the page listener determines the matched display style and sends down the change signal. For each display view, judging whether the pattern identifier in the variation signal is consistent with the pattern identifier in the previous variation signal; if the display styles are consistent, the display styles are not changed, a style configuration file of a new display style does not need to be acquired, and the view rendering processing does not need to be carried out again on the display view; if the two types of the display styles are not consistent, the display styles are changed, the page window needs to be re-rendered, the display view acquires the style configuration file corresponding to the style identifier in the change signal, and the view rendering processing is re-performed according to the style configuration file. By adopting the mode of comparing the style identifications, the corresponding style configuration file is obtained and re-rendered when the style identifications are changed, so that the re-rendering times are effectively reduced, the style change frequency is reduced, and the performance is saved.
In view of a scenario that there are many variations in window width information of a page window in a folding screen device, a page adaptation display method provided by the present embodiment is described below with the folding screen device as an example.
When the screen of the folding screen device is opened, determining that the display style is a display style corresponding to the width of 8 e-book covers according to the current window width information, wherein a display schematic diagram of a page window of the client is as shown in fig. 2c, 8 e-book covers and corresponding book names thereof are displayed in a popular selling area 21, the 8 e-book covers are sequentially arranged in the same line, and the book names are displayed below the corresponding e-book covers; in the hot working area 22, 4 hot electronic books (i.e., the electronic books 9 to 12) are displayed, and the 4 hot electronic books are displayed in two lines, wherein each line displays 2 hot electronic books, in the display area of each hot electronic book, the electronic book cover of the hot electronic book is displayed on the left side, and the book description text of the hot electronic book is displayed on the right side of the electronic book cover thereof, wherein "X" represents a character.
Then, in the page display state shown in fig. 2c, the screen of the folding screen device is closed, at this time, the folded screen is used to display the page window, the window width information of the page window is monitored through the page monitor, if the matched display style determined according to the currently monitored window width information is the display style corresponding to the widths of the 4 electronic book covers, a variation signal carrying the corresponding style identifier is sent to each display view in the page window, each display view acquires the style configuration file corresponding to the widths of the 4 electronic book covers, and performs view rendering processing again according to the style configuration file, the display schematic diagram of the re-rendered page window can be shown in fig. 2d, 8 electronic book covers and corresponding book names thereof are still displayed in the hotelight area 21, but the 8 electronic book covers are changed from one line display in fig. 2c to two lines display, each line displays 4 e-book covers, and the book name is still displayed below the corresponding e-book cover; in the hot working area 22, 4 hot electronic books are included, and the 4 hot electronic books are displayed in 4 lines, where each line displays 1 hot electronic book, in the display area of each hot electronic book, the electronic book cover of the hot electronic book is displayed on the left side, and the book description text of the hot electronic book is displayed on the right side of the electronic book cover thereof. Due to the limited length of the screen, only 1 electronic hotbook is displayed in the display diagram shown in fig. 2d, and the user can slide on the screen through gestures, so that the screen displays other 3 electronic hotbooks and more contents.
If in the page display state shown in fig. 2d, the screen of the folding screen device is opened again, the change of the window width information of the page window is monitored through the page monitor, the matched display style is determined to be the display style corresponding to the widths of the 8 e-book covers according to the currently monitored window width information, the change signal carrying the corresponding style identifier is sent to each display view in the page window, each display view performs view rendering processing again according to the style configuration file corresponding to the widths of the 8 e-book covers, and the display schematic diagram of the re-rendered page window is shown in fig. 2 c.
If in the page display state shown in fig. 2c, the screen of the folding screen device is split, a page monitor monitors the change of the window width information of the page window, determines the display style corresponding to the width of the 6 ebook covers according to the currently monitored window width information, sends a variation signal carrying the corresponding style identifier to each display view in the page window, obtains the style configuration file corresponding to the width of the 6 ebook covers from each display view, and performs view rendering again according to the style configuration file, where the display schematic diagram of the re-rendered page window may be shown in fig. 2e or fig. 2 f. As shown in fig. 2e, the left-right sliding mode is started in the hot marketing area 21, a total of 8 electronic book covers and their corresponding book names are included in the hot marketing area 21, the 8 electronic book covers are sequentially arranged in the same row, and the book names are displayed below the corresponding electronic book covers, but due to the limitation of the window width information after screen splitting, only 6 electronic book covers can be displayed at one time in the hot marketing area 21, and the user can slide left and right in the hot marketing area 21 to view the remaining 2 electronic book covers and their corresponding book names; the left-right sliding mode is started in the hot working area 22, a total of 4 hot electronic books are included in the hot working area 22, the 4 hot electronic books are displayed in two lines, wherein each line displays 2 hot electronic books, in the display area of each hot electronic book, the electronic book covers of the hot electronic books are displayed on the left side, the book description texts of the hot electronic books are displayed on the right side of the electronic book covers, but due to the limitation of the window width information after screen division, the whole content of one hot electronic book in each line and part of the content of another hot electronic book can only be displayed in the hot working area 22 at one time, and the user can view the whole content of another hot electronic book in each line by sliding left and right in the hot working area 22.
As shown in fig. 2f, the left-right sliding mode is started in the hot marketing area 21, a total of 8 electronic book covers and their corresponding book names are included in the hot marketing area 21, the 8 electronic book covers are arranged in sequence in the same row, and the book names are displayed below the corresponding electronic book covers, but due to the limitation of the window width information after screen splitting, only 6 electronic book covers can be displayed at one time in the hot marketing area 21, and the user can slide left and right in the hot marketing area 21 to view the remaining 2 electronic book covers and their corresponding book names; in the hot working area 22, 4 hot electronic books are displayed, and the 4 hot electronic books are displayed in two lines, wherein each line displays 2 hot electronic books, in the display area of each hot electronic book, the electronic book cover of the hot electronic book is displayed on the left side, the book description text of the hot electronic book is displayed on the right side of the electronic book cover thereof in a text folding manner, that is, part of the content of the book description text is displayed on the right side of the electronic book cover thereof, and the part of the book description text that is not displayed is denoted by "…".
Fig. 2c to fig. 2f are only exemplary display diagrams, and a person skilled in the art may set a display style according to actual needs, which is not limited herein. For example, for an e-book reading client, in a case that window width information of a page window of the e-book reading client is small, a horizontal e-book list in the page window may be squeezed and deformed, and then a left-right sliding mode may be dynamically started for the horizontal e-book list, and a conflict between channel switching and list sliding is processed; the book listening detail text in the page window can rearrange chapter names and praise comments in a mode of changing the display position of the text; the book description text in the page window can be displayed in a text line folding mode; the display positions (such as a banner and the like) and the card lists in the page window can be adaptively displayed in a content stretching mode, and the display views for displaying the screening conditions, the local historical records and the like in the page window can be adaptively displayed in a waterfall flow mode.
Considering that after the display style of the page window changes, a free area, that is, a blank area, may exist in a certain display area, in this embodiment, the free area may be filled with presentation materials (such as advertisements, activity introductions, and the like), so that not only can a relatively beautiful page display effect be obtained, but also the display content of the page window can be further enriched. Specifically, the implementation can be performed by step S204 and step S205.
Step S204, judging whether any display view has a free area; if yes, go to step S205; if not, the method ends.
For example, it may be identified whether there are free areas in the display view. If there is a free area, filling the free area, and executing step S205; if no free area exists, the method ends.
In step S205, presentation material is added and displayed in the free area of the display view.
The method comprises the steps of obtaining presentation materials and preset material style configuration files from a database, adding the presentation materials in an idle area of a display view, and rendering the presentation materials according to the preset material style configuration files.
By using the page adaptation display method provided by the embodiment, the page monitor registering the global page life cycle is adopted, so that the method can be suitable for monitoring the page window of the client and the window width information of the page window provided by the three-party library, has strong universality, and conveniently realizes the accurate acquisition of the window width information; according to the window width information, a more proper display style can be conveniently determined for the page window, and a change signal carrying a style identification is sent to each display view in the page window so that each display view can perform view rendering processing according to the style identification, so that a dynamic adaptation frame of a response UI is realized, the technical effect of dynamically adapting the page style due to elastic change of a multi-size window can be met, a more attractive page display effect is provided for a user, and the user interaction experience is effectively improved; in addition, when the style identification changes, each display view acquires the corresponding style configuration file and re-renders the style configuration file, so that the re-rendering times are effectively reduced, the style change frequency is reduced, and the performance is saved.
EXAMPLE III
The third embodiment of the present invention provides a nonvolatile storage medium, where the storage medium stores at least one executable instruction, and the executable instruction may execute the page adaptation display method in any of the above method embodiments.
The executable instructions may be specifically configured to cause the processor to: obtaining window width information of a page window through a page listener registered in the page window; determining a matched display style according to the window width information; and sending the change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
In an alternative embodiment, the executable instructions further cause the processor to: and registering an empty view in a root view of the page window as a page listener, and calling a measuring method in the page listener to obtain the window width information of the page window.
In an alternative embodiment, the executable instructions further cause the processor to: searching a matched display style from a plurality of preset page display styles corresponding to the page window according to the window width information; or, for each display view in the page window, according to the window width information, calculating the number of corresponding display objects that can be accommodated by the display view, and setting a display style matched with the display view according to the number of the display objects.
In an alternative embodiment, the executable instructions further cause the processor to: calculating the number of reference objects which can be accommodated under the window width information according to the window width information and the width information of the reference objects; and determining a preset page display style corresponding to the number of the reference objects in the plurality of preset page display styles as a matched display style.
In an alternative embodiment, the preset page display style comprises: the number of display objects contained in each display view of the page window, the display position of each display object, and the arrangement manner.
In an alternative embodiment, the executable instructions further cause the processor to: calculating view width information of the display view according to the window width information and a preset width ratio of the display view in the page window aiming at each display view in the page window; calculating the number of display objects which can be accommodated in the display view according to the view width information and the object width information of the display objects contained in the display view; and setting the display position and the arrangement mode of the display objects according to the number of the display objects to obtain a display style matched with the display view.
In an alternative embodiment, the information related to the display style includes: a style identifier of the display style; the executable instructions further cause the processor to: and sending the change signal carrying the style identification to each display view in the page window so that each display view can acquire the style configuration file corresponding to the style identification, and performing view rendering processing according to the style configuration file.
In an alternative embodiment, the executable instructions further cause the processor to: judging whether the pattern identifier in the variation signal is consistent with the pattern identifier in the previous variation signal or not for each display view; and if the two types of the images are not consistent, displaying the view to acquire a style configuration file corresponding to the style identifier in the change signal, and performing view rendering again according to the style configuration file.
In an alternative embodiment, the executable instructions further cause the processor to: judging whether any display view has an idle area; and if so, adding and displaying the presentation materials in the free area of the display view.
In an alternative embodiment, the executable instructions further cause the processor to: the method comprises the steps of obtaining presentation materials and preset material style configuration files, adding the presentation materials in an idle area of a display view, and rendering the presentation materials according to the preset material style configuration files.
Example four
Fig. 3 is a schematic structural diagram of a computing device according to a fourth embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 3, the computing device may include: a processor (processor)302, a communication Interface 304, a memory 306, and a communication bus 308.
Wherein:
the processor 302, communication interface 304, and memory 306 communicate with each other via a communication bus 308.
A communication interface 304 for communicating with network elements of other devices, such as clients or other servers.
The processor 302 is configured to execute the program 310, and may specifically perform relevant steps in the above-described embodiment of the page adaptation display method.
In particular, program 310 may include program code comprising computer operating instructions.
The processor 302 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 306 for storing a program 310. Memory 306 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 310 may specifically be configured to cause the processor 302 to perform the following operations: obtaining window width information of a page window through a page listener registered in the page window; determining a matched display style according to the window width information; and sending the change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
In an alternative embodiment, program 310 further causes processor 302 to: and registering an empty view in a root view of the page window as a page listener, and calling a measuring method in the page listener to obtain the window width information of the page window.
In an alternative embodiment, program 310 further causes processor 302 to: searching a matched display style from a plurality of preset page display styles corresponding to the page window according to the window width information; or, for each display view in the page window, calculating the number of corresponding display objects which can be accommodated by the display view according to the window width information, and setting a matched display style for the display view according to the number of the display objects.
In an alternative embodiment, program 310 further causes processor 302 to: calculating the number of reference objects which can be accommodated under the window width information according to the window width information and the width information of the reference objects; and determining a preset page display style corresponding to the number of the reference objects in the plurality of preset page display styles as a matched display style.
In an alternative embodiment, the preset page display style comprises: the number of display objects contained in each display view of the page window, the display position and arrangement of each display object.
In an alternative embodiment, program 310 further causes processor 302 to: calculating view width information of the display view according to the window width information and a preset width ratio of the display view in the page window aiming at each display view in the page window; calculating the number of display objects which can be accommodated in the display view according to the view width information and the object width information of the display objects contained in the display view; and setting the display position and the arrangement mode of the display objects according to the number of the display objects to obtain a display style matched with the display view.
In an alternative embodiment, the information related to the display style includes: a style identifier of the display style; program 310 further causes processor 302 to perform the following: and sending the change signal carrying the style identification to each display view in the page window so that each display view can acquire the style configuration file corresponding to the style identification, and performing view rendering processing according to the style configuration file.
In an alternative embodiment, program 310 further causes processor 302 to: judging whether the pattern identifier in the variation signal is consistent with the pattern identifier in the previous variation signal or not for each display view; and if the two types of the images are not consistent, displaying the view to acquire a style configuration file corresponding to the style identifier in the change signal, and performing view rendering again according to the style configuration file.
In an alternative embodiment, program 310 further causes processor 302 to: judging whether any display view has an idle area; and if so, adding and displaying the presentation materials in the free area of the display view.
In an alternative embodiment, program 310 further causes processor 302 to: the method comprises the steps of obtaining presentation materials and preset material style configuration files, adding the presentation materials in an idle area of a display view, and rendering the presentation materials according to the preset material style configuration files.
For specific implementation of each step in the program 310, reference may be made to the description corresponding to the corresponding step in the above page adaptation display embodiment, which is not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the above-described device may refer to the corresponding process description in the foregoing method embodiment, and is not described herein again.
By the scheme provided by the embodiment, the window width information can be conveniently and accurately acquired in real time; according to the window width information, a more appropriate display style is determined for the page window for rendering display, dynamic adaptation of the page style is achieved, and a more attractive page display effect can be provided for a user.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses: A1. a page adaptation display method comprises the following steps:
obtaining window width information of a page window through a page listener registered in the page window;
determining a matched display style according to the window width information;
and sending a change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
A2. According to the method of a1, the obtaining, by the page listener registered in the page window, the window width information of the page window further includes:
and registering an empty view in the root view of the page window as a page listener, and calling a measuring method in the page listener to obtain the window width information of the page window.
A3. The method of A1 or A2, the determining a matching display style according to the window width information further comprising:
searching a matched display style from a plurality of preset page display styles corresponding to the page window according to the window width information; alternatively, the first and second electrodes may be,
and aiming at each display view in the page window, calculating the number of corresponding display objects which can be contained in the display view according to the window width information, and setting a matched display style for the display view according to the number of the display objects.
A4. According to the method of a3, the searching for a matching display style from a plurality of preset page display styles corresponding to the page window according to the window width information further includes:
calculating the number of the reference objects which can be accommodated under the window width information according to the window width information and the width information of the reference objects;
and determining a preset page display style corresponding to the number of the reference objects in the plurality of preset page display styles as a matched display style.
A5 the method of A3 or A4, the preset page display style comprising: the number of display objects contained in each display view of the page window, the display position of each display object, and the arrangement manner.
A6. According to the method of a3, the calculating, for each display view in the page window, the number of corresponding display objects that can be accommodated by the display view according to the window width information, and setting a display style for the display view that matches according to the number of display objects further includes:
for each display view in the page window, calculating view width information of the display view according to the window width information and a preset width ratio of the display view in the page window;
calculating the number of display objects which can be accommodated in the display view according to the view width information and the object width information of the display objects contained in the display view;
and setting the display position and the arrangement mode of the display objects according to the number of the display objects to obtain the display style matched with the display view.
A7. The method of any of A1-A6, the information related to the display style comprising: a style identification of the display style;
the sending the variation signal carrying the relevant information of the display style to each display view in the page window for each display view to perform view rendering processing according to the relevant information further comprises:
and sending the change signal carrying the style identification to each display view in the page window so that each display view can acquire a style configuration file corresponding to the style identification, and performing view rendering processing according to the style configuration file.
A8. According to the method of a7, the acquiring, by each display view, the style configuration file corresponding to the style identifier, and performing view rendering processing according to the style configuration file further includes:
judging whether the pattern identifier in the variation signal is consistent with the pattern identifier in the previous variation signal or not for each display view;
and if the style configuration file is inconsistent with the style identifier in the change signal, the display view acquires the style configuration file corresponding to the style identifier in the change signal, and performs view rendering processing again according to the style configuration file.
A9. According to the method described in a7 or A8, after the respective display views acquire the style configuration file of the display style corresponding to the style identifier and perform view rendering processing according to the style configuration file, the method further includes:
judging whether any display view has an idle area;
and if so, adding and displaying presentation materials in the free area of the display view.
A10. The method of a9, the adding and displaying presentation material in a free area of the display view further comprising:
and acquiring a presentation material and a preset material style configuration file, adding the presentation material in an idle area of the display view, and rendering the presentation material according to the preset material style configuration file.
B11. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
obtaining window width information of a page window through a page listener registered in the page window;
determining a matched display style according to the window width information;
and sending a change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
B12. The computing device of B11, the executable instructions further cause the processor to:
and registering an empty view in the root view of the page window as a page listener, and calling a measuring method in the page listener to obtain the window width information of the page window.
B13. The computing device of B11 or B12, the executable instructions further cause the processor to:
searching a matched display style from a plurality of preset page display styles corresponding to the page window according to the window width information; alternatively, the first and second electrodes may be,
and aiming at each display view in the page window, calculating the number of corresponding display objects which can be contained in the display view according to the window width information, and setting a matched display style for the display view according to the number of the display objects.
B14. The computing device of B13, the executable instructions further cause the processor to:
calculating the number of the reference objects which can be accommodated under the window width information according to the window width information and the width information of the reference objects;
and determining a preset page display style corresponding to the number of the reference objects in the plurality of preset page display styles as a matched display style.
B15. The computing device of B13 or B14, the preset page display style comprising: the number of display objects contained in each display view of the page window, the display position and arrangement of each display object.
B16. The computing device of B13, the executable instructions further cause the processor to:
for each display view in the page window, calculating view width information of the display view according to the window width information and a preset width ratio of the display view in the page window;
calculating the number of display objects which can be accommodated in the display view according to the view width information and the object width information of the display objects contained in the display view;
and setting the display position and the arrangement mode of the display objects according to the number of the display objects to obtain the display style matched with the display view.
B17. The computing device of any one of B11-B16, the information related to the display style comprising: a style identification of the display style;
the executable instructions further cause the processor to:
and sending the change signal carrying the style identification to each display view in the page window so that each display view can acquire a style configuration file corresponding to the style identification, and performing view rendering processing according to the style configuration file.
B18. The computing device of B17, the executable instructions further cause the processor to:
judging whether the pattern identifier in the variation signal is consistent with the pattern identifier in the previous variation signal or not for each display view;
and if the style configuration file is inconsistent with the style identifier in the change signal, the display view acquires the style configuration file corresponding to the style identifier in the change signal, and performs view rendering processing again according to the style configuration file.
B19. The computing device of B17 or B18, the executable instructions further cause the processor to:
judging whether any display view has an idle area;
and if so, adding and displaying presentation materials in the free area of the display view.
B20. The computing device of B19, the executable instructions further cause the processor to:
and acquiring a presentation material and a preset material style configuration file, adding the presentation material in an idle area of the display view, and rendering the presentation material according to the preset material style configuration file.
C21. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the page adaptive display method as described in any one of a1-a 10.

Claims (10)

1. A page adaptation display method comprises the following steps:
obtaining window width information of a page window through a page listener registered in the page window;
determining a matched display style according to the window width information;
and sending a change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
2. The method of claim 1, wherein obtaining window width information of a page window through a page listener registered in the page window further comprises:
and registering an empty view in the root view of the page window as a page listener, and calling a measuring method in the page listener to obtain the window width information of the page window.
3. The method of claim 1 or 2, the determining a matching display style according to the window width information further comprising:
searching a matched display style from a plurality of preset page display styles corresponding to the page window according to the window width information; alternatively, the first and second electrodes may be,
and aiming at each display view in the page window, calculating the number of corresponding display objects which can be contained in the display view according to the window width information, and setting a matched display style for the display view according to the number of the display objects.
4. The method of claim 3, wherein the searching for a matching display style from a plurality of preset page display styles corresponding to the page window according to the window width information further comprises:
calculating the number of the reference objects which can be accommodated under the window width information according to the window width information and the width information of the reference objects;
and determining a preset page display style corresponding to the number of the reference objects in the plurality of preset page display styles as a matched display style.
5. The method of claim 3 or 4, the preset page display style comprising: the number of display objects contained in each display view of the page window, the display position of each display object, and the arrangement manner.
6. The method according to claim 3, wherein for each display view in the page window, calculating the number of corresponding display objects that can be accommodated by the display view according to the window width information, and setting a matched display style for the display view according to the number of display objects further comprises:
for each display view in the page window, calculating view width information of the display view according to the window width information and a preset width ratio of the display view in the page window;
calculating the number of display objects which can be accommodated in the display view according to the view width information and the object width information of the display objects contained in the display view;
and setting the display position and the arrangement mode of the display objects according to the number of the display objects to obtain the display style matched with the display view.
7. The method according to any one of claims 1-6, wherein the information related to the display style comprises: a style identifier of the display style;
the sending the variation signal carrying the relevant information of the display style to each display view in the page window for each display view to perform view rendering processing according to the relevant information further comprises:
and sending the change signal carrying the style identification to each display view in the page window so that each display view can acquire a style configuration file corresponding to the style identification, and performing view rendering processing according to the style configuration file.
8. The method according to claim 7, wherein each display view acquires a style configuration file corresponding to the style identifier, and performing view rendering processing according to the style configuration file further comprises:
judging whether the pattern identifier in the variation signal is consistent with the pattern identifier in the previous variation signal or not for each display view;
and if the style configuration file is inconsistent with the style identifier in the change signal, the display view acquires the style configuration file corresponding to the style identifier in the change signal, and performs view rendering processing again according to the style configuration file.
9. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
obtaining window width information of a page window through a page listener registered in the page window;
determining a matched display style according to the window width information;
and sending a change signal carrying the relevant information of the display style to each display view in the page window so that each display view can perform view rendering processing according to the relevant information.
10. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the page adaptive display method according to any one of claims 1 to 8.
CN202210142544.6A 2022-02-16 2022-02-16 Page adaptation display method, computing device and storage medium Pending CN114510311A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210142544.6A CN114510311A (en) 2022-02-16 2022-02-16 Page adaptation display method, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210142544.6A CN114510311A (en) 2022-02-16 2022-02-16 Page adaptation display method, computing device and storage medium

Publications (1)

Publication Number Publication Date
CN114510311A true CN114510311A (en) 2022-05-17

Family

ID=81551410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210142544.6A Pending CN114510311A (en) 2022-02-16 2022-02-16 Page adaptation display method, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN114510311A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168712A (en) * 2017-05-19 2017-09-15 广东欧珀移动通信有限公司 Interface method for drafting, mobile terminal and computer-readable recording medium
CN113486280A (en) * 2021-07-02 2021-10-08 北京达佳互联信息技术有限公司 Page rendering display method, device, equipment, storage medium and program product

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168712A (en) * 2017-05-19 2017-09-15 广东欧珀移动通信有限公司 Interface method for drafting, mobile terminal and computer-readable recording medium
CN113486280A (en) * 2021-07-02 2021-10-08 北京达佳互联信息技术有限公司 Page rendering display method, device, equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
US10096142B2 (en) Method and apparatus for contextually varying imagery on a map
US20150073866A1 (en) Data visualization and user interface for monitoring resource allocation to customers
CN111950056B (en) BIM display method and related equipment for building informatization model
US20160321301A1 (en) Method And Apparatus For Information Searching
US11119973B2 (en) Managing white space in a portal web page
CN111580788B (en) Template collocation information recommendation method and device and electronic equipment
EP4033438A1 (en) Video generation method and device, and terminal and storage medium
US20170103430A1 (en) Responsive advertisement formats based on viewability pixel data
CN110187816B (en) Automatic page turning method for cartoon type electronic book, computing device and storage medium
CN113010252A (en) Application page display method, electronic equipment and storage medium
US9734218B2 (en) Spiral listing of items
CN115082156A (en) Shop page display window processing method, server, client and merchant terminal
US20110251886A1 (en) Promotional placement of applications in a marketplace
CN114268828A (en) Method, device and equipment for processing large-screen page and storage medium
CN112132599A (en) Image processing method and device, computer readable storage medium and electronic device
CN113343109A (en) List recommendation method, computing device and computer storage medium
CN113763009A (en) Picture processing method, picture skipping method, device, equipment and medium
CN114510311A (en) Page adaptation display method, computing device and storage medium
CN107239268A (en) A kind of method for processing business, device and intelligent terminal
US20150142576A1 (en) Methods and mobile devices for displaying an adaptive advertisement object and systems for generating the adaptive advertisement object
CN113656577A (en) Page display method and device and computer equipment
WO2016029705A1 (en) Method and device for inserting webpage toolbar, and storage medium
CN111221446A (en) Menu display method, device and equipment
CN110968379A (en) Page control method and device of electronic equipment and electronic equipment
CN110298679A (en) A kind of method and apparatus calculating the distance between sample data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination