CN109064531B - Android animation execution method and device, terminal and readable medium - Google Patents

Android animation execution method and device, terminal and readable medium Download PDF

Info

Publication number
CN109064531B
CN109064531B CN201810864361.9A CN201810864361A CN109064531B CN 109064531 B CN109064531 B CN 109064531B CN 201810864361 A CN201810864361 A CN 201810864361A CN 109064531 B CN109064531 B CN 109064531B
Authority
CN
China
Prior art keywords
animation
value
execution
starting
calling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810864361.9A
Other languages
Chinese (zh)
Other versions
CN109064531A (en
Inventor
张磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Bangqi Technology Innovation Co ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810864361.9A priority Critical patent/CN109064531B/en
Publication of CN109064531A publication Critical patent/CN109064531A/en
Application granted granted Critical
Publication of CN109064531B publication Critical patent/CN109064531B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention discloses an Android animation execution method, an Android animation execution device, a terminal and a readable medium, wherein the method comprises the following steps: receiving a target value change message, defining an end value of the second animation according to the target value change message, defining a start value of the second animation according to the end value of the first animation, and setting an opening value of the second animation according to the start value of the second animation, wherein the opening value of the second animation is smaller than the start value of the second animation; calling an animation construction method, and constructing a second animation according to the starting value and the ending value of the second animation; and calling a first animation monitoring function to determine an execution animation value of the first animation, and calling an animation starting method to start the second animation when the execution animation value is equal to the starting value of the second animation. According to the Android animation execution method, device, terminal and readable medium provided by the embodiment of the invention, the animation target value is dynamically changed in the animation execution process, so that the animation execution is smoother, and the user experience is improved.

Description

Android animation execution method and device, terminal and readable medium
Technical Field
The embodiment of the invention relates to a computer technology, in particular to an Android animation execution method, an Android animation execution device, a terminal and a readable medium.
Background
In the embodiment of the invention, the animation is an animation of changing the control numerical value drawn by the Android terminal through codes, for example, the animation can be a progress animation, and the progress animation can be understood as an animation of a progress bar control loading process, wherein the progress animation is provided with a target value. For example, when the progress animation is 0% to 50% of the animation, then the target value is 50; when the progress animation is 0% to 80% of the animation, then the target value is 80.
In the prior art, when the progress animation 1 is executed, the animation target value cannot be dynamically changed, only the progress animation 1 can be stopped, and the progress animation 2 corresponding to the changed target value is started. For example, when a message of changing the target value 80 issued by the server is received during execution of 0% to 50% of the progress animation, only the 0% to 50% of the progress animation can be stopped and the 0% to 80% of the progress animation can be started. When the target value of the animation is changed, the progress animation 1 starts to have a certain progress, and is switched to the evolution animation 2 to enable the progress bar to be suddenly changed into 0, and then gradually becomes larger to the target value, so that an interface is unfriendly, and the user experience is reduced.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide an Android animation execution method, an Android animation execution device, an Android animation execution terminal, and an Android animation readable medium, which realize that an animation target value is dynamically changed in an animation execution process, so that animation execution is smoother, and user experience is improved.
In a first aspect, an embodiment of the present invention provides an Android animation execution method, including:
receiving a target value change message, defining an end value of a second animation according to the target value change message, defining a start value of the second animation according to the end value of the first animation, and setting an opening value of the second animation according to the start value of the second animation, wherein the opening value of the second animation is smaller than the start value of the second animation;
calling an animation construction method, and constructing a second animation according to the starting value and the ending value of the second animation;
and calling a first animation monitoring function to determine an execution animation value of the first animation, and calling an animation starting method to start the second animation when the execution animation value is equal to the starting value of the second animation.
Optionally, the defining the end value of the second animation according to the target value change message and defining the start value of the second animation according to the end value of the first animation include:
determining a changed target value according to the target change message, and calling a numerical definition method to define that the ending value of the second animation is equal to the changed target value;
and subtracting a preset value from the predefined ending value of the first animation, and calling a value definition method to define a value of which the starting value of the second animation is equal to the ending value of the first animation minus the preset value.
Optionally, the setting the start value of the second animation according to the start value of the second animation includes:
subtracting the starting consumption value of the second animation from the starting value of the second animation, and setting the difference value between the starting value of the second animation and the starting consumption value of the second animation as the starting value of the second animation.
Optionally, the calling the first animation monitoring function to determine the execution animation value of the first animation includes:
and in the first animation executing process, calling a callback monitoring method in the pre-added first animation monitoring function, and determining an executing animation value of the first animation.
Optionally, the callback monitoring method includes parameter animation of animation type with preset value;
correspondingly, calling a callback monitoring method in the pre-added first animation monitoring function to determine an execution animation value of the first animation, wherein the method comprises the following steps:
and calling a getAnimatedValue () method in a callback monitoring method in the pre-added first animation monitoring function to acquire a current attribute value of the parameter animation, and determining the current attribute value as an execution animation value of the first animation.
Optionally, after the calling the first animation monitoring function determines the execution animation value of the first animation, the method further includes:
and updating control information according to the execution animation value of the first animation.
Optionally, before the receiving the target value change message, the method further includes:
defining a value animation type, calling an animation construction method, and constructing a first animation of the value animation type according to a predefined starting value of the first animation and an ending value of the first animation;
and calling an animation starting method to start the first animation.
In a second aspect, an embodiment of the present invention provides an Android animation executing apparatus, including:
the numerical value definition module is used for receiving a target value change message, defining an end value of a second animation according to the target value change message, defining a start value of the second animation according to the end value of the first animation, and setting an opening value of the second animation according to the start value of the second animation, wherein the opening value of the second animation is smaller than the start value of the second animation;
the second animation construction module is used for calling an animation construction method and constructing a second animation according to the starting value of the second animation and the ending value of the second animation;
and the second animation opening module is used for calling the first animation monitoring function to determine an execution animation value of the first animation, and calling an animation opening method to open the second animation when the execution animation value is equal to the opening value of the second animation.
In a third aspect, an embodiment of the present invention provides a terminal, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the Android animation execution method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention provides a readable medium, on which a computer program is stored, where the program when executed by a processor implements an Android animation execution method according to any embodiment of the present invention.
According to the Android animation execution method, the Android animation execution device, the terminal and the readable medium, in the first animation execution process, after the target value change message issued by the server is received, the second animation is constructed immediately according to the issued target value change message, so that the second animation execution period duration is reduced; the starting value of the second animation is set, and the second animation is started when the executing animation value of the first animation is the starting value of the second animation, instead of starting the second animation after the execution of the first animation is finished, so that the connection between the first animation and the second animation is smoother, the animation target value is dynamically changed in the animation executing process, the animation executing is smoother, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the prior art descriptions, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an Android animation execution method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an Android animation executing device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal according to a third embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described by means of implementation examples with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
Fig. 1 is a flowchart of an Android animation execution method provided in an embodiment of the present invention, where the embodiment is applicable to a case where a target value is dynamically changed in a first animation execution process, and the method may be implemented by a terminal, and in particular may be implemented by software and/or hardware in the terminal.
Referring to fig. 1, the Android animation execution method is applied to a first animation execution process, and comprises the following steps:
s110, receiving a target value change message, defining an end value of the second animation according to the target value change message, defining a start value of the second animation according to the end value of the first animation, and setting an opening value of the second animation according to the start value of the second animation, wherein the opening value of the second animation is smaller than the start value of the second animation.
The first animation and the second animation can be understood as any animation of changing the control value drawn by the Android terminal through codes, for example, the first animation can be a progress animation, and the progress animation can be understood as an animation of changing progress bar control information. The first animation type and the second animation type are the same, and can be all preset value animation valueanimation types; the value animation ValueAnimator type can be specifically defined by the following method:
Public class ValueAnimator{};
the ValueAnimator class is Public common type, so that other classes have the access right of the value animation class. The class name of the value animation class is valueanimation, and the class name of the value animation class can be changed according to the requirements of research personnel, and is not limited herein.
Before constructing the animation, two global variables are defined by calling a numerical definition method respectively to represent a start value and an end value of the animation, and the animation is constructed according to the defined start value and end value. For example, a numerical definition method may be called to define two global variables respectively, to represent a start value and an end value of an animation, and may be specifically defined by the following method:
Private int startValue=0;
Private int endValue=80;
wherein startValue represents a start value of the animation, endValue represents an end value of the animation, and the start value and the end value are solved into private integer type values.
Wherein, when the executed animation is composed of one sub-animation, then the ending value of the sub-animation can be understood as the target value of the executed animation; when the performed animation is formed by joining a plurality of sub-animations, the end value of the last performed sub-animation can be understood as the target value of the performed animation. For example, if the performed animation is composed of one 0% to 50% of the progress animation, the end value 50 of the 0% to 50% of the progress animation may be understood as a target value of the performed animation; if the performed animation is an animation in which 0% to 50% of the progressive animation is joined with 30% to 80% of the progressive animation, the end value 80 of the later-performed 30% to 80% of the progressive animation can be understood as a target value of the performed animation.
In the execution process of the first animation, if a target value change message issued by the server is received, a new second animation needs to be constructed, and the execution process of the second animation and the first animation is linked, so that a complete and smooth execution animation with the target value changed is generated. Before constructing the second animation, defining a start value and an end value of the second animation, and defining the changed target value in the target value change message as the end value of the second animation; and defining a starting value of the second animation according to the ending value of the first animation, wherein the starting value of the second animation is smaller than or equal to the ending value of the first animation, namely, a part of the animation which is synchronously executed exists between the first animation and the second animation, so that the connection between the first animation and the second animation is smoother, and the two animations cannot be visually perceived to be executed, thereby giving people smoother animation watching experience.
The starting value of the second animation is set to be smaller than the starting value of the second animation, so that a certain time length is reserved for starting the second animation. Therefore, after the second animation is started according to the starting value of the second animation, the second animation can be accurately synchronized with the first animation, so that the connection precision of the first animation and the second animation is improved, and the smoothness of the animation is ensured.
Optionally, defining the end value of the second animation according to the target value modification message, and defining the start value of the second animation according to the end value of the first animation includes:
determining a changed target value according to the target change message, and calling a numerical definition method to define that the ending value of the second animation is equal to the changed target value; and subtracting a preset value from the predefined ending value of the first animation, and calling a value definition method to define a value of which the starting value of the second animation is equal to the ending value of the first animation minus the preset value.
The target value after modification may be analyzed from the target modification message sent by the server, specifically, the identifier of the target value in the target modification message may be identified, and the value corresponding to the target value identifier may be obtained. Wherein the changed target value may be assigned to an end value of the second animation. The end value of the first animation is a predefined value before the first animation is constructed. The preset value is more than or equal to 0 and is smaller than the ending value of the first animation; when the preset value is 0, the ending value of the first animation is set as the starting value of the second animation, so that the second animation and the first animation are executed at the same time at the ending value position of the first animation, and the aim of connecting the first animation and the second animation is fulfilled. Preferably, the preset value may be set according to an end value of the first animation, for example, the preset value may be an integer value of a preset proportion of the end value of the first animation, and specifically may be an integer value of 5% or 10% of the end value of the first animation. For example, when the end of the first animation is 50, the preset ratio is 5%, 50×5% =2.5, and 3 is obtained after rounding, and 3 is taken as the preset value. The preset proportion can be set according to specific requirements of research personnel, and is not particularly limited herein.
The method comprises the steps of defining a value obtained by subtracting a preset value from an ending value of a first animation as a starting value of a second animation, and ensuring that the starting value of the second animation is smaller than or equal to the ending value of the first animation, so that part of the animations which are synchronously executed exist between the first animation and the second animation, the connection between the first animation and the second animation is smoother, and the two animations cannot be visually perceived to be executed, thereby giving people smoother animation watching experience.
Optionally, setting the start value of the second animation according to the start value of the second animation includes:
subtracting the starting time consumption value of the second animation from the starting value of the second animation, and setting the difference value between the starting value of the second animation and the starting time consumption value of the second animation as the starting value of the second animation.
The starting time of the second animation can be an animation starting time experience value set by a research and development personnel, can be a starting time of the first animation, and can be an average time of historical animation starting time recorded in the Android terminal before the second animation is started.
The starting time consumption value of the second animation can be understood as a whole integer multiple of a time interval between each executing animation value of the first animation corresponding to the starting time consumption of the second animation. For example, when the first animation is a 0% to 50% progress animation and the execution period is 2000ms, 1, 2, 3 … 49, 50 may be understood as the execution animation values of the first animation, and the time intervals between the execution animation values of the first animations 0 to 1,1 to 2..49 to 50 are the same, which are t=2000 ms/50=40 ms. At this time, if the starting time of the second animation is 80ms, the starting time value of the second animation is 80/40=2; if the starting time of the second animation is 100ms, the starting time value of the second animation is 100/40=2.5, the starting time value is 3 after taking the integer, and the starting time value is 3.
The difference obtained by subtracting the starting consumption value of the second animation from the starting value of the second animation can be set as the starting value of the second animation, so that the starting value of the second animation is smaller than the starting value of the second animation, and a certain time period is reserved for starting the second animation. Therefore, after the second animation is started according to the starting value of the second animation, the second animation can be accurately synchronized with the first animation, so that the connection precision of the first animation and the second animation is improved, and the smoothness of the animation is ensured.
S120, calling an animation construction method, and constructing the second animation according to the starting value of the second animation and the ending value of the second animation.
The method for constructing the second animation is called, and the second animation is constructed according to the starting value of the second animation and the ending value of the second animation, specifically, the method can be implemented as follows:
ValueAnimator mValueAnimator2=ValueAnimator.ofInt(startValue2,endValue2);
wherein startValue2 represents a start value of the second animation, and endValue2 represents an end value of the second animation; the type of the second animation is a value animation type; wherein, the executing animation value of the second animation is defined as an Int integer type, that is, the executing animation values are all positive integers; the name of the second animation is mValueAnimator2, and the name of the second animation can be changed according to the requirements of the research personnel, which is not limited herein.
Wherein, after the second animation construction is completed, the execution period of the second animation can be set; wherein, the execution period refers to the time required by the animation to execute the whole process from the starting value to the ending value; the setting method of the execution period can be called to set the second animation execution period, and specifically, the setting method can be set by the following method:
mValueAnimator2.setDuration(xxx);
where xxx identifies the execution period duration in milliseconds ms, which may be set to 500, 1000, 2000, etc.
Preferably, the execution period of the second animation may correspond to the preset execution period of the first animation, and it may also be understood that the time interval between the execution animation values of the second animation is the same as the time interval between the execution animation values of the first animation. The time interval between the executing animation values of the animation may be understood as an updating period of the executing animation values of the animation, that is, preferably, the updating period of the executing animation values of the second animation is the same as the updating period of the first animation values.
Illustratively, when the first animation is a 0% -80% progress animation, the execution period is 2000ms, the time interval between executing animation values is t1=2000 ms/80=25 ms, i.e. the update period of executing animation values of the first animation is 25ms. The time interval between the execution of the animation values of the second animation is preferably 25ms, i.e. the update period of the execution of the animation values of the second animation is the same as the update period of the first animation values. When the second animation is 60% -90% of the execution animations, then the execution period of the second animation is preferably t=t1× (90-60) =750 ms.
The time interval between the execution animation values of the first animation can be obtained through the execution period of the first animation, and the update period of the execution animation values of the first animation is determined. Therefore, the updating period of the executing animation value of the second animation is consistent with the updating period of the executing animation value of the first animation, so that the second animation and the first animation can be more accurately synchronized in the synchronous executing part, the overall smoothness of the connected animations is improved, and the user experience is improved. In addition, the starting consumption value of the second animation can be determined through the updating period of the executing animation value of the first animation, so that the starting value of the second animation can be confirmed, and the connection precision of the second animation and the first animation is improved.
S130, calling a first animation monitoring function to determine an execution animation value of the first animation, and calling an animation start method to start the second animation when the execution animation value is equal to the start value of the second animation.
The execution of the animation values is understood to be the integer number of steps of 1 between the start value and the end value of the first animation. For example, when the first animation is a progress animation of 0% to 30%, the execution animation value of the first animation may be 1, 2, 3..29, 30. The current executing animation value in the executing process of the first animation can be monitored by calling the first animation monitoring function. The second animation can be started when the current executing animation value is a second animation starting value, so that the second animation is accurately connected with the first animation after the second animation is started and time is consumed for starting the second animation.
The animation opening method may specifically be a mvauueanimator 2.Start () method, and the opening of the second animation mvauueanimator 2 may be achieved by calling the start method. And, when the animation listening function determines that the execution animation value of the first animation is equal to the animation end value, the animation execution may be ended.
Optionally, invoking the first animation listening function to determine an execution animation value of the first animation includes:
and in the first animation executing process, calling a callback monitoring method in the pre-added first animation monitoring function, and determining an executing animation value of the first animation.
The first animation monitoring function can be specifically added by the following method:
mValueAnimator.addUpdateListener(mUpdateListener);
wherein, adding the monitoring function in the first animation can be realized by an addUpdateListener method; wherein the mUpdateListener object is a first animated listener object, i.e., a first animated listener function.
The specific method of the listener object mUpdateListener can be defined as follows:
wherein, the onAnimationUpdate represents a callback listening method in a listener object of the first animation. The callback monitoring method in the first animation monitoring function can monitor the current executing animation value of the first animation. Thus, the second animation can be controlled to be started when the execution animation value of the first animation is the starting value of the second animation.
Optionally, the callback monitoring method comprises parameter animation of a preset value animation type;
correspondingly, calling a callback monitoring method in the pre-added first animation monitoring function to determine an execution animation value of the first animation, wherein the method comprises the following steps:
and calling a getAnimatedValue () method in a callback monitoring method in the pre-added first animation monitoring function to acquire a current attribute value of the parameter animation, and determining the current attribute value as an execution animation value of the first animation.
The callback monitoring method onAnimationUpdate includes an animation parameter animation of a Value animation type, and a current attribute Value of the animation parameter animation can be determined as an execution animation Value of the first animation.
The obtaining of the current attribute value of the parameter animation can be realized by the following steps:
int animatorValue=(int)animation.getAnimatedValue();
the method comprises the steps of obtaining a current attribute value of animation through a getanimation value method, assigning the current attribute value to a defined integer value, and representing the value as an executing animation value of a first animation. The starting time of the second animation can be controlled by acquiring the executing animation value of the first animation, so that the second animation can be accurately connected with the first animation after the second animation is started.
Optionally, after the first animation monitoring function is called to determine the execution animation value of the first animation, the method further comprises: and updating the control information according to the execution animation value of the first animation.
After the callback listening method onammonification update acquires the execution animation value animatorvue of the first animation, the spatial information may be updated according to the execution animation value. When the control is a progress bar space, the control information is the progress information of the progress bar, and the progress information of the progress bar is updated by the following method:
progressBar.setProgress(animatorValue);
the progress bar is an example object of the progress bar, and the progress information can be updated according to the execution animation value animate value by calling the setProgress method.
Optionally, before receiving the target value change message, the method further includes:
defining a value animation type, calling an animation construction method, and constructing a first animation of the value animation type according to a predefined starting value of the first animation and an ending value of the first animation; and calling an animation starting method to start the first animation.
The method comprises the steps of setting a first animation according to a starting value and an ending value of the first animation, and calling an animation construction method to construct the first animation, wherein the constructed first animation type can be a value animation type; after the first animation is built, an execution period setting function can be called to set the execution period of the first animation; wherein, the animation open method can be called to open the first animation, thereby ensuring that the first animation starts to execute. And in the execution process of the first animation, the execution method of the Android animation can be realized after the target value is changed. The functions or methods used in the first animation construction method, the execution cycle setting method, the starting method, and the like can refer to the second animation to realize functions or methods with the same functions, i.e., the first animation and the second animation can use the same method to realize the operation with the same purpose.
According to the Android animation execution method, in the first animation execution process, after the target value change message issued by the server is received, the second animation is constructed immediately according to the issued target value change message, so that the execution period duration of the second animation is reduced; the starting value of the second animation is set, and the second animation is started when the executing animation value of the first animation is the starting value of the second animation, instead of starting the second animation after the execution of the first animation is finished, so that the connection between the first animation and the second animation is smoother, the animation target value is dynamically changed in the animation executing process, the animation executing is smoother, and the user experience is improved.
Example two
Fig. 2 is a schematic structural diagram of an Android animation executing device according to a second embodiment of the present invention, where the present embodiment is applicable to a situation in which a target value is dynamically changed during a first animation executing process.
Referring to fig. 2, the Android animation executing apparatus in this embodiment is applied to a first animation executing process, and includes:
the value definition module 210 is configured to receive the target value change message, define an end value of the second animation according to the target value change message, define a start value of the second animation according to the end value of the first animation, and set an on value of the second animation according to the start value of the second animation, where the on value of the second animation is smaller than the start value of the second animation;
a second animation construction module 220, configured to invoke an animation construction method, and construct a second animation according to a start value of the second animation and an end value of the second animation;
the second animation open module 230 is configured to call the first animation listening function to determine an execution animation value of the first animation, and call an animation open method to open the second animation when the execution animation value is equal to the open value of the second animation.
Optionally, the numerical definition module 210 includes:
the ending value defining sub-module is used for determining a changed target value according to the target change message, and calling a numerical value defining method to define that the ending value of the second animation is equal to the changed target value;
the starting value definition sub-module is used for subtracting a preset value from the predefined ending value of the first animation, and calling a value definition method to define a value of which the starting value of the second animation is equal to the ending value of the first animation minus the preset value.
Optionally, the numerical definition module 210 further includes:
the starting value setting sub-module is used for subtracting the starting time consumption value of the second animation from the starting value of the second animation and setting the difference value between the starting value of the second animation and the starting time consumption value of the second animation as the starting value of the second animation.
Optionally, the second animation opening module 230 is specifically configured to:
and in the first animation executing process, calling a callback monitoring method in the pre-added first animation monitoring function, and determining an executing animation value of the first animation.
Optionally, the callback monitoring method comprises parameter animation of a preset value animation type; correspondingly, the second animation opening module 230 is specifically configured to:
and calling a getAnimatedValue () method in a callback monitoring method in the pre-added first animation monitoring function to acquire a current attribute value of the parameter animation, and determining the current attribute value as an execution animation value of the first animation.
Optionally, the Android animation executing device further includes:
and the control information updating module is used for updating the control information according to the execution animation value of the first animation after the second animation open module 230 calls the first animation monitoring function to determine the execution animation value of the first animation.
Optionally, the Android animation executing device further includes:
the first animation construction module is used for defining a value animation type, calling an animation construction method and constructing a first animation of the value animation type according to a predefined starting value of the first animation and an ending value of the first animation; and the first animation opening module is used for calling an animation opening method to open the first animation.
The Android animation execution device provided in this embodiment belongs to the same inventive concept as the Android animation execution method provided in the first embodiment, technical details which are not described in detail in this embodiment can be seen in the first embodiment, and the first embodiment have the same beneficial effects.
Example III
The present embodiment provides a terminal that can be used in the case of dynamically changing a target value during execution of a first animation. Fig. 3 is a schematic structural diagram of a terminal according to a third embodiment of the present invention. Referring to fig. 3, the terminal includes:
one or more processors 310;
a memory 320 for storing one or more programs;
when the one or more programs are executed by the one or more processors 310, the one or more processors 310 implement the Android animation execution method as set forth in the first embodiment.
One processor 310 is illustrated in fig. 3; the processor 310 and the memory 320 may be connected by a bus or other means, for example in fig. 3.
The memory 320 is used as a computer readable storage medium, and can be used to store a software program, a computer executable program, and a module, such as a program instruction/module corresponding to the Android animation execution method in the embodiment of the present invention. The processor 310 executes various functional applications and data processing of the terminal by running software programs, instructions and modules stored in the memory 320, that is, implements the above-described Android animation execution method.
Memory 320 may include primarily a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program required for functionality; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 320 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 non-volatile solid-state storage device. In some examples, memory 320 may further include memory located remotely from processor 310, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The terminal provided in the present embodiment and the Android animation execution method provided in the first embodiment belong to the same inventive concept, technical details which are not described in detail in the present embodiment can be seen in the first embodiment, and the present embodiment and the first embodiment have the same beneficial effects.
Example IV
The present embodiment provides a readable medium having stored thereon a computer program which, when executed by a processor, implements the Android animation execution method as set forth in the first embodiment.
The readable medium provided in this embodiment belongs to the same inventive concept as the Android animation execution method provided in the first embodiment, and technical details not described in detail in this embodiment can be seen in the first embodiment, and the first embodiment have the same beneficial effects.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. The Android animation execution method is characterized by being applied to a first animation execution process and comprising the following steps of:
receiving a target value change message, defining an end value of a second animation according to the target value change message, defining a start value of the second animation according to the end value of the first animation, and setting an opening value of the second animation according to the start value of the second animation, wherein the opening value of the second animation is smaller than the start value of the second animation;
defining a start value of the second animation according to the end value of the first animation, including:
subtracting a preset value from the predefined ending value of the first animation, and calling a value definition method to define a value of which the starting value of the second animation is equal to the ending value of the first animation minus the preset value; calling an animation construction method, and constructing a second animation according to the starting value and the ending value of the second animation;
and calling a first animation monitoring function to determine an execution animation value of the first animation, and calling an animation starting method to start the second animation when the execution animation value is equal to the starting value of the second animation.
2. The method of claim 1, wherein defining an end value of a second animation from the target value change message comprises:
and determining a changed target value according to the target change message, and calling a numerical definition method to define that the ending value of the second animation is equal to the changed target value.
3. The method according to claim 1, wherein the setting of the start value of the second animation according to the start value of the second animation comprises:
subtracting the starting consumption value of the second animation from the starting value of the second animation, and setting the difference value between the starting value of the second animation and the starting consumption value of the second animation as the starting value of the second animation.
4. The method of claim 1, wherein invoking the first animation listening function to determine an execution animation value of the first animation comprises:
and in the first animation executing process, calling a callback monitoring method in the pre-added first animation monitoring function, and determining an executing animation value of the first animation.
5. The method of claim 4, wherein the callback listening method comprises an animation parameter animation of a preset value animation type;
correspondingly, calling a callback monitoring method in the pre-added first animation monitoring function to determine an execution animation value of the first animation, wherein the method comprises the following steps:
and calling a getAnimatedValue () method in a callback monitoring method in the pre-added first animation monitoring function to acquire a current attribute value of the parameter animation, and determining the current attribute value as an execution animation value of the first animation.
6. The method of claim 1, wherein after the invoking the first animation listening function determines the execution animation value of the first animation, further comprising:
and updating control information according to the execution animation value of the first animation.
7. The method of claim 1, further comprising, prior to said receiving a target value change message:
defining a value animation type, calling an animation construction method, and constructing a first animation of the value animation type according to a predefined starting value of the first animation and an ending value of the first animation;
and calling an animation starting method to start the first animation.
8. The Android animation execution device is characterized by being applied to a first animation execution process and comprising the following steps:
the numerical value definition module is used for receiving a target value change message, defining an end value of a second animation according to the target value change message, defining a start value of the second animation according to the end value of the first animation, and setting an opening value of the second animation according to the start value of the second animation, wherein the opening value of the second animation is smaller than the start value of the second animation;
the numerical definition module comprises:
the starting value definition sub-module is used for subtracting a preset value from the predefined ending value of the first animation, and calling a value definition method to define a value of which the starting value of the second animation is equal to the ending value of the first animation minus the preset value; the second animation construction module is used for calling an animation construction method and constructing a second animation according to the starting value of the second animation and the ending value of the second animation;
and the second animation opening module is used for calling the first animation monitoring function to determine an execution animation value of the first animation, and calling an animation opening method to open the second animation when the execution animation value is equal to the opening value of the second animation.
9. A terminal, the terminal comprising:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the Android animation execution method of any of claims 1-7.
10. A readable medium having stored thereon a computer program, which when executed by a processor implements the Android animation execution method of any of claims 1-7.
CN201810864361.9A 2018-08-01 2018-08-01 Android animation execution method and device, terminal and readable medium Active CN109064531B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810864361.9A CN109064531B (en) 2018-08-01 2018-08-01 Android animation execution method and device, terminal and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810864361.9A CN109064531B (en) 2018-08-01 2018-08-01 Android animation execution method and device, terminal and readable medium

Publications (2)

Publication Number Publication Date
CN109064531A CN109064531A (en) 2018-12-21
CN109064531B true CN109064531B (en) 2023-10-20

Family

ID=64832376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810864361.9A Active CN109064531B (en) 2018-08-01 2018-08-01 Android animation execution method and device, terminal and readable medium

Country Status (1)

Country Link
CN (1) CN109064531B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111127602B (en) * 2019-12-27 2023-07-04 珠海金山数字网络科技有限公司 Animation production method and device based on NGUI

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544048A (en) * 2013-10-31 2014-01-29 Tcl集团股份有限公司 Boot animation display method of Android system and system comprising same
CN103544729A (en) * 2013-09-24 2014-01-29 Tcl集团股份有限公司 Animation data processing method and system
CN107295388A (en) * 2017-06-21 2017-10-24 微鲸科技有限公司 Boot animation starts method, device and readable storage medium storing program for executing
CN107833260A (en) * 2017-11-28 2018-03-23 福建中金在线信息科技有限公司 The method for drafting and system of animation progress bar

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7173623B2 (en) * 2003-05-09 2007-02-06 Microsoft Corporation System supporting animation of graphical display elements through animation object instances
US8375319B2 (en) * 2009-06-05 2013-02-12 Apple Inc. Progress indicator for loading dynamically-sized contents

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544729A (en) * 2013-09-24 2014-01-29 Tcl集团股份有限公司 Animation data processing method and system
CN103544048A (en) * 2013-10-31 2014-01-29 Tcl集团股份有限公司 Boot animation display method of Android system and system comprising same
CN107295388A (en) * 2017-06-21 2017-10-24 微鲸科技有限公司 Boot animation starts method, device and readable storage medium storing program for executing
CN107833260A (en) * 2017-11-28 2018-03-23 福建中金在线信息科技有限公司 The method for drafting and system of animation progress bar

Also Published As

Publication number Publication date
CN109064531A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN107678918B (en) OSD heartbeat mechanism setting method and device of distributed file system
CN111814089B (en) Page rendering method and device, rendering server and storage medium
CN107145355B (en) Page layout adjusting method and device, storage medium, processor and terminal
KR102094066B1 (en) Method and device for processing data for mobile games
CN109343902B (en) Audio processing assembly operation method and device, terminal and storage medium
CN111176133A (en) Method and device for determining smart home scene
CN110413346A (en) A kind of parameter updating method and device
CN110163939B (en) Three-dimensional animation character expression generating method, device, equipment and storage medium
CN109754072B (en) Processing method of network offline model, artificial intelligence processing device and related products
CN106022108B (en) A kind of synchronization management method and terminal device
CN109064531B (en) Android animation execution method and device, terminal and readable medium
CN110287033A (en) Batch tasks processing method, device, system, equipment and readable storage medium storing program for executing
CN108367438B (en) Robot role switching method and device and robot
CN109086115B (en) Android animation execution method, device, terminal and readable medium
CN112044061B (en) Game picture processing method and device, electronic equipment and storage medium
CN112131015B (en) Information processing method and device, cloud server and storage medium
CN105867910A (en) Dynamic wallpaper presenting method and apparatus for mobile terminal
CN115567733B (en) SDK-based live broadcast room switching method, device, terminal and storage medium
CN109062620B (en) Android frame animation execution method, device, terminal and readable medium
CN109144638B (en) Android horizontal and vertical screen data synchronization method and device, terminal and readable medium
CN107479982B (en) data synchronization method and terminal
CN111147578B (en) Method and device for preventing curtain animation from jumping
CN107301089B (en) APP deployment and calling method and terminal
CN111918019B (en) Video conference method and system, and computer readable storage medium
CN107743266B (en) Flash and JS page efficient rendering communication method, storage medium, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240116

Address after: 518000, 207, 2nd Floor, Aotexun Electric Power Building, No. 3 Songpingshan Road, North Zone, High tech Industrial Park, Xili Street, Nanshan District, Shenzhen, Guangdong Province

Patentee after: Shenzhen Bangqi Technology Innovation Co.,Ltd.

Address before: 11 / F, building B1, phase 4.1, software industry, No.1, Software Park East Road, Wuhan East Lake Development Zone, Wuhan City, Hubei Province, 430070

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right