Method, device, storage medium and program product for displaying loading animation effect

By controlling the display duration of loading animations, the problem of loading animations affecting user operations in existing technologies has been solved, achieving a more intelligent and user-friendly loading animation display and improving the user experience.

CN114020428BActive Publication Date: 2025-11-07BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111282324.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-01
Publication Date
2025-11-07
Estimated Expiration
2041-11-01

AI Technical Summary

Technical Problem

The existing loading animation display method affects subsequent user operations, resulting in a poor user experience.

Method used

Control the display duration of loading animations during the loading process, set the maximum and minimum display durations, and stop or continue displaying loading animations under specific conditions.

Benefits of technology

It avoids the operational inconvenience caused by displaying loading animations for extended periods, resolves the issue of loading animations flashing during interface timeouts or rapid return, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020428B_ABST
    Figure CN114020428B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, storage medium and program product for displaying a loading animation. The method for displaying a loading animation comprises: in the case that a loading animation is not currently displayed, when at least one loading request is initiated, displaying a loading animation and starting timing of a display duration of the loading animation; when the display duration has reached a preset maximum display duration and loading for the at least one loading request is not completed, stopping displaying the loading animation and ending the timing of the display duration. According to the present disclosure, the user will not be more troubled because the loading animation is displayed for a long time and cannot be operated, and the situation that the loading animation always exists when an interface timeout occurs is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of electronics in general, and more specifically, to a method, apparatus, storage medium and program product for displaying loading animation. BACKGROUND

[0002] Many loading requests involve the display of loading animation, however, the existing way of displaying loading animation often affects the subsequent operation of the user, causing inconvenience to the user. Therefore, a loading animation display method that can facilitate the subsequent operation of the user is needed. SUMMARY

[0003] An exemplary embodiment of the present disclosure provides a method, apparatus, storage medium and program product for displaying loading animation to at least solve the problems in the related art.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for displaying loading animation is provided, comprising: in the case where no loading animation is currently displayed, when at least one loading request is initiated, displaying a loading animation and starting timing a display duration of the loading animation; when the display duration has reached a preset maximum display duration and loading has not been completed for the at least one loading request, stopping displaying the loading animation and ending the timing of the display duration.

[0005] Optionally, the method further comprises: when loading has been completed for the at least one loading request, if no loading is being performed for any other loading request and the display duration has not reached the preset maximum display duration, ending the timing of the display duration and continuing to display the loading animation for a preset minimum display duration.

[0006] Optionally, the method further comprises: in the case where a loading animation is currently displayed, when at least one loading request is initiated, sharing the loading animation being displayed.

[0007] Optionally, in the case where a loading animation is currently displayed, when at least one loading request is initiated, the step of sharing the loading animation being displayed comprises: in the case where a loading animation is currently displayed and no loading is being performed for any loading request, when at least one loading request is initiated, sharing the loading animation being displayed and restarting the timing of the display duration of the loading animation; when loading has been completed for all loading requests and the display duration has not reached the preset maximum display duration, ending the timing of the display duration and continuing to display the loading animation for a preset minimum display duration; when the display duration has reached the preset maximum display duration and loading has not been completed for the at least one loading request, stopping displaying the loading animation and ending the timing of the display duration.

[0008] Optionally, in the case that the loading animation is currently being displayed, when the at least one loading request is initiated, the step of sharing the loading animation being displayed comprises: in the case that the loading animation is currently being displayed and loading is being performed for any one of the loading requests, when the at least one loading request is initiated, the loading animation being displayed is shared, and the display duration is continued to be counted; when loading has been completed for all the loading requests and the display duration has not reached the preset maximum display duration, the counting of the display duration is ended, and the loading animation is continued to be displayed for the preset minimum display duration; when the display duration has reached the preset maximum display duration and loading has not been completed for any one of the loading requests, the display of the loading animation is stopped, and the counting of the display duration is ended.

[0009] Optionally, the at least one loading request comprises a request for calling an interface to load an object.

