CN109064531A - Android animation executes method, apparatus, terminal and readable medium - Google Patents
Android animation executes method, apparatus, terminal and readable medium Download PDFInfo
- Publication number
- CN109064531A CN109064531A CN201810864361.9A CN201810864361A CN109064531A CN 109064531 A CN109064531 A CN 109064531A CN 201810864361 A CN201810864361 A CN 201810864361A CN 109064531 A CN109064531 A CN 109064531A
- Authority
- CN
- China
- Prior art keywords
- animation
- value
- unlatching
- execution
- monitor
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 125
- 238000010276 construction Methods 0.000 claims abstract description 14
- 230000006870 function Effects 0.000 claims description 36
- 230000008859 change Effects 0.000 claims description 23
- 230000015654 memory Effects 0.000 claims description 18
- 241000208340 Araliaceae Species 0.000 claims description 5
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims description 5
- 235000003140 Panax quinquefolius Nutrition 0.000 claims description 5
- 235000008434 ginseng Nutrition 0.000 claims description 5
- 238000012544 monitoring process Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 6
- 238000011160 research Methods 0.000 description 4
- 230000001360 synchronised effect Effects 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
Abstract
The embodiment of the invention discloses a kind of Android animations to execute method, apparatus, terminal and readable medium, wherein this method comprises: receiving target value changes message, the end value of the second animation of message definition is changed according to target value, the initial value of the second animation is defined according to the end value of the first animation, and the unlatching value of the second animation is set according to the initial value of the second animation, wherein, initial value of the unlatching value of the second animation less than the second animation;Animation construction method is called, the second animation is constructed according to the initial value of the second animation and the end value of the second animation;It calls the first animation to monitor the execution animation value that function determines the first animation, and when executing unlatching value of the animation value equal to the second animation, animation open method is called to open the second animation.A kind of Android animation provided in an embodiment of the present invention executes method, apparatus, terminal and readable medium, realizes and dynamically changes animation target value in animation implementation procedure, executes animation more smooth, the user experience is improved.
Description
Technical field
The present embodiments relate to computer technologies more particularly to a kind of Android animation to execute method, apparatus, terminal
And readable medium.
Background technique
Animation refers in the embodiment of the present invention, the animation that Android terminal is changed by the control numerical value that code is drawn, example
It such as can be progress animation, progress animation can be understood as the animation of progress bar control loading procedure, wherein progress cartoon setting
There is target value.Illustratively, when progress animation is 0% to 50% animation, then target value is 50;When progress animation is 0%
To 80% animation when, then target value be 80.
In the prior art, in 1 implementation procedure of progress animation, it can not dynamically change animation target value, progress can only be stopped
Animation 1, and open the corresponding progress animation 2 of target value after change.Illustratively, when 0% to 50% progress animation executed
If Cheng Zhong can only stop 0% to 50% progress animation receive the message that the change target value that server issues is 80, and
Open 0% to 80% progress animation.Which results in when changing animation target value, progress animation 1 begins with certain progress,
Being switched to evolution animation 2 makes progress bar sport 0, then becomes larger again as target value, and it is unfriendly to cause interface, reduces
User experience.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of Android animations to execute method, apparatus, terminal and readable Jie
Matter realizes and dynamically changes animation target value in animation implementation procedure, executes animation more smooth, improves user's body
It tests.
In a first aspect, the embodiment of the invention provides a kind of Android animations to execute method, comprising:
It receives target value and changes message, the end value of the second animation of message definition is changed according to the target value, according to the
The end value of one animation defines the initial value of the second animation, and opening for the second animation is arranged according to the initial value of second animation
Open value, wherein the unlatching value of second animation is less than the initial value of second animation;
Animation construction method is called, according to the initial value of second animation and the end value of the second animation building second
Animation;
It calls the first animation to monitor function and determines the execution animation value of the first animation, and in the executions animation value equal to the
When the unlatching value of two animations, animation open method is called to open the second animation.
Optionally, the end value that the second animation of message definition is changed according to the target value, according to the first animation
End value defines the initial value of the second animation, comprising:
Message is changed according to the target and determines the target value after changing, and is called numerical value to define method and is defined the second animation
End value is equal to the target value after changing;
The end value of predefined first animation is subtracted into preset value, calls numerical value to define method and defines rising for the second animation
The end value that initial value is equal to the first animation subtracts the numerical value after preset value.
Optionally, the unlatching value that the second animation is set according to the initial value of second animation, comprising:
The initial value of second animation subtracts to the unlatching time-consuming value of second animation, and by second animation
The difference of the time-consuming value of the unlatching of initial value and second animation is set as the unlatching value of the second animation.
It is optionally, described that the first animation is called to monitor the execution animation value that function determines the first animation, comprising:
In the first animation implementation procedure, the first animation added in advance is called to monitor the readjustment monitor method in function, really
The execution animation value of fixed first animation.
Optionally, the readjustment monitor method includes that preset value animation types enter parameter animation;
Correspondingly, the first animation added in advance is called to monitor the readjustment monitor method in function, holding for the first animation is determined
Row animation value, comprising:
The first animation added in advance is called to monitor the side getAnimatedValue () in the readjustment monitor method in function
Method obtains the current property value into ginseng parameter animation, and the current property value is determined as to the execution animation of the first animation
Value.
Optionally, after the first animation of calling monitoring function determines the execution animation value of the first animation, further includes:
Control information is updated according to the execution animation value of first animation.
Optionally, before the reception target value changes message, further includes:
Definition value animation types, and animation construction method is called, according to the initial value of predefined first animation and
First animation of the end value building value animation types of one animation;
Animation open method is called to open the first animation.
Second aspect, the embodiment of the invention provides a kind of Android animation executive devices, comprising:
It is dynamic to change message definition second according to the target value for receiving target value change message for numerical value definition module
The end value of picture defines the initial value of the second animation according to the end value of the first animation, and according to the starting of second animation
The unlatching value of value the second animation of setting, wherein the unlatching value of second animation is less than the initial value of second animation;
Second animation constructs module, for calling animation construction method, according to the initial value of second animation and the
The end value of two animations constructs the second animation;
Second animation opening module, for calling the first animation to monitor the execution animation value that function determines the first animation, and
When the execution animation value is equal to the unlatching value of the second animation, animation open method is called to open the second animation.
The third aspect, the embodiment of the invention provides a kind of terminals, comprising:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes that the Android animation as described in any embodiment of the present invention executes method.
Fourth aspect, the embodiment of the invention provides a kind of readable mediums, are stored thereon with computer program, the program quilt
Realize that the Android animation as described in any embodiment of the present invention executes method when processor executes.
A kind of Android animation provided in an embodiment of the present invention executes method, apparatus, terminal and readable medium, first
In animation implementation procedure, after receiving the target value change message that server issues, immediately according to the target value change issued
Message has carried out the building of the second animation, so that reducing the second animation executes cycle duration;The unlatching value of second animation is set,
And the second animation is opened when the execution animation value of the first animation is the unlatching value of the second animation, and not executed in the first animation
After open the second animation, so that the first animation be made to be connected more smooth with the second animation, realize in animation implementation procedure
Middle dynamic changes animation target value, executes animation more smooth, the user experience is improved.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to do one simply to introduce, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is that a kind of Android animation that the embodiment of the present invention one provides executes method flow diagram;
Fig. 2 is a kind of Android animation executive device structural schematic diagram provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of structural schematic diagram for terminal that the embodiment of the present invention three provides.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, hereinafter with reference to attached in the embodiment of the present invention
Figure, clearly and completely describes technical solution of the present invention by embodiment, it is clear that described embodiment is the present invention one
Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
Embodiment one
Fig. 1 is that a kind of Android animation that the embodiment of the present invention one provides executes method flow diagram, and the present embodiment is applicable
The case where dynamically changing target value in the first animation implementation procedure, this method can be realized by terminal, can specifically pass through terminal
In software and/or hardware implement.
Referring to Fig. 1, which executes method, is applied in the first animation implementation procedure, includes the following steps:
S110, it receives target value and changes message, the end value of the second animation of message definition is changed according to target value, according to the
The end value of one animation defines the initial value of the second animation, and the unlatching of the second animation is arranged according to the initial value of the second animation
Value, wherein initial value of the unlatching value of the second animation less than the second animation.
Wherein, the first animation and the second animation are it is to be understood that the control numerical value that Android terminal is drawn by code changes
Any animation become, such as can be progress animation, progress animation can be understood as the dynamic of progress bar control information change procedure
It draws.Wherein, the first animation types are identical as the second animation types, can be all preset value animation ValueAnimator type;Its
In, value animation ValueAnimator type can be specifically defined by the following method:
Public class ValueAnimator{};
Wherein, ValueAnimator class is that Public shares type, so that other classes have the access right of the value animated type
Limit.Wherein, the class name for being worth animated type is ValueAnimator, and the class name of the value animation can be carried out according to research staff's demand
Change, it is not limited here.
Wherein, it before constructing animation, needs that numerical value is called to define method and defines two global variables respectively, to indicate
The initial value and end value of animation, and according to the building of the initial value of definition and end value progress animation.Illustratively, it can adjust
Method is defined with numerical value and defines two global variables respectively, to indicate the initial value and end value of animation, can specifically be passed through
Following method definition:
Private int startValue=0;
Private int endValue=80;
Wherein, startValue indicates the initial value of animation, and endValue indicates the end value of animation, and initial value and knot
Beam value solution is privately owned integer type numerical value.
Wherein, when the animation of execution is made of a sub-animation, then the end value of the sub-animation can be understood as executing
Animation target value;When the animation of execution is connected by multiple sub-animations, then the end value of the sub-animation finally executed
It can be understood as the target value of the animation executed.Illustratively, if the animation executed is by one 0% to 50% progress animation structure
The end value 50 of 0% to 50% progress animation can be then interpreted as the target value of the animation executed by Cheng Shi;If what is executed is dynamic
When animation made of picture is connected as 0% to 50% progress animation with 30% to 80% progress animation, then it can be executed by after
30% to 80% progress animation end value 80 be interpreted as execute animation target value.
In the first animation implementation procedure, if receiving the target value change message that server issues, need to construct one
A the second new animation, and it is connected the second animation and the implementation procedure of the first animation, thus after generating a target value change
Completely, smooth execution animation.It before constructing the second animation, needs to define the initial value and end value of the second animation, can incite somebody to action
Target value after changing in target value change message is defined as the end value of the second animation;And it is fixed according to the end value of the first animation
The initial value of adopted second animation can specifically make the initial value of the second animation be less than or equal to the end value of the first animation, that is,
Make the presence of the synchronous part animation executed between the first animation and the second animation, makes the linking between the first animation and the second animation
It is more smooth, it can not visually be perceived as two animations and execute, thus the animation viewing experience more smooth to people.
Wherein, since the unlatching of the second animation need to consume certain time length, it is therefore desirable to the starting less than the second animation be arranged
The unlatching value of second animation of value is that certain time length is reserved in the unlatching of the second animation.So that the second animation is dynamic according to second
, can be precisely synchronous with the first animation after the unlatching value of picture is opened, to improve the linking essence of the first animation and the second animation
Degree, ensure that the fluency of animation.
Optionally, the end value that the second animation of message definition is changed according to target value, it is fixed according to the end value of the first animation
The initial value of adopted second animation, comprising:
Message is changed according to target and determines the target value after changing, and numerical value is called to define the end that method defines the second animation
Value is equal to the target value after changing;The end value of predefined first animation is subtracted into preset value, calls numerical value to define method fixed
The end value that the initial value of adopted second animation is equal to the first animation subtracts the numerical value after preset value.
Wherein it is possible to which the target value after parsing change in the target change message that server issues, specifically can be
It identifies the mark of target value in target change message, and obtains target value and identify corresponding numerical value.Wherein it is possible to by after change
Target value is assigned to the end value of the second animation.Wherein, the end value of the first animation is predetermined before constructing the first animation
Numerical value.Wherein, preset value is more than or equal to 0, and less than the end value of the first animation;Wherein, when preset value is 0, i.e., by first
The end value of animation is set as the initial value of the second animation, makes the second animation and the first animation in the end value position of the first animation
It is performed simultaneously, achievees the purpose that the first animation and the linking of the second animation.Preferably, preset value can be according to the end of the first animation
Value setting, such as preset value can be the rounding numerical value of the preset ratio of the end value of the first animation, and it is dynamic specifically to can be first
5% or 10% rounding numerical value of the end value of picture.Illustratively, when the end of the first animation most 50, preset ratio is
5%, then 50 × 5%=2.5, is 3 after being rounded, is then used as preset value for 3.Wherein, preset ratio can be according to research staff
Specific requirements be configured, be not specifically limited herein.
Wherein, the numerical value that the end value of the first animation subtracts preset value is defined as to the initial value of the second animation, Ke Yibao
The initial value for demonstrate,proving the second animation is less than or equal to the end value of the first animation, makes to exist to synchronize between the first animation and the second animation to hold
Capable part animation, keeps the linking between the first animation and the second animation more smooth, can not visually be perceived as two animations
It executes, thus the animation viewing experience more smooth to people.
Optionally, the unlatching value of the second animation is set according to the initial value of the second animation, comprising:
The initial value of second animation subtracts to the unlatching time-consuming value of the second animation, and by the initial value of the second animation and second
The difference of the time-consuming value of the unlatching of animation is set as the unlatching value of the second animation.
Wherein, the animation that the unlatching time-consuming of the second animation can be research staff's setting opens time-consuming empirical value, can also be with
It is the unlatching time-consuming referring to the first animation, can also be the history animation of Android terminal internal record before the second animation is opened
Open time-consuming average time-consuming.
Wherein, the unlatching time-consuming value of the second animation, it can be understood as time-consuming corresponding first animation of the unlatching of the second animation
Each execution animation value between time interval rounding integral multiple.Illustratively, when the first animation be 0% to 50% into
Animation is spent, the executions period is 2000ms, then 1,2,3 ... 49, the 50 execution animation value that can be understood as the first animation, the first animation
The time interval executed between 0 to 1,1 to 2...49 to 50 each execution animation value is identical, is all t=2000ms/50=
40ms.At this point, the unlatching time-consuming value of the second animation is 80/40=2 if the unlatching time-consuming of the second animation is 80ms;If second
The unlatching time-consuming of animation is 100ms, then the unlatching time-consuming value of the second animation is 100/40=2.5, is 3 after round numbers, then opens
Time-consuming value is 3.
It is moved wherein it is possible to set second for the difference for the time-consuming value of unlatching that the initial value of the second animation subtracts the second animation
The unlatching value of picture makes the unlatching value of the second animation less than the initial value of the second animation, opens reserved certain time length for the second animation.
So that after the second animation is opened according to the unlatching value of the second animation, it can be precisely synchronous with the first animation, to improve
The linking precision of first animation and the second animation, ensure that the fluency of animation.
S120, animation construction method is called, according to the initial value of the second animation and the end value of the second animation building the
Two animations.
Wherein, animation construction method is called, according to the initial value of the second animation and the end value of the second animation building the
Two animations can specifically construct by the following method:
ValueAnimator mValueAnimator2=ValueAnimator.ofInt (startValue2,
endValue2);
Wherein, startValue2 indicates the initial value of the second animation, and endValue2 indicates the end value of the second animation;Its
In, the type of the second animation is value animation ValueAnimator type;Wherein, the execution animation value of the second animation is defined as Int
Integer type, i.e. execution animation value is all positive integer;Wherein, the title of the second animation is mValueAnimator2, the second animation
Title can be modified according to research staff's demand, it is not limited here.
Wherein, after the completion of the second animation constructs, the execution period of the second animation can be set;Wherein, the execution period refers to
Animation executes the time of overall process from initial value to end value;It is carried out wherein it is possible to call and execute period setting method
Second animation executes the setting in period, can specifically be arranged by the following method:
mValueAnimator2.setDuration(xxx);
Wherein, xxx mark executes cycle duration, and unit is millisecond ms, can be set to 500,1000 or 2000 etc..
Preferably, the execution period of the second animation can be corresponding with the first animation preset execution period, can also manage
Solution is the time interval executed between animation value and the time interval phase of the first animation executed between animation value of the second animation
Together.Wherein, the time interval of animation executed between animation value, it can be understood as the execution animation value update cycle of animation, i.e.,
Preferably, the update cycle of the execution animation value of the second animation is identical as the update cycle of the first animation value.
Illustratively, when the first animation be 0%-80% progress animation, the executions period be 2000ms, execution animation value it
Between time interval be t1=2000ms/80=25ms, i.e. the first animation execution animation value update cycle be 25ms.Then
Time interval between the execution animation value of two animations is preferably 25ms, i.e. the second animation execution animation value update cycle with
The update cycle of first animation value is identical.When the second animation is the execution animation of 60%-90%, then second animation executes week
Phase is preferably T=t1 × (90-60)=750ms.
The time interval executed between animation value that the first animation can be sought by the execution period of the first animation, determines the
The update cycle of the execution animation value of one animation.It is moved so as to which the execution animation value update cycle of the second animation is arranged with first
The execution animation value update cycle of picture is consistent, allows the second animation and the first animation in more accurate same of synchronous execution part
Step improves the whole fluency of animation after linking, improves user experience.In addition, passing through the execution animation value of the first animation
Update cycle can determine the unlatching time-consuming value of the second animation, whereby it was confirmed that the unlatching value of the second animation, improves second
The linking precision of animation and the first animation.
S130, it calls the first animation to monitor the execution animation value that function determines the first animation, and is equal in executing animation value
When the unlatching value of the second animation, animation open method is called to open the second animation.
Wherein, executing animation value can be understood as the first animation integer number that step-length is 1 between initial value to end value
Value.For example, when the first animation is 0% to 30% progress animation, the execution animation value of the first animation can be 1,2,
3...29,30.Wherein it is possible to by calling the first animation to monitor function, that monitors in the first animation implementation procedure current is held
Row animation value.Can current execution animation value be the second animation unlatching value when, open the second animation, thus ensure that by
After second animation opens the second animation of time-consuming unlatching, the second animation is precisely connected with the first animation.
Wherein, animation open method specifically can be mValueAnimator2.start () method, by calling start
The unlatching of the second animation mValueAnimator2 may be implemented in method.Also, function is monitored when animation and determines holding for the first animation
When row animation value is equal to animation end value, animation execution can be terminated.
Optionally, the first animation is called to monitor the execution animation value that function determines the first animation, comprising:
In the first animation implementation procedure, the first animation added in advance is called to monitor the readjustment monitor method in function, really
The execution animation value of fixed first animation.
Wherein, the first animation is monitored function and can specifically be added by the following method:
mValueAnimator.addUpdateListener(mUpdateListener);
Wherein, addition in the first animation may be implemented in by addUpdateListener method and monitors function;Wherein
MUpdateListener object is the monitor object of the first animation, i.e. the first animation monitors function.
Wherein, the specific of monitor object mUpdateListener can define by the following method:
Wherein, onAnimationUpdate indicates the readjustment monitor method in the monitor object of the first animation.Wherein,
The current execution animation value of the first animation can be monitored by monitoring the readjustment monitor method in function by the first animation.So as to
It controls the second animation and when executing the unlatching value that animation value is the second animation, opens the second animation in the first animation.
Optionally, readjustment monitor method includes that preset value animation types enter parameter animation;
Correspondingly, the first animation added in advance is called to monitor the readjustment monitor method in function, holding for the first animation is determined
Row animation value, comprising:
The first animation added in advance is called to monitor the side getAnimatedValue () in the readjustment monitor method in function
Method obtains the current property value into ginseng parameter animation, and current property value is determined as to the execution animation value of the first animation.
It wherein, include a value animation Value Animator in readjustment monitor method onAnimationUpdate
Type enters parameter animation, the current property value for entering parameter animation can be determined as holding for the first animation
Row animation value.
Wherein, the current property value into ginseng parameter animation is obtained, can specifically be realized by the following method:
Int animatorValue=(int) animation.getAnimatedValue ();
Wherein, the current property value that acquisition animation may be implemented by getAnimatedValue method, will be current
Attribute value is assigned to the integer numerical value animatorValue of definition, then the execution that animatorValue is expressed as the first animation is moved
Picture value.By getting the execution animation value of the first animation, the unlatching opportunity of the second animation can control, to make unlatching second
The second animation can precisely be connected with the first animation after animation.
Optionally, after calling the first animation monitoring function to determine the execution animation value of the first animation, further includes: according to
The execution animation value of first animation updates control information.
Wherein, in the execution animation value for obtaining the first animation by readjustment monitor method onAnimationUpdate
After animatorValue, spatial information can be updated according to animation value is executed.Illustratively, when control is progress bar space
When, control information is the progress msg of progress bar, and the progress msg for updating progress bar can specifically be realized by the following method:
progressBar.setProgress(animatorValue);
Wherein, progressBar is an example object of progress bar, by calling setProgress method can root
Progress msg is updated according to animation value animatorValue is executed.
Optionally, before receiving target value change message, further includes:
Definition value animation types, and animation construction method is called, according to the initial value of predefined first animation and
First animation of the end value building value animation types of one animation;Animation open method is called to open the first animation.
Wherein it is possible to call animation construction method to carry out the first animation according to the initial value and end value of the first animation
Building, the first animation types of building can be value animation ValueAnimator type;Wherein, after building the first animation,
The execution period for executing period setting the first animation of function setup can be called;Wherein it is possible to which animation open method is called to open
First animation, to guarantee that the first animation starts to execute.And in the implementation procedure of the first animation, above-mentioned target value may be implemented
After change, the execution method of Android animation.Wherein, the construction method of the first animation, execution period setting method, opening square
The function or method that method etc. uses all can refer to the function or method that above-mentioned second animation realizes said function, i.e., dynamic first
Method identical with all usable thinking of the second animation is drawn to realize the operation of identical purpose.
Android animation provided in this embodiment executes method, in the first animation implementation procedure, when receiving server
After the target value change message issued, the building of the second animation has been carried out according to the target value change message issued immediately, thus
Reduce the second animation and executes cycle duration;The unlatching value of second animation is set, and in the execution animation value of the first animation be the
It opens the second animation when the unlatching value of two animations, and not opens the second animation after the first animation executes, to make the
One animation is connected more smooth with the second animation, realizes and dynamically changes animation target value in animation implementation procedure, makes animation
Execution is more smooth, and the user experience is improved.
Embodiment two
Fig. 2 is a kind of Android animation executive device structural schematic diagram provided by Embodiment 2 of the present invention, and the present embodiment can
The case where dynamically changing target value suitable for the first animation implementation procedure.
Referring to fig. 2, Android animation executive device in the present embodiment is applied in the first animation implementation procedure, comprising:
Numerical value definition module 210 changes the second animation of message definition according to target value for receiving target value change message
End value, define the initial value of the second animation according to the end value of the first animation, and be arranged according to the initial value of the second animation
The unlatching value of second animation, wherein initial value of the unlatching value of the second animation less than the second animation;
Second animation constructs module 220, for calling animation construction method, according to the initial value of the second animation and second
The end value of animation constructs the second animation;
Second animation opening module 230, for calling the first animation to monitor the execution animation value that function determines the first animation,
And when executing unlatching value of the animation value equal to the second animation, animation open method is called to open the second animation.
Optionally, numerical value definition module 210, comprising:
End value defines submodule, determines the target value after changing for changing message according to target, calls numerical value definition
The end value that method defines the second animation is equal to the target value after changing;
Initial value defines submodule, for the end value of predefined first animation to be subtracted preset value, calls numerical value fixed
The end value that the initial value that right way of conduct method defines the second animation is equal to the first animation subtracts the numerical value after preset value.
Optionally, numerical value definition module 210, further includes:
Submodule is arranged in unlatching value, for the initial value of the second animation to be subtracted to the unlatching time-consuming value of the second animation, and will
The difference of the time-consuming value of the unlatching of the initial value of second animation and the second animation is set as the unlatching value of the second animation.
Optionally, the second animation opening module 230, is specifically used for:
In the first animation implementation procedure, the first animation added in advance is called to monitor the readjustment monitor method in function, really
The execution animation value of fixed first animation.
Optionally, readjustment monitor method includes that preset value animation types enter parameter animation;Correspondingly, the
Two animation opening modules 230, are specifically used for:
The first animation added in advance is called to monitor the side getAnimatedValue () in the readjustment monitor method in function
Method obtains the current property value into ginseng parameter animation, and current property value is determined as to the execution animation value of the first animation.
Optionally, Android animation executive device, further includes:
Control information update module determines for calling the first animation to monitor function in the second animation opening module 230
After the execution animation value of one animation, control information is updated according to the execution animation value of the first animation.
Optionally, Android animation executive device, further includes:
First animation constructs module, is used for definition value animation types, and calls animation construction method, according to predefined the
First animation of the initial value of one animation and the end value building value animation types of the first animation;First animation opening module,
For calling animation open method to open the first animation.
Android animation executive device provided in this embodiment, the Android animation proposed with embodiment one execute method
Belong to same inventive concept, the technical detail of detailed description not can be found in embodiment one, and the present embodiment in the present embodiment
With the beneficial effect having the same of embodiment one.
Embodiment three
A kind of terminal is present embodiments provided, can be used for dynamically changing in the first animation implementation procedure the feelings of target value
Condition.Fig. 3 is a kind of structural schematic diagram for terminal that the embodiment of the present invention three provides.Referring to Fig. 3, which includes:
One or more processors 310;
Memory 320, for storing one or more programs;
When one or more of programs are executed by one or more of processors 310, so that one or more of
Processor 310 realizes that the Android animation proposed such as embodiment one executes method.
In Fig. 3 by taking a processor 310 as an example;Processor 310 and memory 320 can be connected by bus or other modes
It connects, in Fig. 3 for being connected by bus.
Memory 320 is used as a kind of computer readable storage medium, can be used for storing software program, journey can be performed in computer
Sequence and module, as the Android animation in the embodiment of the present invention executes the corresponding program instruction/module of method.Processor 310
By running the software program, instruction and the module that are stored in memory 320, thereby executing terminal various function application with
And data processing, that is, realize that above-mentioned Android animation executes method.
Memory 320 can mainly include storing program area and storage data area, wherein storing program area can store operation system
Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to terminal.This
Outside, memory 320 may include high-speed random access memory, can also include nonvolatile memory, for example, at least one
Disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, memory 320 can be into one
Step includes the memory remotely located relative to processor 310, these remote memories can pass through network connection to terminal.On
The example for stating network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
The Android animation that the terminal and embodiment one that the present embodiment proposes propose executes method and belongs to same invention structure
Think, the technical detail of detailed description not can be found in embodiment one in the present embodiment, and the present embodiment has with embodiment one
Identical beneficial effect.
Example IV
The present embodiment provides a kind of readable mediums, are stored thereon with computer program, real when which is executed by processor
Now the Android animation as embodiment one proposes executes method.
The Android animation that the readable medium and embodiment one that the present embodiment proposes propose executes method and belongs to same invention
Design, the technical detail of detailed description not can be found in embodiment one in the present embodiment, and the present embodiment and embodiment one have
There is identical beneficial effect.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention
It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but in many cases, the former is more
Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art
Part can be embodied in the form of software products, which can store in computer readable storage medium
In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer
Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are with so that a computer is set
Standby (can be personal computer, server or the network equipment etc.) executes method described in each embodiment of the present invention.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.
Claims (10)
1. a kind of Android animation executes method, which is characterized in that be applied in the first animation implementation procedure, comprising:
It receives target value and changes message, the end value of the second animation of message definition is changed according to the target value, it is dynamic according to first
The end value of picture defines the initial value of the second animation, and the unlatching of the second animation is arranged according to the initial value of second animation
Value, wherein the unlatching value of second animation is less than the initial value of second animation;
Animation construction method is called, it is dynamic according to the initial value of second animation and the end value of the second animation building second
It draws;
It calls the first animation to monitor the execution animation value that function determines the first animation, and is equal to second in the execution animation value and moves
When the unlatching value of picture, animation open method is called to open the second animation.
2. the method according to claim 1, wherein described dynamic according to target value change message definition second
The end value of picture defines the initial value of the second animation according to the end value of the first animation, comprising:
Message is changed according to the target and determines the target value after changing, and numerical value is called to define the end that method defines the second animation
Value is equal to the target value after changing;
The end value of predefined first animation is subtracted into preset value, numerical value is called to define the initial value that method defines the second animation
End value equal to the first animation subtracts the numerical value after preset value.
3. the method according to claim 1, wherein described according to the initial value of second animation setting second
The unlatching value of animation, comprising:
The initial value of second animation subtracts to the unlatching time-consuming value of second animation, and by the starting of second animation
The difference of the time-consuming value of the unlatching of value and second animation is set as the unlatching value of the second animation.
4. the method according to claim 1, wherein the first animation of the calling, which monitors function, determines the first animation
Execution animation value, comprising:
In the first animation implementation procedure, the first animation for adding in advance is called to monitor the readjustment monitor method in function, determines the
The execution animation value of one animation.
5. according to the method described in claim 4, it is characterized in that, the readjustment monitor method includes preset value animation types
Enter parameter animation;
Correspondingly, the first animation added in advance is called to monitor the readjustment monitor method in function, determine that the execution of the first animation is dynamic
Picture value, comprising:
The getAnimatedValue () method for calling the first animation added in advance to monitor in the readjustment monitor method in function obtains
It is taken into the current property value of ginseng parameter animation, the current property value is determined as to the execution animation value of the first animation.
6. the method according to claim 1, wherein monitoring function in the first animation of the calling determines that first is dynamic
After the execution animation value of picture, further includes:
Control information is updated according to the execution animation value of first animation.
7. the method according to claim 1, wherein before the reception target value changes message, further includes:
Definition value animation types, and animation construction method is called, it is dynamic according to the initial value of predefined first animation and first
First animation of the end value building value animation types of picture;
Animation open method is called to open the first animation.
8. a kind of Android animation executive device, which is characterized in that be applied in the first animation implementation procedure, comprising:
Numerical value definition module changes the second animation of message definition according to the target value for receiving target value change message
End value defines the initial value of the second animation according to the end value of the first animation, and is set according to the initial value of second animation
Set the unlatching value of the second animation, wherein the unlatching value of second animation is less than the initial value of second animation;
Second animation constructs module, dynamic according to the initial value of second animation and second for calling animation construction method
The end value of picture constructs the second animation;
Second animation opening module, for calling the first animation to monitor the execution animation value that function determines the first animation, and in institute
When stating unlatching value of the execution animation value equal to the second animation, animation open method is called to open the second animation.
9. a kind of terminal, which is characterized in that the terminal includes:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
Now the Android animation as described in any in claim 1-7 executes method.
10. a kind of readable medium, is stored thereon with computer program, which is characterized in that the realization when program is executed by processor
Android animation as described in any in claim 1-7 executes method.
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 true CN109064531A (en) | 2018-12-21 |
CN109064531B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111127602A (en) * | 2019-12-27 | 2020-05-08 | 珠海金山网络游戏科技有限公司 | Animation production method and device based on NGUI |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040222992A1 (en) * | 2003-05-09 | 2004-11-11 | Microsoft Corporation | System supporting animation of graphical display elements through animation object instances |
US20100313159A1 (en) * | 2009-06-05 | 2010-12-09 | Apple Inc. | Progress indicator for loading dynamically-sized contents |
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 |
-
2018
- 2018-08-01 CN CN201810864361.9A patent/CN109064531B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040222992A1 (en) * | 2003-05-09 | 2004-11-11 | Microsoft Corporation | System supporting animation of graphical display elements through animation object instances |
US20100313159A1 (en) * | 2009-06-05 | 2010-12-09 | Apple Inc. | Progress indicator for loading dynamically-sized contents |
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 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111127602A (en) * | 2019-12-27 | 2020-05-08 | 珠海金山网络游戏科技有限公司 | Animation production method and device based on NGUI |
CN111127602B (en) * | 2019-12-27 | 2023-07-04 | 珠海金山数字网络科技有限公司 | Animation production method and device based on NGUI |
Also Published As
Publication number | Publication date |
---|---|
CN109064531B (en) | 2023-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210357759A1 (en) | Task processing method and device based on neural network | |
CN109462769A (en) | Direct broadcasting room pendant display methods, device, terminal and computer-readable medium | |
CN111800285B (en) | Instance migration method and device and electronic equipment | |
CN110860086B (en) | Data processing method, readable storage medium, and electronic device | |
WO2021161174A1 (en) | Preloading of applications and in-application content in user devices | |
CN110413346A (en) | A kind of parameter updating method and device | |
CN103530898B (en) | A kind of animation processing method and system based on 3D real-time renderings | |
CN107678918B (en) | OSD heartbeat mechanism setting method and device of distributed file system | |
CN106022108B (en) | A kind of synchronization management method and terminal device | |
CN110955499A (en) | Processor core configuration method, device, terminal and storage medium | |
CN109064531A (en) | Android animation executes method, apparatus, terminal and readable medium | |
CN107222618A (en) | Terminal screenshotss method and device | |
CN111625322A (en) | Data processing method, system and equipment | |
CN109144638A (en) | Android horizontal/vertical screen method of data synchronization, device, terminal and readable medium | |
CN109086115A (en) | Android animation executes method, apparatus, terminal and readable medium | |
CN106874010A (en) | A kind of method of the quick paging loadings of ListView in android system | |
CN110413332A (en) | Timed task executes method, apparatus, terminal and computer-readable medium | |
CN104636205B (en) | A kind of method and apparatus that task is seized | |
CN106598726A (en) | Multi-task management system and distributed deployment method thereof | |
CN114301909B (en) | Edge distributed management and control system, method, equipment and storage medium | |
CN110377140A (en) | Method, apparatus, terminal and the storage medium of wake operation system | |
CN109165067A (en) | Android horizontal/vertical screen method of data synchronization, device, terminal and readable medium | |
CN113805954A (en) | Screen saver display method, electronic device, and computer storage medium | |
CN109144611B (en) | Android definition switching method and device, terminal and readable medium | |
Shi et al. | Team coordination under individual and team goals |
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 |