Animate of chrome View

Source: Internet
Author: User

Chrome animation Mechanism

 

Animation first needs to create a container for Time Scheduling. Here is the animation container.

This class uses base: repeatingtimer to set settimer, and then calls back

To run ()

Timer _. Start (min_timer_interval _, this, & animationcontainer: Run );

Run ()

{

Elements elements = elements _;

 

For (elements: const_iterator I = elements. Begin (); I! = Elements. End (); ++ I)

{

// Make sure that the element is valid.

If (elements _. Find (* I )! = Elements _. End ())

{

(* I)-> step (current_time );

}

}

In run, all elements are cyclically called and their step methods are called,

(* I)-> step (current_time );

These elements are specific animation objects, such as linearanimation and multianimation.

In this example, State _ is set based on the proportion of the consumed time to the total time.

Delegate ()-> animationprogressed (this );

A process is complete.

 

Instance

First, a class needs to inherit the animate: deletegate to have the ability to accept> animationprogressed.

Then, this class needs to be set to an animationcontainer, new, ready-to-use, or

With the time management class, you also need to create a specific animation behavior, such as slideanimation. This class needs to set the container

Then you can call show-> Start-> container. Start-> timer. settimer of animation.

During container. Start, the animation will be added to elements.

Then, ontimer-> container. Run-> element. Step-> delegate.> animationprogressed

 

 

I am still not used to writing C ++ in this way. I need so many features and so many combinations. You set me and I set you and it feels messy.

But this is from Google.CodeIt should be of high standards.

Deletgate contains the container and the specific animation. Then, the container and animation are mutually owned and the execution process is also

A large stack call, the actual operation found that this animation is also occupying Resources

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.