[0010] Optionally, the method is implemented by calling a preset loading animation start function when each loading request is initiated, and calling a preset loading animation end function when loading has been completed for the loading request; wherein the loading animation start function is used to start a timer, record the number of loading requests, and trigger the display of a loading animation when the loading request is initiated for the first time; the loading animation end function is used to update the number of loading requests, and end the timer when the updated number of loading requests is a preset number; wherein when the counting of the start timer reaches the preset maximum display duration or the counting of the end timer reaches the preset minimum display duration, a reset function is called; wherein the reset function is used to reset the number of loading requests to the preset number and trigger the stop of the display of the loading animation.

[0011] According to a second aspect of the embodiments of the present disclosure, a device for displaying a loading animation is provided, comprising:

[0012] a display unit configured to display a loading animation;

[0013] a processor configured to perform the following operations: in the case that the loading animation is not currently being displayed, when the at least one loading request is initiated, the display unit is controlled to display the loading animation, and the display duration of the loading animation is started to be counted; when the display duration has reached a preset maximum display duration and loading has not been completed for the at least one loading request, the display unit is controlled to stop displaying the loading animation, and the counting of the display duration is ended.

[0014] Optionally, the processor is further configured to perform the following operation: when the loading for the at least one loading request has been completed, if no loading is being performed for any other loading request and the display duration has not reached the preset maximum display duration, ending the counting of the display duration, and controlling the display unit to continue displaying the loading animation for a preset minimum display duration.

[0015] Optionally, the processor is further configured to perform the following operation: when at least one loading request is initiated, sharing the loading animation being displayed, in a case that the loading animation is being displayed.

[0016] Optionally, the processor is configured to perform the following operation: when at least one loading request is initiated, sharing the loading animation being displayed, and restarting the counting of the display duration of the loading animation, in a case that the loading animation is being displayed and no loading is being performed for any loading request; when the loading for all loading requests has been completed and the display duration has not reached the preset maximum display duration, ending the counting of the display duration, and controlling the display unit to continue displaying the loading animation for a preset minimum display duration; when the display duration has reached the preset maximum display duration and the loading for the at least one loading request has not been completed, controlling the display unit to stop displaying the loading animation, and ending the counting of the display duration.

[0017] Optionally, the processor is configured to perform the following operation: when at least one loading request is initiated, sharing the loading animation being displayed, and continuing the counting of the display duration, in a case that the loading animation is being displayed and loading is being performed for any loading request; when the loading for all loading requests has been completed and the display duration has not reached the preset maximum display duration, ending the counting of the display duration, and controlling the display unit to continue displaying the loading animation for a preset minimum display duration; when the display duration has reached the preset maximum display duration and the loading for any loading request has not been completed, controlling the display unit to stop displaying the loading animation, and ending the counting of the display duration.

[0018] Optionally, the at least one loading request comprises a request of calling an interface to load an object.

[0019] Optionally, the processor performs the operation by invoking a preset loading animation start function when initiating each loading request, and invoking a preset loading animation end function when loading for the loading request has been completed; wherein the loading animation start function is configured to start a timer, record the number of loading requests and trigger display of a loading animation when the loading request is initiated for the first time; the loading animation end function is configured to update the number of loading requests, and stop the timer when the updated number of loading requests is a preset number; wherein a reset function is invoked when the start timer counts up to the preset maximum display duration or the end timer counts up to the preset minimum display duration; wherein the reset function is configured to reset the number of loading requests to the preset number and trigger stopping display of the loading animation.

[0020] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor; at least one memory storing computer executable instructions, wherein the computer executable instructions, when executed by the at least one processor, cause the at least one processor to perform the method for displaying a loading animation as described above.

[0021] According to a fourth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, when instructions in the computer readable storage medium are executed by at least one processor, cause the at least one processor to perform the method for displaying a loading animation as described above.

[0022] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, comprising computer instructions, when executed by at least one processor, implement the method for displaying a loading animation as described above.

[0023] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects: the longest loading animation display duration is controlled, so that the user will not be more troubled because of being unable to operate due to long-time display of the loading animation, the situation that the loading animation always exists when the interface timeout is encountered is solved, and the user experience is improved.

[0024] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0025] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure, and do not constitute an improper limitation on the present disclosure.

[0026] Figure 1 A flowchart of a method for displaying a loading animation according to an exemplary embodiment of the present disclosure is shown;

[0027] Figure 2 A flowchart showing a method of displaying a loading animation according to an example embodiment of the present disclosure is shown.

[0028] Figure 3 A flowchart showing a method of displaying a loading animation according to an example embodiment of the present disclosure is shown.

[0029] Figure 4 A structural block diagram of an apparatus for displaying a loading animation according to an example embodiment of the present disclosure is shown.

[0030] Figure 5 A structural block diagram of an electronic device according to an example embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0031] In order for those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings.

[0032] It should be noted that the terms "first", "second", and the like in the specification and claims of the present disclosure and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation described in the following example embodiments does not represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0033] It should be noted here that "at least one of a plurality of items" appearing in the present disclosure represents three types of alternatives, including "any one of the plurality of items", "a combination of any multiple of the plurality of items", and "all of the plurality of items". For example, "including at least one of A and B" includes the following three alternatives: (1) including A; (2) including B; (3) including A and B. For another example, "performing at least one of step one and step two" represents the following three alternatives: (1) performing step one; (2) performing step two; (3) performing step one and step two.

[0034] Figure 1 A flowchart showing a method of displaying a loading animation according to an example embodiment of the present disclosure is shown.

[0035] Referring to Figure 1 In step S101, when at least one loading request is initiated, a loading animation is displayed and the display duration of the loading animation is started to be counted when the current loading animation is not displayed.

[0036] As an example, a loading animation is used to prompt that a user is in the process of loading.

[0037] It should be understood that the at least one loading request can be various types of loading requests, and the present disclosure does not limit this. For example, the at least one loading request can include a request for calling an interface to load an object.

[0038] It should be understood that the at least one loading request is a request that requires a loading animation to be displayed when loading for it. Whether a loading animation needs to be displayed when loading for a loading request can be determined by an engineer according to actual conditions and needs.

[0039] It should be understood that when multiple loading requests are initiated at the same time, the multiple loading requests can share one loading animation, and there is no need to display a loading animation corresponding to each loading request separately.

[0040] In step S102, when the display duration timer has reached the preset maximum display duration and the loading for the at least one loading request is not completed, the display of the loading animation is stopped, and the counting of the display duration is ended.

[0041] Here, the loading for the at least one loading request not being completed can be understood as: if the loading for each of the at least one loading request is not completed, it is considered that the loading for the at least one loading request is not completed.

[0042] As an example, the loading for the loading request not being completed can be understood as: all of the objects requested by the loading request are not returned.

[0043] It should be understood that the preset maximum display duration can be set according to actual conditions and needs, and the present disclosure does not limit this. For example, the preset maximum display duration can be set to 3000 ms.

[0044] It should be understood that when the loading for the at least one loading request is not completed but the display duration timer has reached the preset maximum display duration, only the display of the loading animation is stopped, and the background is still loading for the objects whose loading is not completed.

[0045] As an example, the counting of the display duration of the loading animation can start from 0 or count down from the preset maximum display duration, and the present disclosure does not limit this.

[0046] It should be understood that the ending of the counting of the display duration can be understood as: the counting of the display duration is cleared, and the counting is restarted when the next counting starts.

[0047] According to this exemplary embodiment of the present disclosure, in the case that the longest loading effect display duration is controlled, the user will not be more troubled by the long-time display of the loading effect and the inability to operate, the case that the loading effect is displayed all the time when the interface timeout occurs is solved, and the user experience is improved.

[0048] In addition, as an example, the method for displaying a loading effect according to the exemplary embodiment of the present disclosure can further include: when the loading for the at least one loading request has been completed, if no loading is being performed for any other loading request and the display duration timer has not reached the preset longest display duration, ending the display duration timer, and continuing to display the loading effect for a preset minimum display duration.

[0049] It should be understood that the loading for the at least one loading request has been completed, that is, the loading for each of the at least one loading request has been completed. No loading is being performed for any other loading request, that is, the loading request for which the loading effect needs to be displayed has been completed at present.

