CN107577499B - Implementation method for executing different-attribute animation on multiple views - Google Patents

Implementation method for executing different-attribute animation on multiple views Download PDF

Info

Publication number
CN107577499B
CN107577499B CN201710873311.2A CN201710873311A CN107577499B CN 107577499 B CN107577499 B CN 107577499B CN 201710873311 A CN201710873311 A CN 201710873311A CN 107577499 B CN107577499 B CN 107577499B
Authority
CN
China
Prior art keywords
animation
executed
attribute
animations
views
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
CN201710873311.2A
Other languages
Chinese (zh)
Other versions
CN107577499A (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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201710873311.2A priority Critical patent/CN107577499B/en
Publication of CN107577499A publication Critical patent/CN107577499A/en
Priority to PCT/CN2018/097844 priority patent/WO2019056857A1/en
Application granted granted Critical
Publication of CN107577499B publication Critical patent/CN107577499B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Abstract

The invention provides a method for implementing different-attribute animation on multiple views. The method comprises the following steps: setting at least 1 ViewAnamator for a plurality of views on a page, which need to execute attribute animation, by adopting a chain operation method, wherein each ViewAnamator manages at least 1 AnamatorBuilder, and each AnamatorBuilder comprises an animation set consisting of 1 or more attribute animations and at least 1 view for managing the attribute animation to be executed; when each animalorb builder begins to be executed, the animalorb builder traverses all views managed by the animalorb builder, so that corresponding 1 or more property animations in the animation collection contained in the animalorb builder are executed on at least 1 view managed by the animalorb builder.

Description

Implementation method for executing different-attribute animation on multiple views
Technical Field
The invention relates to the technical field of information processing, in particular to a method for implementing different-attribute animations on multiple views.
Background
The current Android system provides 3 animation types: frame animation, complement animation, and attribute animation. Developers are easy to implement when performing property animation on a single View (View). However, in the actual development process, multiple views in the same page may set different attributes at the same time, and multiple animations with different attributes are executed in serial/parallel. In the existing method, although one View analyzer can be set for each View, and then the attribute animations of different views are managed in a unified manner through an analyzer set, unnecessary development burden is increased in readability and expansibility of program codes, each View needs to have a View analyzer, and the attribute animations included in a plurality of View analyzers need to be managed through the analyzer set, which causes that the code amount is very large, and the attribute animations of the plurality of views, especially the different attribute animations, cannot be easily realized.
Disclosure of Invention
The invention aims to provide a development method and a development device for executing animation with different properties on a plurality of views so as to improve the problems.
The first embodiment of the present invention provides an implementation method for executing different attribute animations on multiple views, which includes:
setting at least 1 ViewAnamator for a plurality of views on a page, which need to execute attribute animation, by adopting a chain operation method, wherein each ViewAnamator manages at least 1 AnamatorBuilder, and each AnamatorBuilder comprises an animation set consisting of 1 or more attribute animations and at least 1 view for managing the attribute animation to be executed;
when each animalorb builder begins to be executed, the animalorb builder traverses all views managed by the animalorb builder, so that corresponding 1 or more property animations in the animation collection contained in the animalorb builder are executed on at least 1 view managed by the animalorb builder.
When a plurality of ViewAnimators are set, a chain operation method is adopted to set serial and/or parallel relations among the plurality of ViewAnimators according to execution requirements of animations with different attributes.
When the animaltorBuilder managed by 1 ViewAnimator in the plurality of viewanimators is completely executed according to the set serial relation, executing the animaltorBuilder managed by the next 1 ViewAnimator by a callback method; when a plurality of ViewAnamators needing to be executed are set to be in a parallel relationship, the AnamatorBuilder managed by each of the ViewAnamators is executed simultaneously.
Wherein, in the ViewAnaimator, the attribute animation is executed in parallel on a plurality of views on which the attribute animation needs to be executed by using an andAnnimate () method, and the attribute animation is executed in series on a plurality of views on which the attribute animation needs to be executed by using the ThenAnimate ().
When the attribute animation included in the animation set is multiple, the multiple attribute animations are attribute animations with different attributes.
Wherein all property animations in the animation collection contained in each animalorbuilder are managed by animalorset.
When the AnatomBuilder traverses all views managed by the AnatomBuilder, a loop traversal mode is adopted, namely, when 1 attribute animation in the animation set contained in the AnatomBuilder needs to be executed, all views managed by the AnatomBuilder are traversed once, and the attribute animation is executed on at least 1 view which needs to execute the attribute animation.
When the design is required to simultaneously execute a plurality of attribute animations in the animation set contained in the animaltobuilder, all the views managed by the animaltobuilder are traversed once when the plurality of attribute animations in the animation set contained in the animalobuilder need to be simultaneously executed, and the plurality of attribute animations are simultaneously executed on at least 1 view which needs to simultaneously execute the plurality of attribute animations.
Wherein each managed animalorbuilder is executed in parallel when 1 viewanimalctor manages a plurality of animalorbuilders.
A second embodiment of the invention provides a storage device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method according to the first embodiment or the combination of the first embodiment and its preferred embodiments.
According to the implementation method for executing the animation with different attributes on the multiple views, the design idea of chain-type program code construction is adopted, and the multiple views of the animation with the attributes needing to be executed can be completed on one execution link in a serial/parallel execution mode, so that the execution of the animation with the attributes of the multiple views of the animation becomes simple, the code readability is strong, the code is concise, the code quantity is small, the time cost for developers to develop the animation is greatly reduced, and the development efficiency is improved.
Drawings
FIG. 1 is a flowchart of a development method for performing different-property animations on multiple views according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention and the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
FIG. 1 is a flow chart of a method for performing different property animations for multiple views according to an embodiment of the present invention. As shown in FIG. 1, the method of the present invention for performing different property animation on multiple views comprises:
s1: setting at least 1 ViewAnamator for a plurality of views on a page, which need to execute attribute animation, by adopting a chain operation method, wherein each ViewAnamator manages at least 1 AnamatorBuilder, and each AnamatorBuilder comprises an animation set consisting of 1 or more attribute animations and at least 1 view for managing the attribute animation to be executed.
Specifically, the implementation method related by the invention is that at least 1 ViewAnamator object is set for a plurality of views on a page, which need to execute attribute animation, by adopting a chain programming operation mode, and when a plurality of ViewAnamator objects are set, serial and/or parallel relations among the plurality of ViewAnamators can be set by adopting a chain operation method according to execution requirements of different attribute animations. In a plurality of views on a page, which need to execute attribute animation, at least 2 views need to execute the attribute animation simultaneously (in parallel), some views need to execute the attribute animation sequentially (in series), an andranimate () method is used in the ViewAnamator to execute the attribute animation in parallel on the plurality of views, which need to execute the attribute animation, and the tannanimate () is used to execute the attribute animation in series on the plurality of views, which need to execute the attribute animation.
When each ViewAnamator is set, at least 1 AnamatorBuilder is required to be managed by each ViewAnamator, the role of the AnamatorBuilder is to construct basic attribute animation, and different animation effects can be constructed for each different ViewAnamator. Each AnatomBuilder contains an animation collection consisting of 1 or more property animations and at least 1 View (View) for managing the property animations to be executed. In programming, ViewAnamator, as a tool class, manages 1 or more AnamatorBuilders, which can manage at least 1 View (View) on 1 or more applications, especially at least 1 View that needs to perform property animation. The animalorb builder can manage at least 1 View (View) that needs to perform property animation by a parameter passing design way, for example:
Figure BDA0001417577750000041
examples are: the views of the views are read by passing parameters View1, View2, View3 and View4 through the Anatombuilder and any views manager (View1, View2, View3 and View4), and accordingly 4 corresponding views can be read, and more or fewer views can be read. When the animation set comprises a plurality of attribute animations, the attribute animations are the attribute animations with different attributes. In addition, all property animations in the animation collection contained in each animaltobuilder are managed by an animaltset component, which is used to describe the property animations that are executed on the views.
S2: when each animalorb builder begins to be executed, the animalorb builder traverses all views managed by the animalorb builder, so that corresponding 1 or more property animations in the animation collection contained in the animalorb builder are executed on at least 1 view managed by the animalorb builder.
When the program runs to start executing each animalorb builder managed by the set 1 or more viewanimalorbs, the executed animalorb builder reads the corresponding 1 or more attribute animations animalorb in the animation set contained in the executed animalorb builder, traverses all views managed by the animalorb builder and executes the corresponding attribute animations animalorb on the views which need to execute the read attribute animations animalorb.
When the AnatomBuilder traverses all views managed by the AnatomBuilder, a loop traversal mode is adopted, namely, when 1 attribute animation in the animation set contained in the AnatomBuilder needs to be executed, all views managed by the AnatomBuilder are traversed once, and the attribute animation is executed on at least 1 view which needs to execute the attribute animation. Furthermore, the animalorbuilder traverses all views managed by the animalorbuilder in a loop traversal mode, and if multiple property animations are executed on 1 or more views simultaneously in the requirement design, all views managed by the animalorbuilder may be traversed once whenever multiple property animations in the animation set included in the animalorbuilder are required to be executed simultaneously, and the multiple property animations are executed on at least 1 view required to be executed simultaneously.
In addition, when 1 ViewAnimator manages a plurality of animalrbuilers, each of the managed animalrbuilers is executed in parallel.
In a preferred embodiment, when a chain operation method is adopted to set a plurality of ViewAnamator objects for a plurality of views on a page, which need to execute attribute animation, in setting serial and/or parallel relations among the plurality of ViewAnamators by adopting the chain operation method according to execution requirements of different attribute animations, executing the Anamatorbuilder managed by the next 1 ViewAnamator by a callback method according to the set serial relations when the Anamatorbuilder managed by 1 ViewAnamator in the plurality of ViewAnamators is completely executed; when a plurality of ViewAnamators needing to be executed are set to be in a parallel relationship, the AnamatorBuilder managed by each of the ViewAnamators is executed simultaneously.
According to the implementation method for executing the animation with different attributes on the multiple views, the design idea of chain-type program code construction is adopted, and the multiple views of the animation with the attributes needing to be executed can be completed on one execution link in a serial/parallel execution mode, so that the execution of the animation with the attributes of the multiple views of the animation becomes simple, the code readability is strong, the code is concise, the code quantity is small, the time cost for developers to develop the animation is greatly reduced, and the development efficiency is improved.
The computer program product for executing a method for animation with different attributes on multiple views provided by the embodiment of the present invention includes a computer readable storage medium storing program codes, where instructions included in the program codes may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment, and will not be described herein again.
To this end, the invention also provides a storage device having stored therein a plurality of instructions adapted to be loaded by a processor and to carry out the method according to the first embodiment or the method according to the first embodiment in combination with the preferred embodiment.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a smart tablet, a smart phone, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (7)

1. An implementation method of performing different-attribute animation on multiple views, comprising:
setting at least 1 ViewAnamator for a plurality of views on a page, which need to execute attribute animation, by adopting a chain operation method, wherein when the plurality of ViewAnamators are set, serial and/or parallel relations among the plurality of ViewAnamators are set by adopting the chain operation method according to execution requirements of different attribute animations, each ViewAnamator manages at least 1 AnamatorBuilder, each AnamatorBuilder comprises an animation set consisting of 1 or more attribute animations and at least 1 view for managing the attribute animation needing to be executed, all attribute animations in the animation set contained in each AnamatorBuilder are managed by Anamatorset, and an Anamator component is used for describing the attribute animation executed on the view;
when each animalorb builder starts to be executed, the animalorb builder traverses all views managed by the animalorb builder in a loop traversal mode, namely, all views managed by the animalorb builder are traversed once each time 1 property animation in the animation collection contained by the animalorb builder needs to be executed, and the property animation is executed on at least 1 view needing to execute the property animation, so that corresponding 1 or more property animations in the animation collection contained by the animalorb builder are executed on at least 1 view managed by the animalorb builder.
2. The method according to claim 1, wherein the animaltobuilder managed by the next 1 ViewAnimator is executed by a callback method when the animaltobuilder managed by the 1 ViewAnimator of the plurality of viewanimators is completely executed according to the set serialization relation; when a plurality of ViewAnamators needing to be executed are set to be in a parallel relationship, the AnamatorBuilder managed by each of the ViewAnamators is executed simultaneously.
3. The method of claim 1, wherein the property animation is executed in parallel on the plurality of views on which the property animation needs to be executed using an andAnimate () method and is executed in series on the plurality of views on which the property animation needs to be executed using the ananimate ().
4. The method according to claim 1, wherein when the animation set includes a plurality of attribute animations, the plurality of attribute animations are attribute animations of different attributes.
5. The method of claim 1, wherein when the design-on-demand requires the simultaneous execution of multiple property animations on 1 or more views, all views managed by the animaltobuilder are traversed once each time the simultaneous execution of multiple property animations from the animation collection contained in the animalobuilder is required, the multiple property animations being executed simultaneously on at least 1 view required to execute the multiple property animations simultaneously.
6. The method of any of claims 1-5, wherein each managed animalorb builder is executed in parallel when there are multiple animalorb builders managed by 1 viewanimalorb.
7. A memory device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method according to any one of claims 1 to 6.
CN201710873311.2A 2017-09-25 2017-09-25 Implementation method for executing different-attribute animation on multiple views Active CN107577499B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710873311.2A CN107577499B (en) 2017-09-25 2017-09-25 Implementation method for executing different-attribute animation on multiple views
PCT/CN2018/097844 WO2019056857A1 (en) 2017-09-25 2018-08-01 Method for realizing execution of different property animations for multiple views, apparatus and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710873311.2A CN107577499B (en) 2017-09-25 2017-09-25 Implementation method for executing different-attribute animation on multiple views

Publications (2)

Publication Number Publication Date
CN107577499A CN107577499A (en) 2018-01-12
CN107577499B true CN107577499B (en) 2021-06-04

Family

ID=61039157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710873311.2A Active CN107577499B (en) 2017-09-25 2017-09-25 Implementation method for executing different-attribute animation on multiple views

Country Status (2)

Country Link
CN (1) CN107577499B (en)
WO (1) WO2019056857A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577499B (en) * 2017-09-25 2021-06-04 阿里巴巴(中国)有限公司 Implementation method for executing different-attribute animation on multiple views

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105427358A (en) * 2015-12-23 2016-03-23 武汉斗鱼网络科技有限公司 View animation generation method and system based on Android
CN106610828A (en) * 2015-10-21 2017-05-03 广州市动景计算机科技有限公司 Method and device for playing GIF animation based on Android system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130278607A1 (en) * 2012-04-20 2013-10-24 A Thinking Ape Technologies Systems and Methods for Displaying Animations on a Mobile Device
CN107577499B (en) * 2017-09-25 2021-06-04 阿里巴巴(中国)有限公司 Implementation method for executing different-attribute animation on multiple views

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106610828A (en) * 2015-10-21 2017-05-03 广州市动景计算机科技有限公司 Method and device for playing GIF animation based on Android system
CN105427358A (en) * 2015-12-23 2016-03-23 武汉斗鱼网络科技有限公司 View animation generation method and system based on Android

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ViewAnimator源码分析;达达达达sky;《https://www.jianshu.com/p/749c4531d108》;20160326;第4-10页 *

Also Published As

Publication number Publication date
WO2019056857A1 (en) 2019-03-28
CN107577499A (en) 2018-01-12

Similar Documents

Publication Publication Date Title
US9792354B2 (en) Context aware user interface parts
US8024711B2 (en) Software analysis tool
CN106909361B (en) Web development method and device based on template engine
CN110471754B (en) Data display method, device, equipment and storage medium in job scheduling
CN112765023A (en) Test case generation method and device
CN107577499B (en) Implementation method for executing different-attribute animation on multiple views
CN113485840A (en) Multi-task parallel processing device and method based on Go language
CN111598988B (en) D3-based method and system for rendering knowledge graph data nodes
CN115809056B (en) Component multiplexing implementation method and device, terminal equipment and readable storage medium
US9230022B1 (en) Customizable result sets for application program interfaces
CN115454785A (en) VScode-based graphical real-time monitoring and management method for host performance
CN110347471B (en) Hierarchical display component system, display component calling method and device
Inayatullah et al. Model-based scaffolding code generation for cross-platform applications
CN113051333A (en) Data processing method and device, electronic equipment and storage medium
CN107506299B (en) Code analysis method and terminal equipment
CN115543323B (en) Page development method and device
CN112579082A (en) Interactive state data establishing method and device, storage medium and electronic equipment
Weiss et al. Introducing the QCEP-testing system for executable acceptance test driven development of complex event processing applications
CN109144500B (en) Skin file processing method based on graphical programming and electronic equipment
CN110020066B (en) Method and device for annotating tasks to crawler platform
Tong et al. Comparative Performance Analysis of Javascript Frontend Web Frameworks
US20220100631A1 (en) Microservices graph generation
CN113656290A (en) Mock point automatic identification method, device and equipment
CN116610451A (en) Processing method and device for assemblable report, computer equipment and storage medium
CN117951400A (en) Page processing method, device, electronic equipment and storage medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200902

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping square B radio tower 15 layer self unit 02

Applicant before: GUANGZHOU UC NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant