Skip to content

kholam/ViewAnimator

 
 

Repository files navigation

ViewAnimator

#Usage

Animate multiple view from one method

ViewAnimator
       .animate(image)
           .translationY(1000, 0)
           .alpha(0,1)

       .andAnimate(text)
           .translationX(-200, 0)

       .descelerate()
       .duration(2000)

       .onStart(() -> {})
       .onStop(() -> {})

       .start();

#Animation Queue

ViewAnimator
       .animate(image)
              .alpha(0, 1).descelerate().duration(1000),
       .thenAnimate(text)
               .scale(0, 1).accelerate().duration(300)
       .start();

#More

Using DP values

ViewAnimator
       .animate(image)
           .dp().translationY(-200, 0)
       .start();

Animate Height/Width values

ViewAnimator
       .animate(view)
           .waitForHeight() //wait until a ViewTreeObserver notification
           .dp().width(100,200)
           .dp().height(50,100)
       .start();

Color animations

ViewAnimator
       .animate(view)
            .textColor(Color.BLACK,Color.GREEN)
            .backgroundColor(Color.WHITE,Color.BLACK)
       .start();

Rotation animations

ViewAnimator
       .animate(view)
            .rotation(360)
       .start();

Custom animations

ViewAnimator
       .animate(text)
           .custom(new AnimationListener.Update<TextView>() {
               @Override public void update(TextView view, float value) {
                   view.setText(String.format("%.02f",value));
               }
           }, 0, 1)
       .start();

Community

Looking for contributors, feel free to fork !

Credits

Author: Florent Champigny

Follow me on Google+ Follow me on Twitter Follow me on LinkedIn

License

Copyright 2015 florent37, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%