[0050] It should be understood that the preset minimum display duration can be set according to actual conditions and needs, and the present disclosure does not limit this. For example, the preset minimum display duration can be set to 300 ms.

[0051] According to this exemplary embodiment of the present disclosure, even if the time period from the initiation of the loading request to the end of the loading request is very short, a minimum display duration is reserved for the loading effect of the loading request to avoid the flashing effect of the loading effect, and the extension of the display duration of the loading effect facilitates the sharing of a loading effect by multiple loading requests and facilitates more intelligent control.

[0052] In addition, as an example, the method for displaying a loading effect according to the exemplary embodiment of the present disclosure can further include: in the case that the loading effect is currently being displayed, when at least one loading request is initiated, sharing the loading effect being displayed without displaying another loading effect corresponding to the at least one loading request.

[0053] Below, exemplary embodiments of the method for sharing the loading effect being displayed when at least one loading request is initiated will be described in conjunction with Figure 2 and Figure 3 .

[0054] Figure 2 A flowchart of the method for displaying a loading effect according to the exemplary embodiment of the present disclosure is shown.

[0055] As Figure 2As shown, in step S201, when at least one loading request is initiated, the loading animation being displayed is shared, and the display duration of the loading animation is restarted timing, in the case that the loading animation is currently being displayed and no loading is being performed for any loading request.

[0056] As an example, the restarting of the display duration of the loading animation can be understood as starting from the beginning, for example, starting from 0, or counting down from a preset maximum display duration.

[0057] It should be understood that the any loading request is any loading request that requires the display of the loading animation.

[0058] In step S202, when the loading for all loading requests has been completed and the display duration timing has not reached the preset maximum display duration, the display duration timing is ended, and the loading animation is displayed for a preset minimum display duration.

[0059] In step S203, when the display duration timing has reached the preset maximum display duration and the loading for any one loading request has not been completed, the display of the loading animation is stopped, and the display duration timing is ended.

[0060] The loading for any one loading request not being completed can be understood as: the loading for all loading requests (including the at least one loading request involved in step S201) has not been completed, and there is still some loading request or some loading requests being loaded.

[0061] According to this exemplary embodiment of the present disclosure, the user will not be more troubled by being unable to operate for a long time due to the display of the loading animation, and a minimum display duration will also be reserved for the loading animation of the loading request, so as to avoid the flashing effect of the loading animation, solve the problem that the loading animation always exists when the interface timeout condition is encountered, or the flashing effect of the loading animation appears because the interface returns quickly, and improve the user experience.

[0062] Figure 3 A flowchart of a method for displaying a loading animation according to an exemplary embodiment of the present disclosure is shown.

[0063] Referring to Figure 3 In step S301, when at least one loading request is initiated, the loading animation being displayed is shared, and the display duration is continued to be timed, in the case that the loading animation is currently being displayed and the loading is being performed for any one loading request.

[0064] The display duration being continued to be timed can be understood as: continuing the previous timing result and counting down all the time.

[0065] At step S302, when the loading for all loading requests has been completed and the display duration timer has not reached the preset maximum display duration, the display duration timer is ended and the loading animation is continued to be displayed for the preset minimum display duration.

[0066] At step S303, when the display duration timer has reached the preset maximum display duration and the loading for any one loading request has not been completed, the loading animation is stopped from being displayed and the display duration timer is ended.

[0067] According to this exemplary embodiment of the present disclosure, the user will not be more bothered by the inability to operate due to the long-time display of the loading animation, and a minimum display duration is also reserved for the loading animation of the loading request to avoid the flashing of the loading animation, thereby solving the problem of the existence of the loading animation when the interface timeout occurs or the flashing of the loading animation due to the quick return of the interface, and improving the user experience.

[0068] As an example, the method for displaying the loading animation according to the exemplary embodiment of the present disclosure can be implemented by calling a preset loading animation start function when each loading request is initiated and calling a preset loading animation end function when the loading for the loading request has been completed.

[0069] As an example, the loading animation start function can be used to start a timer, record the number of loading requests, and trigger the display of the loading animation when the loading request is initiated for the first time.

[0070] As an example, the loading animation end function can be used to update the number of loading requests and execute an end timer when the updated number of loading requests is a preset number.

[0071] When the start timer timer reaches the preset maximum display duration or the end timer timer reaches the preset minimum display duration, a reset function is called. As an example, the reset function can be used to reset the number of loading requests to the preset number and trigger the stop of the display of the loading animation.

[0072] In one embodiment, the loading animation start function can be called to perform the following processing: when the number of loading requests is 0, a start timer is started; after the start timer is started, the number of loading requests is increased by 1; the state of the loading animation is set to trigger the display of the loading animation; and the end timer is cleared.

[0073] Here, the initial value of the number of loading requests is 0.

[0074] Here, when the start timer timer reaches the preset maximum display duration, the number of loading requests is set to 0 and the state of the loading animation is set to trigger the stop of the display of the loading animation.

[0075] In another embodiment, the loading effect end function can perform the following process when called: decrement the number of loading requests by 1; after decrementing the number of loading requests by 1, when the number of loading requests is 0, clear the start timer and start the end timer.

[0076] Here, when the end timer reaches the preset minimum display duration, the number of loading requests is set to 0, and the state of the loading effect is set to trigger the stop displaying the loading effect.

[0077] As an example, 6 variables can be set, respectively:

[0078] count: the number of loading requests;

[0079] loading: the state of the loading effect, true triggers the display of the loading effect, and false triggers the stop displaying the loading effect;

[0080] maxLoadingTime: the preset maximum display duration;

[0081] minLoadingTime: the preset minimum display duration;

[0082] startTimer: the start timer;

[0083] endTimer: the end timer.

[0084] In one embodiment, the pseudo code of the loading effect start function can be as follows:

[0085]

[0086] As an example, the pseudo code of the reset function can be as follows:

[0087]

[0088] In another embodiment, the pseudo code of the loading effect end function can be as follows:

[0089]

[0090]

[0091] According to an example embodiment of the present disclosure, a more intelligent global loading effect display solution is provided. An engineer only needs to add a loading effect start function before each request requiring a loading effect, and call a loading effect end function when the request ends. No other logic needs to be considered, which facilitates engineers to use loading effects more efficiently to optimize pages after encapsulating methods.

[0092] Figure 4 A structural block diagram of a device for displaying a loading effect according to an example embodiment of the present disclosure is shown.

[0093] As Figure 4 shown, a device 10 for displaying a loading effect according to an example embodiment of the present disclosure includes a display unit 101 and a processor 102.

[0094] In particular, the display unit 101 is configured to display a loading effect.

[0095] The processor 102 is configured to perform the following operations:

[0096] When at least one loading request is initiated, the display unit 101 is controlled to display a loading effect and start timing a display duration of the loading effect, in a case where no loading effect is currently displayed.

[0097] When the display duration has reached a preset maximum display duration and loading for the at least one loading request is not completed, the display unit 101 is controlled to stop displaying the loading effect and end the timing of the display duration.

[0098] As an example, the processor 102 can be further configured to perform the following operations:

[0099] When loading for the at least one loading request is completed, if no loading is being performed for any other loading request and the display duration has not reached the preset maximum display duration, the timing of the display duration is ended and the display unit 101 is controlled to continue displaying the loading effect for a preset minimum display duration.

[0100] As an example, the processor 102 can be further configured to perform the following operation: when at least one loading request is initiated, the currently displayed loading effect is shared, in a case where a loading effect is currently displayed.

[0101] As an example, the processor 102 can be configured to perform the following operations:

[0102] In a case where the loading animation is being displayed and no loading is being performed for any loading request, when at least one loading request is initiated, the loading animation being displayed is shared, and the display duration of the loading animation is restarted to be counted;

[0103] When the loading is completed for all loading requests and the display duration has not reached the preset maximum display duration, the counting of the display duration is ended, and the display unit 101 is controlled to continue displaying the loading animation for a preset minimum display duration;

[0104] When the display duration has reached the preset maximum display duration and the loading is not completed for any loading request, the display unit 101 is controlled to stop displaying the loading animation, and the counting of the display duration is ended.

[0105] As an example, the processor 102 can be configured to perform the following operations:

[0106] In a case where the loading animation is being displayed and loading is being performed for any loading request, when at least one loading request is initiated, the loading animation being displayed is shared, and the counting of the display duration is continued;

[0107] When the loading is completed for all loading requests and the display duration has not reached the preset maximum display duration, the counting of the display duration is ended, and the display unit 101 is controlled to continue displaying the loading animation for a preset minimum display duration;

[0108] When the display duration has reached the preset maximum display duration and the loading is not completed for any loading request, the display unit 101 is controlled to stop displaying the loading animation, and the counting of the display duration is ended.

[0109] As an example, the at least one loading request can include a request to call an interface to load an object.

[0110] As an example, the processor 102 can perform the operations by calling a preset loading animation start function when each loading request is initiated, and calling a preset loading animation end function when the loading is completed for the loading request.

[0111] As an example, the loading animation start function can be used to start a timer, record the number of loading requests, and trigger the display of the loading animation when the loading request is initiated for the first time; and the loading animation end function can be used to update the number of loading requests, and end the timer when the updated number of loading requests is a preset number.

[0112] When the start timer reaches the preset maximum display duration or the end timer reaches the preset minimum display duration, a reset function is called. As an example, the reset function can be used to reset the number of loading requests to the preset number and trigger the stop displaying the loading animation.

[0113] As to the processor 102 in the above embodiments, the specific manner of performing operations has been described in detail in the embodiments of the method, and will not be described in detail here.

[0114] Figure 5 A structural block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown.

[0115] Referring to Figure 5 The electronic device 20 includes at least one memory 201 and at least one processor 202, the at least one memory 201 storing a set of computer executable instructions, when the set of computer executable instructions is executed by the at least one processor 202, performing the method of displaying a loading animation as described in the above exemplary embodiments.

[0116] As an example, the electronic device 20 can be a PC computer, a tablet device, a personal digital assistant, a smart phone, or other devices capable of executing the above instructions. Here, the electronic device 20 is not necessarily a single electronic device, but can also be any collection of devices or circuits capable of executing the above instructions (or instruction sets) alone or jointly. The electronic device 20 can also be part of an integrated control system or system manager, or can be configured as a portable electronic device that interfaces with local or remote (e.g., via wireless transmission) devices.

[0117] In the electronic device 20, the processor 202 can include a central processor (CPU), a graphics processor (GPU), a programmable logic device, a special-purpose processor system, a microcontroller, or a microprocessor. As an example but not limitation, the processor 202 can also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0118] The processor 202 can run instructions or codes stored in the memory 201, where the memory 201 can also store data. Instructions and data can also be sent and received via a network interface device through a network, where the network interface device can use any known transmission protocol.

[0119] The memory 201 can be integrated with the processor 202, e.g., RAM or flash memory disposed within an integrated circuit microprocessor or the like. Further, the memory 201 can include a separate device, such as an external disk drive, memory array, or other storage device usable by any database system. The memory 201 and the processor 202 can be operatively coupled, or can communicate with each other, e.g., through I / O ports, network connections, or the like, such that the processor 202 can read files stored in the memory.

[0120] Further, the electronic device 20 can also include a video display, such as a liquid crystal display, and a user interface, such as a keyboard, mouse, touch input device, or the like. All components of the electronic device 20 can be connected to each other via a bus and / or a network.

[0121] According to exemplary embodiments of the present disclosure, a computer-readable storage medium storing instructions can also be provided, wherein, when the instructions are executed by at least one processor, the at least one processor is caused to perform the method of displaying a loading animation effect as described in the above exemplary embodiments. Examples of the computer-readable storage medium herein include a read-only memory (ROM), a programmable read-only memory (PROM), an electrically programmable read-only memory (EPROM), a random access memory (RAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), a flash memory, a non-volatile memory, a CD-ROM, a CD-R, a CD+R, a CD-RW, a CD+RW, a DVD-ROM, a DVD-R, a DVD+R, a DVD-RW, a DVD+RW, a DVD-RAM, a BD-ROM, a BD-R, a BD-R LTH, a BD-RE, a Blu-ray or optical disc memory, a hard disk drive (HDD), a solid state drive (SSD), a card-type memory such as a multimedia card, a secure digital (SD) card, or an extreme digital (XD) card, a magnetic tape, a floppy disk, a magneto-optical data storage device, an optical data storage device, a hard disk, a solid state disk, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above computer-readable storage medium can be executed in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc., and, in one example, the computer program and any associated data, data files, and data structures are distributed over a networked computer system so that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner by one or more processors or computers.

