Method for generating editable list

文档序号:1936643 发布日期:2021-12-07 浏览:12次 中文

阅读说明:本技术 一种可编辑列表的生成方法 (Method for generating editable list ) 是由 杨健 于 2021-09-08 设计创作,主要内容包括:本发明涉及一种可编辑列表的生成方法,包括如下步骤:基于列表拖拽排序功能生成列表;向列表中的单元格填充待显示信息;当针对列表中的单元格的拖拽事件被触发,查询当前用户的操作权限,当用户不具有权限执行改变列表中的单元格顺序时,使拖拽事件缺少操作对象而无法执行相应操作,当用户具有权限执行改变列表中的单元格顺序时,使拖拽事件以高亮单元格为操作对象执行相应操作。本发明,基于列表拖拽排序功能生成列表后,进一步为用户分配不同的权限,所述权限决定某用户是否能改变列表中的单元格顺序,实现了列表首页顶端的若干个单元格不参与拖拽排序,当用户无相应权限时,向用户给出相应提示,提升交互界面的呈现效果,增强用户使用体验。(The invention relates to a method for generating an editable list, which comprises the following steps: generating a list based on a list dragging and sorting function; filling the cells in the list with information to be displayed; when a drag event aiming at the cells in the list is triggered, inquiring the operation authority of the current user, when the user does not have the authority to execute and change the order of the cells in the list, enabling the drag event to lack an operation object and not to execute corresponding operation, and when the user has the authority to execute and change the order of the cells in the list, enabling the drag event to execute corresponding operation by taking the highlighted cells as the operation object. According to the method and the device, after the list is generated based on the list dragging and sorting function, different permissions are further distributed to the users, the permissions determine whether a certain user can change the order of the cells in the list, the purpose that the cells at the top end of the home page of the list do not participate in dragging and sorting is achieved, when the user does not have corresponding permissions, corresponding prompts are given to the user, the presentation effect of an interactive interface is improved, and the user experience is enhanced.)

1. A method for generating an editable list, comprising the steps of:

generating a list based on a list dragging and sorting function;

filling the cells in the list with information to be displayed;

when a drag event for a cell in the list is triggered, the following processing is performed:

the operation authority of the current user is inquired,

when the user does not have the authority to change the cell sequence in the list, all the cells are changed into light color, so that the user cannot finish selecting the light color cells, the corresponding operation cannot be executed due to the lack of the operation object of the drag event,

when the user has the authority to change the order of the cells in the list, the cells corresponding to the current operation focus are changed into high-brightness cells in color, so that the user can complete the selection of the high-brightness cells, and the dragging event takes the high-brightness cells as the operation objects to execute corresponding operations.

2. The method of claim 1, wherein when the user has the right to change the order of the cells in the list, further confirming which of the following is the right category of the user:

the full cell operation authority can trigger a dragging event for all the cells in the list;

and the limited cell operation authority can trigger a dragging event for the non-fixed position cell in the list.

3. The method for generating an editable list according to claim 2, wherein when the user has the limited cell operation authority, the following operations are further performed:

determining a specifically assigned label for each cell, the label identifying whether the corresponding cell supports triggering a drag event,

for cells identified by the label that do not support triggering of a drag event, then: the cells are changed into light color, so that a user cannot finish selecting the light color cells, and the corresponding operation cannot be executed due to the lack of operation objects of the drag event;

for cells identified by the label that can support triggering of the drag event, then: and changing the color of the cell corresponding to the current operation focus into highlight, finishing the selection of the highlight cell by a user, and executing corresponding operation by taking the highlight cell as an operation object through a dragging event.

4. The method as claimed in claim 3, wherein when the user has the right to change the order of the cells in the list and has the limited cell operation right, the cells are labeled with words and colors to visually prompt the user which cells are operable and which cells are inoperable.

5. The method as claimed in claim 3, wherein for the cells identified by the tags that do not support triggering of the drag event, the sorting order of the corresponding cells is further determined according to the level of the tags, and the cell corresponding to the tag with high priority is located above the cell corresponding to the tag with low priority.

6. The method for generating an editable list according to claim 1, wherein the generating of the list based on the list dragging and sorting function is: and generating a list by utilizing a circulator view component RecycleView provided by the android, and deleting and dragging the moving tool class ItemTouchHelper through sideslip provided by the component.

7. The method of claim 3, wherein the tag is implemented by a RecycleView adapter tag.

Technical Field

The invention relates to the technical field of interactive interface optimization, in particular to a method for generating an editable list.

Background

In existing android systems, in order to clearly present some information to a user and allow the user to properly sort the presented information, a list drag and sort function is typically used.

The list dragging and sorting function presents a list (data list) to a user, and each cell in the list allows the user to change the order of the cells (sort data) in a dragging mode, so that the user can arrange the data conveniently according to the needs of the user.

In the existing list dragging and sorting function, all cells in the list participate in dragging and sorting, and part of the cells cannot be fixed, but in the existing interactive design, the information presented in part of the cells is expected to be fixed, namely, a plurality of cells at the top end of a list home page are expected to be presented at the top end of the list home page in a fixed sequence forever, and the sequence is not allowed to be exchanged by a user. Therefore, there is a need to optimize the existing list drag ordering function.

The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art.

Disclosure of Invention

Aiming at the defects in the prior art, the invention aims to provide a method for generating an editable list, which is characterized in that after the list is generated based on a list dragging and sorting function, different authorities are further allocated to users, the authorities determine whether a certain user can change the sequence of cells in the list, so that a plurality of cells at the top of a first page of the list do not participate in dragging and sorting, when the user does not have corresponding authority, a corresponding prompt is given to the user, the presentation effect of an interactive interface is improved, and the use experience of the user is enhanced.

In order to achieve the above purposes, the technical scheme adopted by the invention is as follows:

a method for generating an editable list, comprising the steps of:

generating a list based on a list dragging and sorting function;

filling the cells in the list with information to be displayed;

when a drag event for a cell in the list is triggered, the following processing is performed:

the operation authority of the current user is inquired,

when the user does not have the authority to change the cell sequence in the list, all the cells are changed into light color, so that the user cannot finish selecting the light color cells, the corresponding operation cannot be executed due to the lack of the operation object of the drag event,

when the user has the authority to change the order of the cells in the list, the cells corresponding to the current operation focus are changed into high-brightness cells in color, so that the user can complete the selection of the high-brightness cells, and the dragging event takes the high-brightness cells as the operation objects to execute corresponding operations.

On the basis of the technical scheme, when the user has the authority to execute the change of the order of the cells in the list, the authority type of the user is further confirmed to be the following one:

the full cell operation authority can trigger a dragging event for all the cells in the list;

and the limited cell operation authority can trigger a dragging event for the non-fixed position cell in the list.

On the basis of the technical scheme, when the user has the limited cell operation authority, the following operations are further executed:

determining a specifically assigned label for each cell, the label identifying whether the corresponding cell supports triggering a drag event,

for cells identified by the label that do not support triggering of a drag event, then: the cells are changed into light color, so that a user cannot finish selecting the light color cells, and the corresponding operation cannot be executed due to the lack of operation objects of the drag event;

for cells identified by the label that can support triggering of the drag event, then: and changing the color of the cell corresponding to the current operation focus into highlight, finishing the selection of the highlight cell by a user, and executing corresponding operation by taking the highlight cell as an operation object through a dragging event.

On the basis of the technical scheme, when the user has the authority to execute the change of the cell sequence in the list and the operation authority of the limited cells is set, the labels are presented in the cells in a text + color mode, so that the user is intuitively prompted which cells are operable and which cells are inoperable.

On the basis of the technical scheme, for the cells which are identified by the labels and do not support the triggering of the dragging event, the sequencing sequence of the corresponding cells is further determined according to the grade of the labels, and the cell corresponding to the label with high priority is positioned above the cell corresponding to the label with low priority.

On the basis of the technical scheme, the generating of the list based on the list dragging and sorting function means that: and generating a list by utilizing a circulator view component RecycleView provided by the android, and deleting and dragging the moving tool class ItemTouchHelper through sideslip provided by the component.

On the basis of the technical scheme, the label is realized through RecyclerView.

The method for generating the editable list has the following beneficial effects:

after the list is generated based on the list dragging and sorting function, different permissions are further distributed to the users, the permissions determine whether a certain user can change the order of the cells in the list, the fact that the cells at the top end of the top page of the list do not participate in dragging and sorting is achieved, when the user does not have corresponding permissions, corresponding prompts are given to the user, the presenting effect of an interactive interface is improved, and the user experience is enhanced.

Drawings

The invention has the following drawings:

the drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:

fig. 1 is a flowchart of a first embodiment of a method for generating an editable list according to the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings. The detailed description, while indicating exemplary embodiments of the invention, is given by way of illustration only, in which various details of embodiments of the invention are included to assist understanding. Accordingly, it will be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

As shown in fig. 1, the method for generating an editable list according to the present invention includes the following steps:

generating a list based on a list dragging and sorting function;

filling the cells in the list with information to be displayed;

when a drag event for a cell in the list is triggered, the following processing is performed:

the operation authority of the current user is inquired,

when the user does not have the authority to change the cell sequence in the list, all the cells are changed into light color, so that the user cannot finish selecting the light color cells, the corresponding operation cannot be executed due to the lack of the operation object of the drag event,

when the user has the authority to change the order of the cells in the list, the cells corresponding to the current operation focus are changed into high-brightness cells in color, so that the user can complete the selection of the high-brightness cells, and the dragging event takes the high-brightness cells as the operation objects to execute corresponding operations.

According to the method and the device, the control of whether the dragging event can be successfully executed is further realized by adjusting the operation object aimed at by the dragging event, the cells are changed into light colors in consideration of visual and clear visual prompts for users, corresponding to the dragging event, the operation object is lacked and corresponding operation cannot be executed, all the cells which are not allowed to be dragged are changed into colors, the cells are changed into high colors, corresponding to the dragging event, the high-bright cells are used as the operation object to execute corresponding operation, and only the currently dragged cells are changed into colors. And when the operation object is transferred to the drag event, when the user is judged not to have the authority to execute and change the order of the cells in the list, setting all the cells to be light color, otherwise, determining the cells to be operated and setting the cells to be operated to be highlighted.

On the basis of the technical scheme, when the user has the authority to execute the change of the order of the cells in the list, the authority type of the user is further confirmed to be the following one:

the full cell operation authority can trigger a dragging event for all the cells in the list;

and the limited cell operation authority can trigger a dragging event for the non-fixed position cell in the list.

According to the method and the device, a user who generates the list by default has full-cell operation authority, other users have limited-cell operation authority after logging in successfully, and if the user does not log in to view the list in a visitor mode, the user is judged to have no authority to execute and change the order of the cells in the list.

On the basis of the technical scheme, when the user has the limited cell operation authority, the following operations are further executed:

determining a specifically assigned label for each cell, the label identifying whether the corresponding cell supports triggering a drag event,

for cells identified by the label that do not support triggering of a drag event, then: the cells are changed into light color, so that a user cannot finish selecting the light color cells, and the corresponding operation cannot be executed due to the lack of operation objects of the drag event;

for cells identified by the label that can support triggering of the drag event, then: and changing the color of the cell corresponding to the current operation focus into highlight, finishing the selection of the highlight cell by a user, and executing corresponding operation by taking the highlight cell as an operation object through a dragging event.

According to the method and the device, after the list is successfully established, a user generating the list can initialize the label identification and allocate the label identification to each cell, and then according to the label allocated to each cell, whether the corresponding cell supports the triggering of the dragging event is identified and judged. Through the operation authority of the user and the label identification, the more personalized plurality of cells do not participate in the dragging sequencing, and the plurality of cells which do not participate in the dragging sequencing can be reserved at the top end of the list home page.

On the basis of the technical scheme, when the user has the authority to execute the change of the cell sequence in the list and the operation authority of the limited cells is set, the labels are presented in the cells in a text + color mode, so that the user is intuitively prompted which cells are operable and which cells are inoperable.

As one of the alternative embodiments, the label is presented at the upper right corner of the cell, the text defaults to 'draggable', the color defaults to yellow, and the text 'draggable' is set off by the yellow background color, so that the user can intuitively know which cells are operable and which cells are inoperable.

On the basis of the technical scheme, for the cells which are identified by the labels and do not support the triggering of the dragging event, the sequencing sequence of the corresponding cells is further determined according to the grade of the labels, and the cell corresponding to the label with high priority is positioned above the cell corresponding to the label with low priority.

According to the method, after whether the corresponding cells support the trigger drag event or not is judged according to the label identifications distributed by the cells, the priority levels of the cells not participating in the drag sequencing are further set, and through the setting of the priority levels, when a plurality of cells not participating in the drag sequencing are reserved at the top end of the first page of the list, the cells are sequentially displayed according to the priority order, the cells with high priority are preferentially displayed, and the cells with low priority are displayed behind the cells with high priority. The tags used to set the priority may be set individually, as one of the alternative embodiments, only high priority tags are set and assigned to one or more cells, none of the high priority tags being treated as low priority.

On the basis of the technical scheme, the generating of the list based on the list dragging and sorting function means that: and generating a list by utilizing a circulator view component RecycleView provided by the android, and deleting and dragging the moving tool class ItemTouchHelper through sideslip provided by the component.

The circulator view component RecyclerView is a control provided by Android, and not only can achieve the same effect as the ListView, but also various defects in the ListView are optimized. The method can realize vertical scrolling of data and also can realize horizontal scrolling (the horizontal scrolling cannot be realized by ListView). The RecycleView does not provide a ready-to-use API for operation, and the SDK provides an ItemTouchHelper tool class to help realize the relevant operation of the RecycleView. ItemTouchHelper is a tool class that can implement sideslip deletion and drag movement, and RecycleView and Callback are required to use this tool class. While the onMove and onSwiped methods are rewritten as needed.

On the basis of the technical scheme, the label is realized through RecyclerView.

Adapter refers to a RecycleView adapter, which functions to tag a specified object.

Those not described in detail in this specification are within the skill of the art.

The above description is only a preferred embodiment of the present invention, and the scope of the present invention is not limited to the above embodiment, but equivalent modifications or changes made by those skilled in the art according to the present disclosure should be included in the scope of the present invention as set forth in the appended claims.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:页面分屏系统、方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类