All Projects → florent37 → Viewanimator

florent37 / Viewanimator

Licence: apache-2.0
A fluent Android animation library

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Viewanimator

android-animations
Perform tweened animations such as Attention, Bounce, Fade, Flip, Rotate, Slide and Zoom on Views
Stars: ✭ 118 (-95.56%)
Mutual labels:  view, viewanimator
FeedbackAnimSample
An attempt to code feedback animation UI inspired from https://site.uplabs.com/posts/web-feedback
Stars: ✭ 57 (-97.85%)
Mutual labels:  view, viewanimator
Swiftconfettiview
Swift Confetti View ! Who doesn't like confetti? 🎉🎉
Stars: ✭ 193 (-92.73%)
Mutual labels:  view
Flexml
🚀基于Litho的Android高性能动态业务容器。
Stars: ✭ 225 (-91.53%)
Mutual labels:  view
Revealbanner
🚀🚀🚀 滑动特效banner
Stars: ✭ 209 (-92.13%)
Mutual labels:  view
Wiv
Window image viewer [DEPRECATED]
Stars: ✭ 196 (-92.62%)
Mutual labels:  view
Foregroundviews
Views that supports a foreground, like FrameLayout does
Stars: ✭ 215 (-91.91%)
Mutual labels:  view
Stepviewandroid
An Android library (Step View) written in kotlin to display steps (without any max-min limits) along with the status/description using a single view. It also supports some really cool features.
Stars: ✭ 191 (-92.81%)
Mutual labels:  view
Shadowimageview
🔥可以根据图片内容变阴影颜色,更加细腻的阴影效果 It can change color according to the picture, more delicate shadow effect
Stars: ✭ 2,560 (-3.61%)
Mutual labels:  view
Artist
An artist creates views. Artist is a Gradle plugin that codegens a base set of Android Views.
Stars: ✭ 208 (-92.17%)
Mutual labels:  view
Transition
Easy interactive interruptible custom ViewController transitions
Stars: ✭ 2,566 (-3.39%)
Mutual labels:  view
Weathericonview
Weather Icon View for Android applications
Stars: ✭ 206 (-92.24%)
Mutual labels:  view
Pagemenulayout
【Android分页菜单控件】快速实现美团、饿了么、京东、淘宝首页分页菜单效果
Stars: ✭ 197 (-92.58%)
Mutual labels:  view
Goview
Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.
Stars: ✭ 213 (-91.98%)
Mutual labels:  view
Shimmer Recyclerview X
🌀 ShimmerRecyclerViewX for AndroidX
Stars: ✭ 193 (-92.73%)
Mutual labels:  view
Laravel Tag Helper
Add powerful HTML tag helpers to your Laravel application
Stars: ✭ 227 (-91.45%)
Mutual labels:  view
React Native Popover View
A well-tested, adaptable, lightweight <Popover> component for react-native
Stars: ✭ 191 (-92.81%)
Mutual labels:  view
Codeview
Android Code Highlighter
Stars: ✭ 204 (-92.32%)
Mutual labels:  view
Facon
Tiny utility (272B) to create DOM elements with manner.
Stars: ✭ 212 (-92.02%)
Mutual labels:  view
Slidemenulayout
🔥An android slide menu that supports left and right swipes and slides with parallax.(一个支持左右滑动并带有视差滑动效果的安卓侧滑菜单控件.仿[QQ/探探侧滑])
Stars: ✭ 235 (-91.15%)
Mutual labels:  view

ViewAnimator

API Android Arsenal

A fluent Android animation library !

Android app on Google Play

png

Usage

Animate multiple view from one method

ViewAnimator
       .animate(image)
            .translationY(-1000, 0)
            .alpha(0,1)
       .andAnimate(text)
            .dp().translationX(-20, 0)
            .decelerate()
            .duration(2000)
       .thenAnimate(image)
            .scale(1f, 0.5f, 1f)
            .accelerate()
            .duration(1000)
       .start();
       

gif

Without ViewAnimator

AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(
  ObjectAnimator.ofFloat(image,"translationY",-1000,0),
  ObjectAnimator.ofFloat(image,"alpha",0,1),
  ObjectAnimator.ofFloat(text,"translationX",-200,0)
);
animatorSet.setInterpolator(new DescelerateInterpolator());
animatorSet.setDuration(2000);
animatorSet.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationEnd(Animator animation) {

      AnimatorSet animatorSet2 = new AnimatorSet();
      animatorSet2.playTogether(
          ObjectAnimator.ofFloat(image,"scaleX", 1f, 0.5f, 1f),
          ObjectAnimator.ofFloat(image,"scaleY", 1f, 0.5f, 1f)
      );
      animatorSet2.setInterpolator(new AccelerateInterpolator());
      animatorSet2.setDuration(1000);
      animatorSet2.start();

    }
});
animatorSet.start();

More

gif

Add same animation on multiples view

ViewAnimator
       .animate(image,text)
       .scale(0,1)
       .start();

Add listeners

ViewAnimator
       .animate(image)
       .scale(0,1)
       .onStart(() -> {})
       .onStop(() -> {})
       .start();

Use DP values

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

Animate Height / Width

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();

Cancel animations

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

viewAnimator.cancel();

Enhanced animations (Thanks AndroidViewAnimations and NiftyDialogEffects )

.shake().interpolator(new LinearInterpolator());
.bounceIn().interpolator(new BounceInterpolator());
.flash().repeatCount(4);
.flipHorizontal();
.wave().duration(5000);
.tada();
.pulse();
.standUp();
.swing();
.wobble();

... Preview

Path animations ( Inspiration from http://blog.csdn.net/tianjian4592/article/details/47067161 )

    final int[] START_POINT = new int[]{ 300, 270 };
    final int[] BOTTOM_POINT = new int[]{ 300, 400 };
    final int[] LEFT_CONTROL_POINT = new int[]{ 450, 200 };
    final int[] RIGHT_CONTROL_POINT = new int[]{ 150, 200 };
    Path path = new Path();
    path.moveTo(START_POINT[0], START_POINT[1]);
    path.quadTo(RIGHT_CONTROL_POINT[0], RIGHT_CONTROL_POINT[1], BOTTOM_POINT[0], BOTTOM_POINT[1]);
    path.quadTo(LEFT_CONTROL_POINT[0], LEFT_CONTROL_POINT[1], START_POINT[0], START_POINT[1]);
    path.close();
    ViewAnimator.animate(view).path(path).repeatCount(-1).start();

Download

Buy Me a Coffee at ko-fi.com

Add into your build.gradle

Download

compile 'com.github.florent37:viewanimator:1.1.0'

Community

Looking for contributors, feel free to fork !

Credits

Author: Florent Champigny
Contributor: 李玉江(liyujiang)

Fiches Plateau Moto : https://www.fiches-plateau-moto.fr/

Android app on Google Play 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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].