[0122] According to the exemplary embodiments of the present disclosure, a computer program product can also be provided, in which instructions can be executed by at least one processor to complete the method of displaying loading effects as described in the above exemplary embodiments.

[0123] According to the exemplary embodiments of the present disclosure, the display manner of loading effects makes users perceive data changes, and in the case of controlling the longest loading effect display duration, users will not have more troubles because of the long-time display of loading effects and cannot operate; the problems of always existing loading effects when encountering interface timeout or appearing loading effects flashing because of the fast return of the interface are solved, and the user experience is improved; the idea of the longest and shortest display duration and the addition of humanized customization make the display of loading effects more intelligent, and the short board of loading effects display in the case of interface timeout or too fast return is made up.

[0124] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure following, in general, the principles of the present disclosure and including such departures from the present disclosure that come within known or customary practice within the art to which the present disclosure pertains. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0125] It should be understood that the present disclosure is not limited to the precise structures as herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the claims that follow.

Claims

1. A method for displaying a loading animation, the method comprising: The method comprises: when at least one loading request is initiated, a loading animation is displayed, and the display duration of the loading animation is started, wherein the loading animation is used to prompt the user that loading is in progress; when the display duration has reached a preset maximum display duration, and loading is not completed for the at least one loading request, the display of the loading animation is stopped, and the display duration is ended; wherein the method further comprises: when at least one loading request is initiated, the loading animation being displayed is shared, and the display duration of the loading animation is restarted, when the loading animation is being displayed and no loading is in progress for any loading request; when loading is completed for all loading requests, and the display duration has not reached the preset maximum display duration, the display duration is ended, and the loading animation is continued to be displayed for a preset minimum display duration; when the display duration has reached the preset maximum display duration, and loading is not completed for the at least one loading request, the display of the loading animation is stopped, and the display duration is ended; wherein the method is implemented by calling a preset loading animation start function when each loading request is initiated, and calling a preset loading animation end function when loading is completed for the loading request; wherein the loading animation start function is used to start a timer, record the number of loading requests, and trigger the display of the loading animation when the loading request is initiated for the first time, wherein the loading animation start function is called to perform the following processing: when the number of loading requests is 0, start a timer; after starting the timer, increase the number of loading requests by 1; set the state of the loading animation to trigger the display of the loading animation; and clear the end timer; the loading animation end function is used to update the number of loading requests, and start an end timer when the updated number of loading requests is a preset number, wherein the loading animation end function is called to perform the following processing: decrease the number of loading requests by 1; after decreasing the number of loading requests by 1, when the number of loading requests is 0, clear the start timer and start an end timer; wherein when the start timer counts to the preset maximum display duration or the end timer counts to the preset minimum display duration, a reset function is called; wherein the reset function is used to reset the number of loading requests to the preset number and trigger the stop of the display of the loading animation.

2. The method of claim 1, wherein, The method further comprises: when loading is completed for the at least one loading request, if no loading is in progress for any other loading request, and the display duration has not reached the preset maximum display duration, the display duration is ended, and the loading animation is continued to be displayed for a preset minimum display duration.

3. The method of claim 1, wherein, The method further comprises: when at least one loading request is initiated, the loading animation being displayed is shared, and the display duration is continued to be counted, when the loading animation is being displayed and loading is in progress for any one of the loading requests; when the display duration has reached the preset maximum display duration and loading for the at least one loading request is not completed, the display unit is controlled to stop displaying the loading animation and the display duration is ended; the at least one loading request comprises a request for calling an interface to load an object.

