CN113835791B - Method and apparatus for presenting hierarchical relationships of view components - Google Patents
Method and apparatus for presenting hierarchical relationships of view components Download PDFInfo
- Publication number
- CN113835791B CN113835791B CN202010579539.2A CN202010579539A CN113835791B CN 113835791 B CN113835791 B CN 113835791B CN 202010579539 A CN202010579539 A CN 202010579539A CN 113835791 B CN113835791 B CN 113835791B
- Authority
- CN
- China
- Prior art keywords
- view
- offset
- page
- level
- hierarchy
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 230000004044 response Effects 0.000 claims abstract description 20
- 230000000875 corresponding effect Effects 0.000 claims description 44
- 230000009466 transformation Effects 0.000 claims description 31
- 238000012545 processing Methods 0.000 claims description 26
- 238000004590 computer program Methods 0.000 claims description 9
- 230000002596 correlated effect Effects 0.000 claims description 6
- 230000009467 reduction Effects 0.000 claims description 6
- 238000001514 detection method Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 238000009877 rendering Methods 0.000 description 4
- 230000001276 controlling effect Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 241000094111 Parthenolecanium persicae Species 0.000 description 2
- 238000012356 Product development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
Embodiments of the present disclosure disclose methods and apparatus for presenting hierarchical relationships of view components. One embodiment of the method comprises the following steps: determining, in response to detecting an operation to indicate a hierarchical relationship of view components in a view page, an offset for each hierarchy, wherein the offsets for different hierarchies are different; for each level in the hierarchy, shifting the area displaying the view components in the hierarchy according to the corresponding offset of the level, and drawing the view components in the hierarchy in the shifted area. The embodiment realizes view structure and hierarchy relation of the real-time view page.
Description
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method and apparatus for presenting hierarchical relationships of view components.
Background
The layout of pages presented to users by many products or applications is becoming increasingly complex. In particular, for a developer, in many cases, the developer needs to view detailed layout of each component in the page to see whether there is a problem in the page presentation of the product or application or to pertinently optimize the page, etc.
For example, in developing an application, a developer typically views the page effects rendered by the application runtime. If some pages have problems such as partial content rendering failure, content stacking or shifting, page stuck, etc., a developer needs to quickly locate the structure and hierarchy of view components in the page in order to solve the problem.
Currently, some product development tools or frameworks and the like are provided with layout viewing functionality. The functionality provided by these product development tools or frameworks is typically only to view static page layouts, or only the boundaries of individual view components in a page.
Disclosure of Invention
Embodiments of the present disclosure propose methods and apparatus to present hierarchical relationships of view components.
In a first aspect, embodiments of the present disclosure provide a method for presenting a hierarchical relationship of view components, the method comprising: determining, in response to detecting an operation to indicate a hierarchical relationship of view components in a view page, an offset for each hierarchy, wherein the offsets for different hierarchies are different; for each level in the hierarchy, shifting the area displaying the view components in the hierarchy according to the corresponding offset of the level, and drawing the view components in the hierarchy in the shifted area.
In some embodiments, the above-described operations include gesture operations; and determining an offset for each level, comprising: according to the above operation, the offset of each level is determined.
In some embodiments, the offset of a level in each level is positively correlated to the depth of the level.
In some embodiments, the above method further comprises: in response to detecting a target transformation operation for indicating an offset region, performing transformation processing on the offset region according to the target transformation operation, wherein the target transformation operation comprises at least one of: an operation for instructing enlargement, an operation for instructing reduction, an operation for instructing rotation.
In some embodiments, the above method further comprises: acquiring position information corresponding to each view component in a page by utilizing a pre-developed hierarchical processing class for presenting the hierarchical relationship of the views, wherein the position information of the view component comprises relative position information for indicating the position of the view component in the area where the view component is located and hierarchical position information for indicating the hierarchy where the view component is located; the acquired position information is stored using a tree structure.
In some embodiments, the acquiring the location information corresponding to each view component in the page by using the pre-developed hierarchical processing class for presenting the hierarchical relationship of the views includes: using the object created based on the hierarchical processing class as a root view for each view component in the page; and acquiring position information corresponding to each view component in the page according to the layout information of each view component in the page.
In some embodiments, the offset includes an offset in a horizontal direction and an offset in a vertical direction.
In a second aspect, embodiments of the present disclosure provide an apparatus for presenting a hierarchical relationship of view components, the apparatus comprising: a determining unit configured to determine an offset of each level in response to detecting an operation for indicating a hierarchical relationship of view components in a view page, wherein the offsets of different levels are different; and a drawing unit configured to, for a hierarchy in each hierarchy, shift a region in which view components in the hierarchy are displayed according to an offset amount corresponding to the hierarchy, and draw the view components in the hierarchy in the shifted region.
In some embodiments, the above-described operations include gesture operations; and the above-mentioned determination unit is further configured to: according to the above operation, the offset of each level is determined.
In some embodiments, the offset of a level in each level is positively correlated to the depth of the level.
In some embodiments, the apparatus further comprises: a transformation unit configured to perform transformation processing on the shifted region according to a target transformation operation in response to detection of the target transformation operation for instructing the shifted region, wherein the target transformation operation includes at least one of: an operation for instructing enlargement, an operation for instructing reduction, an operation for instructing rotation.
In some embodiments, the apparatus further comprises: an acquisition unit configured to acquire position information respectively corresponding to each view component in a page using a hierarchy processing class developed in advance for presenting a hierarchy relationship of views, wherein the position information of the view component includes relative position information for indicating a position of the view component in an area where the view component is located and hierarchy position information for indicating a hierarchy where the view component is located; the acquired position information is stored using a tree structure.
In some embodiments, the above-described acquisition unit is further configured to: using the object created based on the hierarchical processing class as a root view for each view component in the page; and acquiring position information corresponding to each view component in the page according to the layout information of each view component in the page.
In some embodiments, the offset includes an offset in a horizontal direction and an offset in a vertical direction.
In a third aspect, embodiments of the present disclosure provide a terminal including: one or more processors; a storage means for storing one or more programs; the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the implementations of the first aspect.
According to the method and the device for presenting the hierarchical relationship of the view components, when the operation indicating the hierarchical relationship of the view components in the view page is detected, the offset of each hierarchy is determined, different hierarchies have different offsets, the display area of each hierarchy is offset according to the corresponding offset, and the view components in the hierarchy are drawn in the offset display area, so that the view structure and the hierarchical relationship of the current page can be presented in real time in response to the operation of a user.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for presenting hierarchical relationships of view components, in accordance with the present disclosure;
FIG. 3 is a flow chart of yet another embodiment of a method for presenting hierarchical relationships of view components according to the present disclosure;
FIG. 4 is a schematic diagram of one application scenario of a method for presenting hierarchical relationships of view components, according to an embodiment of the present disclosure;
FIG. 5 is a structural schematic diagram of one embodiment of an apparatus for presenting hierarchical relationships of view components in accordance with the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 illustrates an exemplary architecture 100 to which embodiments of the methods of the present disclosure for presenting a hierarchical relationship of view components or apparatuses for presenting a hierarchical relationship of view components may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages or the like. Various client applications can be installed on the terminal devices 101, 102, 103. Such as browser-like applications, shopping-like applications, instant messaging-like applications, social platform software, information-flow-like applications, and the like.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smartphones, tablet computers, electronic book readers, laptop and desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., multiple software or software modules for providing distributed services) or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may be a server providing various services, such as a back-end server providing support for client applications installed on the terminal devices 101, 102, 103. The server 105 may respond to the client requests sent by the terminal devices 101, 102, 103, and generate response results to feed back to the terminal devices 101, 102, 103.
It should be noted that, the method for presenting a hierarchical relationship of view components provided by the embodiments of the present disclosure is generally performed by the terminal devices 101, 102, 103, and accordingly, the means for presenting a hierarchical relationship of view components is generally provided in the terminal devices 101, 102, 103. At this point, the exemplary system architecture 100 may not have the server 105 and network 104 present.
It should also be noted that various applications may also be installed in the server 105, and that the server 105 may also process the pages of the applications installed thereon to present the user with a hierarchical relationship of view components in the pages. At this time, the method for presenting the hierarchical relationship of view components may also be performed by the server 105, and accordingly, the means for presenting the hierarchical relationship of view components may also be provided in the server 105. At this point, the exemplary system architecture 100 may not have terminal devices 101, 102, 103 and network 104.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster formed by a plurality of servers, or as a single server. When server 105 is software, it may be implemented as multiple software or software modules (e.g., multiple software or software modules for providing distributed services), or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for presenting hierarchical relationships of view components in accordance with the present disclosure is shown. The method for presenting hierarchical relationships of view components comprises the steps of:
In response to detecting an operation indicating a hierarchical relationship of view components in the view page, an offset of each hierarchy is determined, step 201.
In the present embodiment, an execution subject (such as terminal devices 101, 102, 103, etc. shown in fig. 1) for presenting the hierarchical relationship of view components may determine the offset of each view level in the current page upon detecting an operation for instructing viewing of the hierarchical relationship of view components in the current page.
The page may refer to a page presented by the display device of the execution subject. For example, the page may be a current running page of the client application installed on the execution body. For another example, the page may be one page of a certain end application that the tester is testing.
A view component (or control) may refer to various UI (User Interface) elements in a page. Each UI element may be considered a view component. As an example, view components include, but are not limited to: text boxes, buttons, date/time controls, tree controls, list boxes, and the like.
Generally, the layout of a page is set in advance by a developer according to a certain hierarchical relationship. I.e., the view components in the page are hierarchically related. The layout of a page can be generally represented as a tree structure. At this point, each node in the tree structure is a view component that characterizes the page. Each layer in the tree structure may characterize a layer of views that the page has.
In the present embodiment, the operation for indicating the hierarchical relationship of view components in the view page may be various user operations. For example, the operation for indicating the hierarchical relationship of view components in the view page may be a pre-specified one (e.g., double-clicking on a specified area of the page or pressing an execute button on the terminal, etc.). For another example, the operation for indicating the hierarchical relationship of view components in the view page may be a pre-designed voice instruction or the like.
The execution body can flexibly adopt various determination of the offset corresponding to each level in the current page layout according to actual application requirements and different application scenes. In general, the offsets of different levels may be different to exhibit a hierarchical relationship.
For example, the offset amounts respectively corresponding to the respective levels in the page layout may be preset. As an example, the offset of each layer is preset in order from the top layer to the bottom layer. At this time, the offset amounts respectively corresponding to the respective levels in the preset current page layout may be acquired upon receiving an operation for indicating the hierarchical relationship of the view component in the view page.
The offset may refer to a degree of offset from the current position to a specified direction. The specific representation of the offset may vary according to the application requirements. For example, the offset may indicate that the offset is in a specified direction (e.g., horizontal).
Alternatively, the offset may indicate that the offset is performed in both the horizontal and vertical directions. At this time, the offset amount may include an offset amount in the horizontal direction and an offset amount in the vertical direction.
Step 202, for each level, shifting the area displaying the view components in the level according to the corresponding offset of the level, and drawing the view components in the level in the shifted area.
In this embodiment, the region of the view component in the display hierarchy may refer to a display region for each view component in the display hierarchy. In some cases, the display areas corresponding to the respective levels may be the same.
By respectively shifting the display areas of different levels to different degrees and respectively drawing the view components in the corresponding levels in the shifted display areas, the relationship among different levels can be displayed, so that a user can know the structural relationship among the view components.
It should be appreciated that in different application scenarios, different methods of shifting regions of view components in a display hierarchy and different methods of rendering view components may be employed in particular.
As an example, if the execution body adopts an Android operating system, the page is an operation page of one client application installed on the execution body. At this point, the area for displaying the view components in the hierarchy may be a Canvas (Canvas). The shifting of the region of the view component in the display hierarchy is the shifting of the canvas object corresponding to the current page. Specifically, the offset may be performed using Canvas objects to invoke corresponding offset methods (e.g., offsetX () and offsetY () methods, etc.). The Canvas object may then be used to invoke a corresponding rendering method (e.g., draw () method, etc.) to render each view component in the hierarchy.
When the display regions corresponding to the respective layers are the same, each time the region of the view component in the display layer is shifted with respect to the current position of the region. In other words, after the area is shifted once, the next shift of the area is not shifted with respect to the position where the area is located after the one shift, but with respect to the position where the area is originally located.
Therefore, for one of the levels, the display area is shifted according to the corresponding offset of the level, and after the shifted area draws the view component in the level, for the next level, the display area needs to be restored to the position before the display area is not shifted, then the display area is shifted for the new time according to the corresponding offset of the level, and the view component in the level is drawn in the area after the new offset.
Optionally, when drawing the view components in each layer, the content originally displayed by the view components can be drawn at the same time, so that the user can see all the displayed content of the current page while knowing the hierarchical relationship of the view components.
In some alternative implementations of the present embodiment, the offset of a level in each level may be positively correlated to the depth of the level. In other words, the level above the other levels has the largest offset and the level below the other levels has the smallest offset.
For example, the offset for each level may be determined based on the product of the depth of the level and a preset offset.
Therefore, the position relation among the layers can be further clear, the comparison of the hierarchical relation among the view components in the page is clear, and therefore the related personnel can see the hierarchical relation among the view components in the page more easily.
In some optional implementations of the present embodiment, in response to detecting a target transformation operation for indicating an offset region, the offset region is transformed according to the target transformation operation.
Wherein the target transformation operation may include at least one of: an operation for instructing enlargement, an operation for instructing reduction, an operation for instructing rotation. The target transformation operation may be various user operations set in advance.
At this time, after the regions displaying the view components in each hierarchy are shifted and the view components are redrawn according to the corresponding shift amounts, operations such as enlarging, reducing, rotating, and the like can be further performed on the shifted regions of the view components in the display hierarchy according to the detected target transformation operation, so as to increase flexibility of control of the user on the page effect.
Still taking the Android operating system as the execution main body, the page is an operation page of one client application installed on the execution main body as an example, at this time, according to the detected target transformation operation, processes such as amplifying (e.g. scale () method, etc.), shrinking (e.g. scale () method, etc.), rotating (e.g. rotate () method, etc. can be performed on the canvas, so that the user can flexibly control the display effect of the page according to the requirement, and observe and understand the hierarchical relationship of each view component in the page from various angles.
In some optional implementations of the present embodiment, the location information corresponding to each view component in the current page may be acquired using a hierarchical processing class developed in advance for presenting the hierarchical relationship of the views, and the acquired location information may be stored using a tree structure.
It should be appreciated that the above-described tree structure may correspond to a positional relationship between view components. The position information of the view component may include relative position information indicating a position of the view component in an area where the view component is located and hierarchical position information indicating a hierarchy where the view component is located. Wherein, the relative position information and the hierarchical position information of the view component can flexibly adopt various representation methods.
For example, the relative position information of a view component may be represented using the position of the view component relative to the upper left corner of the region in which it is located. The hierarchical position information of a view component may be represented using the depth of the hierarchy at which the view component is located.
Therefore, the structure and the position relation among the view components in the page can be conveniently known, and at the moment, for each level, after the level is shifted according to the shift amount corresponding to the level, the view components in the level can be drawn according to the positions indicated by the position information corresponding to the view components in the level.
In some optional implementations of this embodiment, the location information corresponding to each view component in the page may be obtained by using the hierarchical processing class as follows: using the object created based on the hierarchical processing class as a root view for each view component in the page; and acquiring position information corresponding to each view component in the page according to the layout information of each view component in the page.
Still taking the Android operating system as the execution body, the page is an operation page of one client application installed on the execution body as an example for illustration, and the hierarchical processing class may be a container class. Specifically, upon receiving a request indicating viewing of hierarchical relationships of view components in a current page, it is possible to remove all view contents under a root view of a current window (window), and add the removed view contents to a container created based on a hierarchical processing class, and then add the created container as contents under the root view of the current window. Thus, the hierarchical processing class can be utilized to obtain the position information corresponding to each view component in the page in a recursion mode.
It should be understood that at this time, the region shift method of the view component in the display hierarchy, the drawing method of the view component, and the like may be rewritten with the hierarchy process class to shift each hierarchy and draw the view component in the hierarchy.
Alternatively, upon receiving a request indicating to close the hierarchical relationship of the view components in the current page, the hierarchical relationship of the view components in the current page may be presented to the user by removing the added content in the created container and adding the removed content under the root view of the current window (window) to resume the application native processing logic no longer in response to the operation for indicating to view the hierarchical relationship of the view components in the page.
In some alternative implementations of the present embodiment, the execution body may expose a pre-developed switch control (e.g., switch). At this time, the user can control whether to present the hierarchical relationship of the view components in the current page by controlling the on or off of the switch control. When the switch control is on, steps 201 and 202 described above may be performed so that the user may view the hierarchical relationship of view components in the current page by operation. When the switch control is off, the user can only browse the real-time operation effect of the page, and can not view the hierarchical relationship of the view components in the current page through related operations. Thus, the user can control on or off of the function of viewing the hierarchical relationship of view components in the current page according to the current demand in real time.
For example, a developer may preset a debug back door and set the switch controls described above. Therefore, a developer can conveniently check the hierarchical relation of view components in the currently running page in real time by controlling the switch control to be on, so that help can be provided for the developer to analyze problems related to the current page or optimize the current page. Meanwhile, the developer can also close the display of the hierarchical relationship of the view components in the page by controlling the switch control to be off, so that convenience is provided for the work of the developer.
According to the method provided by the embodiment of the invention, through detecting the operation for indicating the hierarchical relation of view components in the current page, determining the offset corresponding to each view level of the current page when the operation is detected, carrying out corresponding offset on each level according to the determined offset, and drawing the view components in the level in the display area corresponding to the level after offset, the position relation among different levels can be presented to distinguish the different levels, and related personnel can conveniently view the hierarchical relation among the view components in the current page in real time in the application running process.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a method for presenting hierarchical relationships of view components is illustrated. The flow 300 of the method for presenting hierarchical relationships of view components includes the steps of:
In step 301, in response to detecting a gesture operation for indicating a hierarchical relationship of view components in a view page, an offset of each hierarchy is determined according to the detected gesture operation.
In this embodiment, the gesture operation may be various types of gesture operations, and specifically may be preset by a technician according to an actual application requirement or an application scenario. For example, the gesture operation may include a contact gesture operation, a non-contact gesture operation, or the like.
The correspondence between the gesture operation and the offset of each level may be designed in advance by a technician. At this time, the offset of each level may be calculated using a pre-designed correspondence according to the detected gesture operation.
For example, the gesture operation may include a single-finger swipe operation. At this time, the correspondence relationship between the operation attribute (such as the sliding direction and the sliding distance) of the single-finger sliding operation and the offset amount of each level may be designed in advance.
Step 302, for each level in the hierarchy, shifting the area displaying the view component in the hierarchy according to the corresponding offset of the level, and drawing the view component in the hierarchy in the shifted area.
The specific implementation of this step 302 may refer to the description of step 202 in the corresponding embodiment of fig. 2, and will not be described herein.
Optionally, after the regions displaying the view components in each hierarchy are shifted according to the corresponding offset amounts and the view components are redrawn, operations such as zooming in, zooming out, rotating and the like can be further performed on the shifted regions according to the detected gesture operation for indicating transformation of the shifted regions, so that a user can conveniently control the page presentation effect through convenient gesture operation. For example, different two-finger operations may be used to indicate a zoom-in operation, a zoom-out operation, and a rotate operation, respectively, on an area where view components in each hierarchy are displayed.
It should be understood that, as the gesture of the user changes, the executing entity may continuously execute the steps 301 and 302, so as to continuously present the hierarchical relationship of the view components in the current page at different angles or different degrees according to the gesture of the user.
With continued reference to fig. 4, fig. 4 is an exemplary application scenario 400 of a method for presenting hierarchical relationships of view components according to the present embodiment. As shown in the drawing 401, the page displayed by the terminal includes a control 1, a control 2, a control 3 and a control 4. When a sliding operation in the upper left direction of a user is detected, according to the detected direction and distance of the sliding operation, calculating the offset (including the offset in the horizontal direction and the offset in the vertical direction) of each view level, sequentially shifting the display area of each level according to the corresponding offset, and drawing each component according to the position of each view component in the level relative to the display area, thereby obtaining the page effect presenting the level relation among the view components as shown by reference numeral 402 in the figure.
As is clear from the page indicated by reference numeral 402 in the figure, among the four controls of the current page, control 1 is located at the top layer, control 2 is located at the second layer below the top layer, control 3 is located at the third layer, and control 4 is located at the lowest layer of all view levels.
The method provided by the embodiment of the disclosure facilitates the user to more flexibly view the hierarchical relationship of the view components in the page according to the own requirements by supporting the user to operate the presentation and transformation of the hierarchical relationship of the real-time control components by gestures, and the hierarchical relationship of the view components in the current page can be viewed from different angles and all directions.
With further reference to fig. 5, as an implementation of the method illustrated in the above figures, the present disclosure provides one embodiment of an apparatus for presenting a hierarchical relationship of view components, which corresponds to the method embodiment illustrated in fig. 2, which is particularly applicable in a variety of electronic devices.
As shown in fig. 5, the apparatus 500 for presenting a hierarchical relationship of view components provided in the present embodiment includes a determining unit 501 and a drawing unit 502. Wherein the determining unit 501 is configured to determine, in response to detecting an operation for indicating a hierarchical relationship of view components in a view page, an offset of each hierarchy, wherein the offsets of different hierarchies are different; the drawing unit 502 is configured to, for each of the levels, shift a region in which the view component in the level is displayed according to the shift amount corresponding to the level, and draw the view component in the level in the shifted region.
In the present embodiment, in the apparatus 500 for presenting a hierarchical relationship of view components: the specific processing of the determining unit 501 and the drawing unit 502 and the technical effects thereof may refer to the relevant descriptions of step 201 and step 202 in the corresponding embodiment of fig. 2, and are not repeated herein.
In some optional implementations of the present embodiment, the operations described above include gesture operations; and the above-described determination unit 501 is further configured to: according to the above operation, the offset of each level is determined.
In some alternative implementations of the present embodiment, the offset of a level in each level is positively correlated with the depth of the level.
In some optional implementations of this embodiment, the apparatus 500 for presenting a hierarchical relationship of view components further includes: the transformation unit (not shown in the figure) is configured to perform transformation processing on the shifted region according to a target transformation operation in response to detection of the target transformation operation for indicating the shifted region, wherein the target transformation operation includes at least one of: an operation for instructing enlargement, an operation for instructing reduction, an operation for instructing rotation.
In some optional implementations of this embodiment, the apparatus 500 for presenting a hierarchical relationship of view components further includes: an acquisition unit (not shown in the figure) is configured to acquire position information respectively corresponding to each view component in the page using a hierarchy process class developed in advance for presenting a hierarchy relationship of views, wherein the position information of the view component includes relative position information for indicating a position of the view component in an area where the view component is located and hierarchy position information for indicating a hierarchy where the view component is located; the acquired position information is stored using a tree structure.
In some optional implementations of this embodiment, the acquiring unit is further configured to: using the object created based on the hierarchical processing class as a root view for each view component in the page; and acquiring position information corresponding to each view component in the page according to the layout information of each view component in the page.
In some alternative implementations of this embodiment, the offset includes an offset in the horizontal direction and an offset in the vertical direction.
The device provided by the embodiment of the disclosure, in response to detecting the operation for indicating the hierarchical relation of the view component in the view page, determines the offset of each hierarchy, wherein the offsets of different hierarchies are different; and the drawing unit is used for carrying out offset on the area for displaying the view components in each level according to the offset corresponding to the level and drawing the view components in the level in the offset area, so that the position relationship among different levels can be presented, and related personnel can directly and clearly know the level relationship among the view components in the page.
Referring now to fig. 6, a schematic diagram of a configuration of an electronic device (e.g., the terminal device of fig. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The terminal device shown in fig. 6 is only one example, and should not impose any limitation on the functions and scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 6 may represent one device or a plurality of devices as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 601.
It should be noted that, the computer readable medium according to the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In an embodiment of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Whereas in embodiments of the present disclosure, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the terminal; or may exist alone without being fitted into the terminal. The computer-readable medium carries one or more programs which, when executed by the terminal, cause the terminal to: determining, in response to detecting an operation to indicate a hierarchical relationship of view components in a view page, an offset for each hierarchy, wherein the offsets for different hierarchies are different; for each level in the hierarchy, shifting the area displaying the view components in the hierarchy according to the corresponding offset of the level, and drawing the view components in the hierarchy in the shifted area.
Computer program code for carrying out operations of embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments described in the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes a determination unit and a rendering unit. Wherein the names of the units do not constitute a limitation of the unit itself in some cases, for example, the determining unit may also be described as "a unit that determines an offset of each hierarchy in response to detecting an operation for indicating a hierarchical relationship of view components in a view page".
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.
Claims (7)
1. A method for presenting hierarchical relationships of view components, comprising:
In response to detecting an operation for indicating a hierarchical relationship of view components in a view page, determining offset of each hierarchy according to the direction and distance of the operation, wherein the offset of different hierarchies is different, and the operation comprises gesture operation; the offset of a level in each level is positively correlated with the depth of the level;
For each level in the levels, shifting the area for displaying the view components in the level according to the corresponding offset of the level, and drawing the view components in the level in the shifted area;
In response to detecting a target transformation operation for indicating the shifted region, performing transformation processing on the shifted region according to the target transformation operation, wherein the target transformation operation comprises at least one of the following: an operation for instructing enlargement, an operation for instructing reduction, an operation for instructing rotation.
2. The method of claim 1, wherein the method further comprises:
Acquiring position information corresponding to each view component in the page by utilizing a pre-developed hierarchical processing class for presenting the hierarchical relationship of the view, wherein the position information of the view component comprises relative position information for indicating the position of the view component in the area where the view component is located and hierarchical position information for indicating the hierarchy where the view component is located;
The acquired position information is stored using a tree structure.
3. The method of claim 2, wherein the obtaining, with a pre-developed hierarchical processing class for presenting a hierarchical relationship of views, location information for each view component in the page, comprises:
Using an object created based on the hierarchical processing class as a root view for each view component in the page;
and acquiring position information corresponding to each view component in the page according to the layout information of each view component in the page.
4. The method of claim 1, wherein the offset comprises an offset in a horizontal direction and an offset in a vertical direction.
5. An apparatus for presenting a hierarchical relationship of view components, wherein the apparatus comprises:
A determining unit configured to determine, in response to detection of an operation for indicating a hierarchical relationship of view components in a view page, an offset of each hierarchy according to a direction and a distance of the operation, wherein the offsets of different hierarchies are different, the operation including a gesture operation; the offset of a level in each level is positively correlated with the depth of the level;
a drawing unit configured to, for a hierarchy in the respective hierarchies, shift a region in which view components in the hierarchy are displayed according to an offset amount corresponding to the hierarchy, and draw the view components in the hierarchy in the shifted region;
The apparatus further comprises: a transformation unit configured to perform transformation processing on the shifted region according to a target transformation operation in response to detection of the target transformation operation for instructing the shifted region, wherein the target transformation operation includes at least one of: an operation for instructing enlargement, an operation for instructing reduction, an operation for instructing rotation.
6. A terminal, comprising:
One or more processors;
a storage device having one or more programs stored thereon;
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-4.
7. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010579539.2A CN113835791B (en) | 2020-06-23 | 2020-06-23 | Method and apparatus for presenting hierarchical relationships of view components |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010579539.2A CN113835791B (en) | 2020-06-23 | 2020-06-23 | Method and apparatus for presenting hierarchical relationships of view components |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113835791A CN113835791A (en) | 2021-12-24 |
CN113835791B true CN113835791B (en) | 2024-05-07 |
Family
ID=78964003
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010579539.2A Active CN113835791B (en) | 2020-06-23 | 2020-06-23 | Method and apparatus for presenting hierarchical relationships of view components |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113835791B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08263255A (en) * | 1995-03-23 | 1996-10-11 | Canon Inc | Hierarchical data display method and browser system |
JP2002176467A (en) * | 2000-12-08 | 2002-06-21 | Sony Corp | System information analysis device and analysis method |
JP2009266009A (en) * | 2008-04-25 | 2009-11-12 | Konica Minolta Business Technologies Inc | Document processor, document summary preparation method, and document summary preparation program |
KR20120008385A (en) * | 2010-07-16 | 2012-01-30 | 주식회사 오비고 | Method, terminal and computer-readable recording medium for helping user to navigate content having a complex structure of hierarchy in mobile environments |
JP2013222489A (en) * | 2012-04-18 | 2013-10-28 | Toshiba Corp | Medical information recording device and medical information recording method |
CN108021717A (en) * | 2017-12-29 | 2018-05-11 | 成都三零嘉微电子有限公司 | A kind of implementation method of lightweight embedded file system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6990638B2 (en) * | 2001-04-19 | 2006-01-24 | International Business Machines Corporation | System and method for using shading layers and highlighting to navigate a tree view display |
US10157172B2 (en) * | 2008-08-27 | 2018-12-18 | International Business Machines Corporation | Property dependency visualization |
-
2020
- 2020-06-23 CN CN202010579539.2A patent/CN113835791B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08263255A (en) * | 1995-03-23 | 1996-10-11 | Canon Inc | Hierarchical data display method and browser system |
JP2002176467A (en) * | 2000-12-08 | 2002-06-21 | Sony Corp | System information analysis device and analysis method |
JP2009266009A (en) * | 2008-04-25 | 2009-11-12 | Konica Minolta Business Technologies Inc | Document processor, document summary preparation method, and document summary preparation program |
KR20120008385A (en) * | 2010-07-16 | 2012-01-30 | 주식회사 오비고 | Method, terminal and computer-readable recording medium for helping user to navigate content having a complex structure of hierarchy in mobile environments |
JP2013222489A (en) * | 2012-04-18 | 2013-10-28 | Toshiba Corp | Medical information recording device and medical information recording method |
CN108021717A (en) * | 2017-12-29 | 2018-05-11 | 成都三零嘉微电子有限公司 | A kind of implementation method of lightweight embedded file system |
Also Published As
Publication number | Publication date |
---|---|
CN113835791A (en) | 2021-12-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109857486B (en) | Method, device, equipment and medium for processing program page data | |
CN111291244B (en) | House source information display method, device, terminal and storage medium | |
CN113377365B (en) | Code display method, apparatus, device, computer readable storage medium and product | |
CN110489041B (en) | Method, device, equipment and medium for automatically aligning small program dragging elements | |
CN112433730B (en) | Code detection rule generation method and device and electronic equipment | |
CN111273830A (en) | Data display method and device, electronic equipment and computer readable medium | |
CN111177634A (en) | Multi-language supporting file content loading method, device, equipment and medium | |
CN111857915B (en) | Application page display method and device | |
CN110489023A (en) | Implementation method, device, equipment, medium and the system of windows display | |
CN116560558A (en) | Interaction method among multiple screens of vehicle, electronic equipment and vehicle | |
CN113835791B (en) | Method and apparatus for presenting hierarchical relationships of view components | |
CN111290812B (en) | Display method, device, terminal and storage medium of application control | |
CN113672317B (en) | Method and device for rendering topic pages | |
CN113835792B (en) | Method and device for drawing page element | |
CN110737494A (en) | Window arrangement method, device, terminal and storage medium | |
CN112306339B (en) | Method and apparatus for displaying image | |
CN113763459B (en) | Element position updating method and device, electronic equipment and storage medium | |
CN114327188B (en) | Form layout method, form layout device, electronic equipment and computer readable medium | |
CN111177635B (en) | Webpage display height determining method, device, storage medium and equipment | |
CN111309675B (en) | Associated information display method and device, electronic equipment and storage medium | |
CN116185412B (en) | Data management method and device, electronic equipment and storage medium | |
CN114564246B (en) | Method, device, equipment and medium for drawing graphic anchor points on line | |
CN117762305B (en) | Page interaction method and device based on intelligent drawing, electronic equipment and medium | |
CN113821282B (en) | Method and device for showing statistical graphs | |
CN114816609B (en) | Method and device for displaying window, electronic equipment and computer readable storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |