List display method and device, electronic equipment and storage medium
1. A list presentation method, comprising:
displaying a target list in a folded state; the target list in the folded state displays M target list items;
in response to an expansion instruction of the target list in the folded state, determining N target list items displayed by the target list in the expanded state, wherein N is greater than M;
determining a first distance between the N target list items;
expanding and displaying the target list in the folded state based on a first distance between the N target list items;
and at least one list item of the N target list items presents the expansion process with a preset first animation display effect.
2. The list presentation method of claim 1, wherein the first spacing is different from a second spacing between the M target list items displayed in a collapsed state.
3. The list presentation method of claim 2, wherein said determining a first spacing between said N target list items comprises:
determining a region parameter of a display region displaying the target list;
determining a first interval between the N target list items based on the region parameter and the number N of the target list items displayed in the expanded state;
wherein the region parameters include at least one of: the size and location of the display area.
4. The list presentation method according to any one of claims 1 to 3, wherein after expanding the target list displaying the collapsed state, the method further comprises:
in response to a collapse instruction for the target list in the expanded state, determining a second spacing between the M target list items;
displaying the target list in the folded state based on a second distance between the M target list items; and at least one list item of the N target list items presents the folding process with a preset second animation display effect.
5. The list presentation method of claim 4, wherein the method further comprises:
respectively acquiring layout attribute information of the target list in the folded state and the unfolded state; the layout attribute information represents position information and display attributes of all list items in the target list, and the display attributes comprise visible attributes and invisible attributes;
and calling a transitional animation execution interface function, determining difference information between the layout attribute information in the folded state and the layout attribute information in the unfolded state, and generating the preset first animation display effect or the preset second animation display effect according to the difference information.
6. The list presentation method according to any one of claims 1 to 5, wherein the target list is a list view based on a system list component.
7. A list presentation apparatus, comprising:
a display unit configured to perform displaying a target list in a folded state; the target list in the folded state displays M target list items;
a display list item determination unit configured to execute, in response to an expansion instruction for the target list in the collapsed state, determining N target list items displayed by the target list in the expanded state, where N is greater than M;
a first spacing determination unit configured to perform determining a first spacing between the N target list items;
the unfolding unit is configured to unfold and display the folded target list based on a first distance between the N target list items;
and at least one list item of the N target list items presents the expansion process with a preset first animation display effect.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the list presentation method of any one of claims 1 to 6.
9. A computer-readable storage medium whose instructions, when executed by a processor of an electronic device, enable the electronic device to perform the list presentation method of any one of claims 1-6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the list presentation method of any one of claims 1 to 6 when executed by a processor.
Background
Currently, interaction with a user may be achieved through a list presented in a user interface of a client, where the list may include listings corresponding to different functional contents, such as a home page list of a news information application, a functional list of a video application, and so on. When a large number of list items exist in a list to be displayed, all the list items are displayed on one screen and are too crowded or cannot be displayed completely, and therefore, one processing mode in the related art is to fold a part of list items first and expand all the list items to be displayed after a user clicks a specific button. However, the list expansion process in the related art has the problems of single layout and poor interactivity.
Disclosure of Invention
The present disclosure provides a list display method, device, electronic device and storage medium, so as to at least solve the problems of single layout and poor interactivity in the list expansion process in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a list display method, including:
displaying a target list in a folded state; the target list in the folded state displays M target list items;
in response to an expansion instruction of the target list in the folded state, determining N target list items displayed by the target list in the expanded state, wherein N is greater than M;
determining a first distance between the N target list items;
expanding and displaying the target list in the folded state based on a first distance between the N target list items;
and at least one list item of the N target list items presents the expansion process with a preset first animation display effect.
In an exemplary embodiment, the first interval is different from a second interval between the M target list items displayed in the folded state.
In an exemplary embodiment, the determining a first distance between the N target list items includes:
determining a region parameter of a display region displaying the target list;
determining a first interval between the N target list items based on the region parameter and the number N of the target list items displayed in the expanded state;
wherein the region parameters include at least one of: the size and location of the display area.
In an exemplary embodiment, the method further comprises:
and in the unfolding process, determining a target position, and displaying the N target list items in the target list in the display area according to the first distance by taking the target position as a reference.
In an exemplary embodiment, the target position is any one of: the position of any list item of the first M-1 target list items in the M target list items; or a preset position in the display area.
In an exemplary embodiment, when the area parameter includes a size of the display area, the determining a first distance between the N target list items based on the area parameter and the number N of the target list items displayed in the expanded state includes:
determining a candidate spacing based on the size of the display area and the number N;
and determining a first interval between the N target list items based on the comparison result of the candidate interval and a preset threshold.
In an exemplary embodiment, the method further comprises:
and moving the N target list items in response to a moving instruction of the target list in the expanded state.
In an exemplary embodiment, after expanding the target list displaying the collapsed state, the method further includes:
in response to a collapse instruction for the target list in the expanded state, determining a second spacing between the M target list items;
displaying the target list in the folded state based on a second distance between the M target list items; and at least one list item of the N target list items presents the folding process with a preset second animation display effect.
In an exemplary embodiment, the method further comprises:
respectively acquiring layout attribute information of the target list in the folded state and the unfolded state; the layout attribute information represents position information and display attributes of all list items in the target list, and the display attributes comprise visible attributes and invisible attributes;
and calling a transitional animation execution interface function, determining difference information between the layout attribute information in the folded state and the layout attribute information in the unfolded state, and generating the preset first animation display effect or the preset second animation display effect according to the difference information.
In one exemplary embodiment, the target list is a list view based on system list components.
According to a second aspect of the embodiments of the present disclosure, there is provided a list presentation apparatus including:
a display unit configured to perform displaying a target list in a folded state; the target list in the folded state displays M target list items;
a display list item determination unit configured to execute, in response to an expansion instruction for the target list in the collapsed state, determining N target list items displayed by the target list in the expanded state, where N is greater than M;
a first spacing determination unit configured to perform determining a first spacing between the N target list items;
the unfolding unit is configured to unfold and display the folded target list based on a first distance between the N target list items;
and at least one list item of the N target list items presents the expansion process with a preset first animation display effect.
In an exemplary embodiment, the first interval is different from a second interval between the M target list items displayed in the folded state.
In an exemplary embodiment, the first pitch determining unit includes:
a region parameter determination unit configured to perform determining a region parameter of a display region in which the target list is displayed;
a first space determining subunit, configured to perform determining a first space between the N target list items based on the region parameter and the number N of the target list items displayed in the expanded state;
wherein the region parameters include at least one of: the size and location of the display area.
In an exemplary embodiment, the expanding unit is further configured to determine a target position during the expanding, and display the N target list items in the target list in the display area according to the first distance with the target position as a reference.
In an exemplary embodiment, the target position is any one of: the position of any list item of the first M-1 target list items in the M target list items; or a preset position in the display area.
In an exemplary embodiment, when the region parameter includes a size of the display region, the first pitch determination subunit includes:
a candidate pitch determination unit configured to perform determination of a candidate pitch based on the size of the display area and the number N;
a first determining unit configured to perform a determination of a first distance between the N target list items based on a comparison result of the candidate distance with a preset threshold.
In an exemplary embodiment, the apparatus further comprises:
a moving unit configured to execute moving the N target list items in response to a moving instruction of the target list in the expanded state.
In an exemplary embodiment, the apparatus further comprises:
a second space determining unit configured to execute a second space between the M target list items in response to a folding instruction for the target list in the unfolded state;
a folding unit configured to perform displaying the target list in a folded state based on a second interval between the M target list items; and at least one list item of the N target list items presents the folding process with a preset second animation display effect.
In an exemplary embodiment, the apparatus further comprises:
a layout attribute information acquisition unit configured to perform acquisition of layout attribute information of the target list in the collapsed state and the expanded state, respectively; the layout attribute information represents position information and display attributes of all list items in the target list, and the display attributes comprise visible attributes and invisible attributes;
and the animation effect generation unit is configured to execute a calling transition animation execution interface function, determine difference information between the layout attribute information in the folded state and the layout attribute information in the unfolded state, and generate the preset first animation display effect or the preset second animation display effect according to the difference information.
In one exemplary embodiment, the target list is a list view based on system list components.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the list presentation method of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions of the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the list presentation method of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the list presentation method of the first aspect described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method comprises the steps of responding to an expansion instruction of a target list in a folding state, determining a first interval between N target list items displayed by the target list in the expansion state, expanding and displaying the target list in the folding state based on the first interval, and displaying at least one list item in the N target list items with a preset first animation effect in the expansion process, so that the expansion process of the list is presented in a preset animation mode, the interactivity of the expansion process of the list and the flexible diversity of the layout of the list are enhanced, and the smooth expansion process of the list is realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a diagram of an application environment illustrating a method of list presentation in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a list presentation method in accordance with an exemplary embodiment;
FIG. 3 is a diagram illustrating a layout of a list of targets in a collapsed state, according to an illustrative embodiment;
FIG. 4 is a schematic illustration of a target list being expanded from a collapsed state to an expanded state, according to an exemplary embodiment;
FIG. 5 is a flow diagram illustrating another list presentation method in accordance with an illustrative embodiment;
FIG. 6 is a block diagram illustrating a list presentation apparatus according to an exemplary embodiment;
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Referring to fig. 1, a schematic diagram of an application environment of a list presentation method according to an exemplary embodiment is shown, where the application environment may include a terminal 110 and a server 120, and the terminal 110 and the server 120 may be connected through a wired network or a wireless network.
The terminal 110 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like. The terminal 110 may have client software such as an Application (App) installed therein, and the Application may be a stand-alone Application or a sub-program in the Application. Illustratively, the application may be a news-type application, a live-type application, or a video-type application, among others. The user of the terminal 110 may log into the application through pre-registered user information, which may include an account number and a password.
The server 120 may be a server that provides a background service for an application in the terminal 110, may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform.
Fig. 2 is a flowchart illustrating a list presentation method according to an exemplary embodiment, and as shown in fig. 2, taking the list presentation method as an example for the terminal in fig. 1, the method includes the following steps:
in step S201, a list of targets in a collapsed state is displayed.
The target list in the folded state displays M target list items, and it can be understood that M is smaller than the total number of list items in the target list in the unfolded state.
The target list may be a function list matched with the currently browsed client interface, and in an exemplary embodiment, the currently browsed client interface may be a video processing interface, and the target list may be a list for implementing a video processing function, and specifically, the target list may include a plurality of list items, each of which displays different function contents, for example, the function contents may include cutting, beautifying, text adding, background blurring, and the like. In an exemplary embodiment, the currently browsed client interface may also be a video shooting interface, and the target list may be a list for implementing a video shooting function, and specifically, the functional content of the plurality of list items in the target list may include taking a picture, recording a video, beautifying, turning over, music, special effects, and the like. The set position of the target list in the client interface may not be limited, and the target list may be transversely arranged along the client interface, may be longitudinally arranged along the client interface, or may be a combination of transverse arrangement and longitudinal arrangement.
In the embodiment of the present disclosure, the display states of the target list may include a folded state and an unfolded state, where a partial list item (i.e., M target list items) of the target list is displayed in the folded state, and the number of list items displayed in the unfolded state is greater than the number of list items displayed in the folded state.
In an exemplary embodiment, the M target list items displayed in the folded state may be list items of high-quality functions, or list items corresponding to frequently-used functions determined according to user personalized use behaviors, and a specific numerical value of M may be dynamically adjusted according to an actual situation.
In an exemplary embodiment, a second distance exists between M target list items displayed in the target list in the folded state, where the second distance may be a preset distance or a calculated distance calculated according to the area parameter of the display area for displaying the target list and the number M, and the calculated distance may be obtained based on a ratio of the length of the display area to the number M, taking the target list displayed in the horizontal direction of the screen as an example.
In an exemplary embodiment, the target list may be a list view based on a system list component, for example, the system list component may be a recycleview, which is a component provided by an Android (Android) system for large data presentation and view multiplexing, and a flexible (extensible) is a feature of the recycleview, which can implement functions of a horizontal scrolling list view, a horizontal scrolling GridView, a waterfall flow control, and the like.
In step S203, in response to an expansion instruction for the target list in the collapsed state, N target list items displayed by the target list in the expanded state are determined, where N is greater than M.
In an exemplary embodiment, an mth list item of the M target list items displayed in the collapsed state may be used to implement triggering of the expansion instruction, and an expansion instruction for expanding the target list in the collapsed state to enter the expanded state may be generated when the mth list item receives a preset triggering event, so that the terminal may determine, in response to the expansion instruction, N target list items displayed by the target list in the expanded state, where the number N may be, for example, a total number of list items included in the target list. The preset trigger event may include a click event, a touch event, and the like.
In another exemplary embodiment, a target control for implementing the triggering of the unfolding instruction may be included in the client interface, the target control is independent of the target list, the target control may be superimposed on the folded list item when the target list is displayed in the folded state, and the unfolding instruction for unfolding the target list in the folded state to enter the unfolded state may be generated when the target control receives a preset triggering event.
In step S205, a first distance between the N target list items is determined.
In an exemplary embodiment, a first distance between the N target list items is different from a second distance between the M target list items displayed in the folded state, so that a completely different list layout is displayed before and after the target list is expanded, which enhances the interactivity of the list expansion and improves the utilization rate of the screen space.
To implement dynamic variation of the list layout with the number of displayed list items, in an exemplary embodiment, the determining the first spacing between the N target list items may include:
determining a region parameter of a display region displaying the target list; wherein the region parameter includes at least one of: the size and location of the display area;
and determining a first interval between the N target list items based on the area parameter and the number N of the target list items displayed in the expanded state.
In an exemplary embodiment, the region parameter may include a size of a display region, and the determining a first distance between the N target list items based on the region parameter and the number N of the target list items displayed in the expanded state may include:
determining a candidate spacing based on the size of the display area and the number N;
and determining a first interval between the N target list items based on the comparison result of the candidate interval and a preset threshold.
Wherein the size of the display area is the length of the target list in the expansion direction on the screen. The preset threshold value can be set according to the requirements in practical application, and generally the smaller the preset threshold value is, the more closely the arrangement among the target list items displayed in the display area is; on the contrary, the larger the preset threshold is, the sparser the arrangement of the target list items displayed in the display area is.
In a specific embodiment, a ratio of the size of the display area to the number N may be calculated, and the ratio is used as a candidate distance, and when the candidate distance exceeds a preset threshold, the candidate distance may be determined as a first distance between N target list items, and when the candidate distance does not exceed the preset threshold, the preset threshold may be determined as a first distance between N target list items.
According to the embodiment of the disclosure, the first distance between the N target list items is determined based on the comparison result of the candidate distance and the preset threshold, so that the adverse effect on the operation caused by the undersize distance between the N target list items displayed in the display area can be avoided.
In practical applications, the area parameter of the display area for displaying the target list may be considered by the size of the screen, or may exceed the size of the screen. And under the condition that the area parameter of the display area exceeds the size of the screen, allowing the N target list items in the expanded target list to move, so that the target list items outside the screen in the display area can enter the visible area of the screen for the user to use, and improving the flexibility of list layout. Based on this, in an exemplary embodiment, the method may further include: and moving the N target list items in response to a moving instruction of the target list in the expanded state.
In step S207, the target list in the collapsed state is expanded and displayed based on the first distance between the N target list items.
And at least one list item of the N target list items presents the expansion process with a preset first animation display effect. Specifically, the preset first animation display effect may include an animation display effect corresponding to a change in position of each list item and an animation display effect corresponding to a change in visibility of each list item, and in specific implementation, the preset first animation display effect may be set according to actual needs, for example, the preset first animation display effect may include a panning animation effect, a fade-out animation effect, and the like.
In an exemplary embodiment, when the target list in the folded state is unfolded and displayed, a target position may be further determined, and the N target list items in the target list are displayed in the display area according to the first distance with the target position as a reference, so as to enhance interactivity and smoothness of a list unfolding process.
In an exemplary embodiment, the mth list item of the M target list items displayed in the folded state may be used to implement triggering of the expansion instruction, and the target position may be a position of any one list item of the first M-1 target list items of the M target list items displayed in the folded state; in another exemplary embodiment, the target position may be a preset position in the display area, and the preset position may be set according to actual needs, for example, may be set to a position of the display area near the edge of the screen. By setting different target positions, the target list can be expanded by different references, so that the interactivity of the list expansion process and the flexibility of the change of the list layout are further enhanced.
The method and the device for expanding the list of the target list in the folding state have the advantages that the first interval between the N target list items displayed by the target list in the unfolding state is determined by responding to the unfolding instruction of the target list in the folding state, the target list in the folding state is unfolded and displayed based on the first interval, and at least one list item in the N target list items is displayed in a preset first animation display effect in the unfolding process, so that the unfolding process of the list is presented in a preset animation mode, the interactivity of the list unfolding process and the flexible diversity of the list layout are enhanced, and the smooth list unfolding process is realized.
In addition, when the target list is a list view based on a system list component (such as RecyclerView), the embodiment of the disclosure can realize flexible configuration of the number of expanded list items while realizing list expansion action, and has strong expansibility, thereby further improving flexible diversity of list layout.
In an exemplary embodiment, the animation effect during the unfolding process may be presented through the formation of a transition animation, and in order to improve the performance and performance of the animation effect during the unfolding process and avoid refreshing the list during the animation process, the method may further include:
respectively acquiring layout attribute information of the target list in the folded state and the unfolded state;
and calling a transitional animation execution interface function, determining difference information between the layout attribute information in the folded state and the layout attribute information in the unfolded state, and generating a preset first animation display effect according to the difference information.
The layout attribute information represents position information and display attributes of all list items in the target list, and the display attributes comprise visible attributes and invisible attributes. It can be understood that the layout attribute information in the folded state represents the position information and the display attribute of each list item in the target list in the folded state; the layout attribute information in the expanded state represents the position information and the display attribute of each list item in the target list in the expanded state. In a specific implementation, the layout attribute information may be determined according to a distance and a display attribute between each list item in the corresponding display state.
For a target list in a folded state, including M displayed target list items and a list item hidden by folding, assuming that N target list items in the target list are displayed in an unfolded state, the list item hidden by folding is N-M list items. A second distance is reserved between the displayed M target list items, and the M target list items are visible attributes; and a third distance is formed between the N-M folded and hidden list items, the third distance is a negative value of the length of the list items in the unfolding direction of the target list, taking the target list transversely unfolded along the screen as an example, the third distance is-W (W is the width of the list items), and the N-M folded and hidden list items are invisible attributes.
It should be noted that the spacing between the list items is positive when they are separated, 0 when they are attached, negative when they are overlapped, and negative when they are completely overlapped.
In practical applications, when calculating the second distance between the M target list items displayed in the folded state based on the number M, the second distance needs to be considered in combination with the implementation form of the object for triggering the unfolding instruction.
When the object for triggering the expansion instruction is an mth target list item in the M target list items, the second distance may be a ratio of the size of the display area to the number M, and at this time, the distance between the mth target list item and the first list item in the folded N-M list items is set to-W, so that the mth target list item and the folded N-M list items may coincide.
When the object for triggering the expansion instruction is a target control independent of the target list, the second distance may be a ratio of the size of the display area to the number (M +1), at this time, the distance between the mth target list item and the first list item in the N-M folded list items is set to the second distance, and the target control is overlapped on the N-M folded list items. Fig. 3 is a schematic diagram of a layout of a target list in a folded state, where a target control is independent of the target list and may overlap with a position of a folded list item.
For the target list in the expanded state, the distance between all list items is the first distance and is a visible attribute.
Fig. 4 is a schematic diagram illustrating a target list unfolded from a folded state to an unfolded state according to an embodiment of the present disclosure, wherein 5 target list items are displayed in the folded state of the target list, and a 5 th list item of the 5 target list items indicates that an unfolded "→" can be used to implement a trigger of an unfolding instruction in the folded state, and the unfolding instruction of the target list in the folded state can be triggered by triggering, for example, clicking, the 5 th list item "→", so that all list items in the target list can be presented through an animation display effect shown in fig. 4.
In a specific implementation, after triggering a "→" list item indicating expansion, a first distance may be determined by calculation, and based on the first distance and a display attribute, layout attribute information in an expansion state may be generated, the layout attribute information may be set in a list component, a system interface Transition manager. It will be appreciated that other types of parameters may also be passed in when the system interface transitionmanager. beginndelayedtransition is invoked to generate different types of animation effects.
In another possible implementation, when the object used for triggering the expansion instruction is a target control independent of the target list, an animation for hiding the target control, such as a fade-out animation, may be added to the target control, and when the animation ends, the target control is deleted.
According to the embodiment of the invention, animation parameter calculation is simplified into the calculation of the layout attribute information, so that the complexity and the calculation amount of animation process calculation are greatly reduced, list refreshing is not triggered in the animation process, the stability is good, and the expression and the performance of animation effects in the unfolding process are improved.
In an exemplary embodiment, as shown in the flowchart of another list displaying method provided in fig. 5, after displaying the target list displaying the folded state, the method may further include:
in step S209, in response to a collapse instruction for the target list in the expanded state, a second distance between the M target list items is determined.
The second distance may be a preset distance, or may be determined according to a ratio of the area parameter of the display area to the number M, for example, the ratio of the size of the display area to the number M may be directly used as the second distance.
Under the scene that the target list items need to be unfolded and then folded, the Mth target list item in the M target list items can be set to be an unfolding instruction and a folding instruction based on the preset event triggering, and the Mth target list item is always visible in the unfolding state and the folding state of the target list.
In step S211, the target list in the collapsed state is displayed based on a second distance between the M target list items.
And at least one list item of the N target list items presents the folding process with a preset second animation display effect. Specifically, the preset second animation display effect may include an animation display effect corresponding to the position change of each list item and an animation display effect corresponding to the visibility change of each list item, and in the specific implementation, the preset second animation display effect may be set according to actual needs, for example, the preset second animation display effect may include a translation animation effect, a fade-out animation effect, and the like, and may be the same as or different from the preset first animation display effect.
According to the embodiment of the invention, the folding process of switching the list from the unfolding state to the folding state is presented by the preset second animation display effect, so that the interactivity of the list presentation state switching process and the flexible diversity of the list layout are further enhanced, and smooth list folding is realized.
In an exemplary embodiment, the layout attribute information of the target list in the folded state may be generated based on the second space between the M target list items, the third space for implementing folding of the remaining N-M list items, and the display attribute of each list item; and then calling a transitional animation execution interface function, determining difference information between the layout attribute information in the folded state and the layout attribute information in the unfolded state, and generating a preset second animation display effect according to the difference information, wherein the specific implementation process can refer to the above-mentioned description of the preset first animation display effect, and is not repeated herein.
In the process of realizing the folding dynamic effect of the expanded target list, the animation parameter calculation is simplified into the calculation of the layout attribute information, so that the complexity and the calculation amount of the animation process calculation are greatly reduced, the refreshing of the list in the animation process is avoided while the folding dynamic effect of the target list is realized, and the expression and the performance of the animation effect in the list folding process are improved.
FIG. 6 illustrates a block diagram of a list presentation apparatus, according to an exemplary embodiment. Referring to fig. 6, the list presentation apparatus 600 includes a display unit 610, a display list item determination unit 620, a first space determination unit 630, and an expansion unit 640, wherein:
a display unit 610 configured to perform displaying a target list in a folded state; the target list in the folded state displays M target list items;
a display list item determination unit 620 configured to execute, in response to an expansion instruction for the target list in the collapsed state, determining N target list items displayed by the target list in the expanded state, where N is greater than M;
a first space determining unit 630 configured to perform determining a first space between the N target list items;
an expanding unit 640 configured to perform expanding and displaying the target list in the folded state based on a first distance between the N target list items;
and at least one list item of the N target list items presents the expansion process with a preset first animation display effect.
In an exemplary embodiment, the first interval is different from a second interval between the M target list items displayed in the folded state.
In an exemplary embodiment, the first pitch determining unit includes:
a region parameter determination unit configured to perform determining a region parameter of a display region in which the target list is displayed;
a first space determining subunit, configured to perform determining a first space between the N target list items based on the region parameter and the number N of the target list items displayed in the expanded state;
wherein the region parameters include at least one of: the size and location of the display area.
In an exemplary embodiment, the expanding unit is further configured to determine a target position during the expanding, and display the N target list items in the target list in the display area according to the first distance with the target position as a reference.
In an exemplary embodiment, the target position is any one of: the position of any list item of the first M-1 target list items in the M target list items; or a preset position in the display area.
In an exemplary embodiment, when the region parameter includes a size of the display region, the first pitch determination subunit includes:
a candidate pitch determination unit configured to perform determination of a candidate pitch based on the size of the display area and the number N;
a first determining unit configured to perform a determination of a first distance between the N target list items based on a comparison result of the candidate distance with a preset threshold.
In an exemplary embodiment, the apparatus further comprises:
a moving unit configured to execute moving the N target list items in response to a moving instruction of the target list in the expanded state.
In an exemplary embodiment, the apparatus further comprises:
a second space determining unit configured to execute a second space between the M target list items in response to a folding instruction for the target list in the unfolded state;
a folding unit configured to perform displaying the target list in a folded state based on a second interval between the M target list items; and at least one list item of the N target list items presents the folding process with a preset second animation display effect.
In an exemplary embodiment, the apparatus further comprises:
a layout attribute information acquisition unit configured to perform acquisition of layout attribute information of the target list in the collapsed state and the expanded state, respectively; the layout attribute information represents position information and display attributes of all list items in the target list, and the display attributes comprise visible attributes and invisible attributes;
and the animation effect generation unit is configured to execute a calling transition animation execution interface function, determine difference information between the layout attribute information in the folded state and the layout attribute information in the unfolded state, and generate the preset first animation display effect or the preset second animation display effect according to the difference information.
In one exemplary embodiment, the target list is a list view based on system list components.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In one exemplary embodiment, there is also provided an electronic device, comprising a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement any one of the list presentation methods provided in the embodiments of the present disclosure when executing the instructions stored in the memory.
The electronic device may be a terminal, a server or a similar computing device, taking the electronic device as a terminal as an example, fig. 7 is a block diagram of an electronic device for list presentation according to an exemplary embodiment, specifically:
the terminal may include RF (Radio Frequency) circuitry 710, memory 720 including one or more computer-readable storage media, input unit 730, display unit 740, sensor 750, audio circuitry 760, WiFi (wireless fidelity) module 770, processor 780 including one or more processing cores, and power supply 790. Those skilled in the art will appreciate that the terminal structure shown in fig. 7 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
RF circuit 710 may be used for receiving and transmitting signals during a message transmission or call, and in particular, for receiving downlink information from a base station and processing the received downlink information by one or more processors 780; in addition, data relating to uplink is transmitted to the base station. In general, RF circuit 710 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuit 710 may also communicate with a network and other terminals through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), and the like.
The memory 720 may be used to store software programs and modules, and the processor 780 performs various functional applications and data processing by operating the software programs and modules stored in the memory 720. The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, and the like; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 720 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 720 may also include a memory controller to provide access to memory 720 by processor 780 and input unit 730.
The input unit 730 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 730 may include a touch-sensitive surface 731 as well as other input devices 732. Touch-sensitive surface 731, also referred to as a touch display screen or touch pad, can collect touch operations by a user on or near touch-sensitive surface 731 (e.g., operations by a user on or near touch-sensitive surface 731 using a finger, stylus, or any other suitable object or attachment) and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 731 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 780, and can receive and execute commands from the processor 780. In addition, the touch-sensitive surface 731 can be implemented in a variety of types, including resistive, capacitive, infrared, and surface acoustic wave. The input unit 730 may also include other input devices 732 in addition to the touch-sensitive surface 731. In particular, other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 740 may be used to display information input by or provided to the user and various graphic user interfaces of the terminal, which may be configured by graphics, text, icons, video, and any combination thereof. The Display unit 740 may include a Display panel 741, and optionally, the Display panel 741 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, touch-sensitive surface 731 can overlay display panel 741, such that when touch-sensitive surface 731 detects a touch event thereon or nearby, processor 780 can determine the type of touch event, and processor 780 can then provide a corresponding visual output on display panel 741 based on the type of touch event. Where the touch-sensitive surface 731 and the display panel 741 may be implemented as two separate components, input and output functions, but in some embodiments the touch-sensitive surface 731 and the display panel 741 may be integrated to implement input and output functions.
The terminal may also include at least one sensor 750, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 741 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 741 and/or a backlight when the terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the terminal is stationary, and can be used for applications of recognizing terminal gestures (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal, detailed description is omitted here.
Audio circuitry 760, speaker 761, and microphone 762 may provide an audio interface between a user and the terminal. The audio circuit 760 can transmit the electrical signal converted from the received audio data to the speaker 761, and the electrical signal is converted into a sound signal by the speaker 761 and output; on the other hand, the microphone 762 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 760, processes the audio data by the audio data output processor 780, and transmits the processed audio data to, for example, another terminal via the RF circuit 710, or outputs the audio data to the memory 720 for further processing. The audio circuitry 760 may also include an earbud jack to provide communication of peripheral headphones with the terminal.
WiFi belongs to short distance wireless transmission technology, the terminal can help user send and receive e-mail, browse web page and access stream media etc. through WiFi module 770, it provides wireless broadband internet access for user. Although fig. 7 shows the WiFi module 770, it is understood that it does not belong to the essential constitution of the terminal, and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 780 is a control center of the terminal, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 720 and calling data stored in the memory 720, thereby integrally monitoring the terminal. Optionally, processor 780 may include one or more processing cores; preferably, the processor 780 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 780.
The terminal also includes a power supply 790 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 780 via a power management system to manage charging, discharging, and power consumption management functions via the power management system. The power supply 790 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, and the like, which are not described herein again. In this embodiment, the terminal further includes a memory and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs include instructions for performing the list presentation methods provided by the method embodiments described above.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 720 comprising instructions, executable by the processor 780 of the apparatus 700 to perform the above list presentation method is also provided. Alternatively, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which includes a computer program that, when being executed by a processor, implements any one of the list presentation methods provided in the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种语音控制的分屏显示方法及电子设备