4. The method according to any one of claims 1 to 3, characterized in that, The method comprises:

5. A device for displaying loading animation effects, characterized in that, a display unit configured to display a loading animation; a processor configured to perform the following operations: when at least one loading request is initiated, the display unit is controlled to display a loading animation and the display duration of the loading animation is started to be counted, wherein the loading animation is used to prompt a user that loading is being performed; when the display duration has reached a preset maximum display duration and loading for the at least one loading request is not completed, the display unit is controlled to stop displaying the loading animation and the display duration is ended; the processor is further configured to perform the following operations: when at least one loading request is initiated, the display unit is controlled to display a loading animation and the display duration of the loading animation is started to be counted, wherein the loading animation is used to prompt a user that loading is being performed; when the display duration has reached a preset maximum display duration and loading for the at least one loading request is not completed, the display unit is controlled to stop displaying the loading animation and the display duration is ended; when the display duration has reached the preset maximum display duration and loading for the at least one loading request is not completed, the display unit is controlled to stop displaying the loading animation and the display duration is ended; the processor is configured to perform the operations by calling a preset loading animation start function when each loading request is initiated and calling a preset loading animation end function when loading for the loading request is completed; the loading animation start function is used to start a timer, record the number of loading requests and trigger the display of the loading animation when the loading request is initiated for the first time, wherein the loading animation start function is called to perform the following processing: when the number of loading requests is 0, a start timer is started; after the start timer is started, the number of loading requests is increased by 1; the state of the loading animation is set to trigger the display of the loading animation; and an end timer is cleared; the loading animation end function is used to update the number of loading requests and start an end timer when the updated number of loading requests is a preset number, wherein the loading animation end function is called to perform the following processing: the number of loading requests is decreased by 1; after the number of loading requests is decreased by 1, when the number of loading requests is 0, the start timer is cleared and an end timer is started; and the loading animation end function is used to update the number of loading requests and start an end timer when the updated number of loading requests is a preset number, wherein the loading animation end function is called to perform the following processing: the number of loading requests is decreased by 1; after the number of loading requests is decreased by 1, when the number of loading requests is 0, the start timer is cleared and an end timer is started; and When the start timer reaches the preset maximum display duration or the end timer reaches the preset minimum display duration, a reset function is called; the reset function is used to reset the number of loading requests to the preset number and trigger the stop display of the loading animation.

6. The apparatus of claim 5, wherein, The processor is further configured to perform the following operations: When the loading for the at least one loading request has been completed, if no loading is being performed for any other loading request and the display duration has not reached the preset maximum display duration, the counting of the display duration is ended, and the display unit is controlled to continue displaying the loading animation for the preset minimum display duration.

7. The apparatus of claim 5, wherein, The processor is further configured to perform the following operations: When the loading for the at least one loading request has been completed, if no loading is being performed for any other loading request and the display duration has not reached the preset maximum display duration, the counting of the display duration is ended, and the display unit is controlled to continue displaying the loading animation for the preset minimum display duration. When the loading for the at least one loading request has been completed, if no loading is being performed for any other loading request and the display duration has not reached the preset maximum display duration, the counting of the display duration is ended, and the display unit is controlled to continue displaying the loading animation for the preset minimum display duration. The at least one loading request includes a request for calling an interface to load an object.

8. The apparatus of any of claims 5 to 7, wherein, Comprise:

9. An electronic device, comprising: At least one processor; At least one memory storing computer executable instructions, When the computer executable instructions in the computer readable storage medium are run by the at least one processor, the at least one processor is prompted to perform the method for displaying a loading animation as claimed in any one of claims 1 to 4. When the computer executable instructions in the computer readable storage medium are run by the at least one processor, the at least one processor is prompted to perform the method for displaying a loading animation as claimed in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that, The computer instructions are executed by the at least one processor to implement the method for displaying a loading animation as claimed in any one of claims 1 to 4.

11. A computer program product comprising computer instructions, characterized in that, ​

Citation Information

Patent Citations

  • Digital TV set-top box turning-on method and system

    CN103260084A