GithubHelp home page GithubHelp logo

hcangus / viewaniamtion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guohuanwen/viewaniamtion

0.0 2.0 0.0 6.26 MB

make your animation of view,AnimatorSet,demo has a animation of tencent's qq

Java 95.77% MATLAB 4.23%

viewaniamtion's Introduction

Android Gems

ViewAnimation


This is a library of the AnimatorSet,it has three move path and many animation,you can make a easy animation of view by youself.
##animation of View
i did not finish it at this time

##Demo ![](https://github.com/guohuanwen/ViewAniamtion/blob/master/sreenshots/AnimationGif.gif)

##MovePath
任意圆弧运动
Any circular motion
List list=movePath.getCurveData(new float[]{200, 200}, 40, 1);
第一个参数:结束点坐标;第二个参数:曲率半径;第三个参数:弯曲方向
first param:end coordinate;second param:Radius of curvature;third param:curve direction


##Interpolator

####Direction

####Rate

####Code test1:
public float setMy(float param) {
float y=new BezierInterpolatorData().bezierDataWithoutRate(new float[]{0,0.5,1},new int[]{1,0},param);
return y;
}

####Code test2:
public float setMy(float param) {
float y=new BezierInterpolatorData().bezierDataWithoutRate(new float[]{0,0.5,0.8,1},new int[]{0,1,0},param);
return y;
}

##Usage
####cope mylibrary to your project
###methd ####MyAnimation #####setScaleX #####setScaleY #####setRotation #####setRotationX #####setRotationY #####setAlpha #####setTranslation

####MovePath #####getRandomData #####getCurveData #####getCirlcrData

##dont move animation(button is your view)

AnimatorSet animatorSet=new AnimatorSet();
MyAnimation myAnimation=new MyAnimation();
List list=new ArrayList();
list.add(moveAnimation.setAlpha(button, 0.2f, 1000));
list.add(moveAnimation.setRotation(button, 360, 1000));
list.add(moveAnimation.setScaleX(button, 2, 1000));
animatorSet.playTogether(list);
animatorSet.start();

##move view AnimatorSet animatorSet=new AnimatorSet(); MyAnimation myAnimation=new MyAnimation(); MovePath movePath=new MovePath(); //return List of coordinate List coordinateList=movePath.getCurveData(new float[]{200, 200}, 40, 1); //list of x List listX=(List)coordinateList.get(0); //list of y List listY=(List)coordinateList.get(1); List list=new ArrayList(); list.add(moveAnimation.setTranslation(button, listX, listY, 1000)); list.add(moveAnimation.setAlpha(button, 0.2f, 1000)); list.add(moveAnimation.setRotation(button, 360, 1000)); list.add(moveAnimation.setScaleX(button, 2, 1000)); animatorSet.playTogether(list); animatorSet.start();

##License Copyright 2014 guohuanwen

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.

viewaniamtion's People

Contributors

guohuanwen avatar liaohuqiu avatar pineapple2333 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.