Git Product home page Git Product logo

arcanimator's Introduction

ArcAnimator

ArcAnimator helps to create arc transition animation: 14+

|

ArcAnimator Demo | TransitionLoop Demo*

*TransitionLoop Prototype by Min-Sang Choi Dribbble

Usage

Add the library to your project:

  compile 'com.github.asyl.animation:arcanimator:1.0.0'

Then use it in your project code:

  //set up clipView and coordinates where clipView will move
  ArcAnimator.createArcAnimator(clipView, endX, endY, DEGREE, SIDE)
                    .setDuration(500)
                    .start();
  
  //or specify nestView for clipView. Animator will take center x,y coordinates of nestView
  ArcAnimator.createArcAnimator(clipView, nestView, DEGREE, SIDE)
                    .setDuration(500)
                    .start();

Download

JitPack

To include this library in your project add to your build.gradle:

	repositories {
	    maven { url "https://jitpack.io" }
	}
	
	dependencies {
	    compile 'com.github.asyl:ArcAnimator:v1.0.0'
	}

Dependency

  • Ozodrukh's CircularReveal helped to create awesome TransitionLoop Demo

Thanks

I want to thank Sherzod Agzamov for helping to solve some Geometry problems & Ozodrukh for support and tips that help to make this library.

License

The MIT License (MIT)

Copyright (c) 2015 Asylbek Isakov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

arcanimator's People

Contributors

asyl avatar giolin avatar jitpack-io avatar korsander avatar laggedhero avatar maxirosson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arcanimator's Issues

side when using ArcAnimator

Hello

I'm trying to use this library for displaying realtime degree(-90 to 90) from sensor.

So I made a method like below.

When I set -90 degree (defualt is 0), mSide is set as Side.RIGHT.

Problem is when I run this application (for 3 cases: -90, 0, 90), it goes clockwise direction

So help me please. Sorry for poor English

int [] xy0 = {500, 45};
int [] xyN90 = {45, 510};
int [] xyP90 = {950, 510};
int previousDegree = 0;

private void nowDegree(int nowDegree){
    int x = 0 , y = 0;
    setSide(nowDegree);
    startX = ViewHelper.getTranslationX(mIvNow);
    startY = ViewHelper.getTranslationY(mIvNow);
    ViewHelper.setTranslationX(mIvNow, startX);
    ViewHelper.setTranslationY(mIvNow, startY);

    if(nowDegree == -90){
        x = xyN90[0];
        y = xyN90[1];
    }else if(nowDegree == 0){
        x = xy0[0];
        y = xy0[1];
    }else if(nowDegree == 90){
        x = xyP90[0];
        y = xyP90[1];
    }

    ArcAnimator arcAnimator = ArcAnimator.createArcAnimator(mIvNow, x, y, Math.abs(nowDegree-previousDegree), mSide)
            .setDuration(1000);
    arcAnimator.start();
    mIvNow.setX(x);
    mIvNow.setY(y);
    previousDegree = nowDegree;
}

private void setSide(int degree){
    if(degree>previousDegree)
        mSide = Side.LEFT;
    else
        mSide = Side.RIGHT;
}

Sample app crashes

Sample app crashes when animation is completed.

java.lang.IllegalArgumentException: View must be inside RevealFrameLayout or RevealLinearLayout.
            at io.codetail.animation.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:52)
            at io.codetail.arcsample.TransitionLoopFragment.appearBluePair(TransitionLoopFragment.java:95)
            at io.codetail.arcsample.TransitionLoopFragment$1$1.onAnimationEnd(TransitionLoopFragment.java:82)
            at com.nineoldandroids.animation.ValueAnimator.endAnimation(ValueAnimator.java:1034)
            at com.nineoldandroids.animation.ValueAnimator.access$900(ValueAnimator.java:43)
            at com.nineoldandroids.animation.ValueAnimator$AnimationHandler.handleMessage(ValueAnimator.java:669)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4745)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)

Closed

I could not understand why so many stars here for this library? :-)

Update README.md file

Sample code below will not compile since start() method doesn't return ArcAnimator object.

ArcAnimator arcAnimator = ArcAnimator.createArcShift(clipView, endX, endY, DEGREE, SIDE)
                    .setDuration(500)
                    .start();
``

Preparing and starting animation separately

Hey,

I want to use the ArcAnimator library in my app for animating a fab button. However I am unable to set it up the way I like it.

In my code I use the ArcAnimator as follows but it does not work.

private ArcAnimator animation;

public void prepareAnim() {
animation = ArcAnimator.createArcAnimator(
fab,
x,
y,
FAB_ANIM_ANGLE,
FAB_ANIM_SIDE
);
animation.setDuration(FAB_ANIM_DURATION);
}

public void runAnim() {
animation.start();
}

@OverRide
protected void onCreate() {
......
prepareAnim();
Button button = ......;
button.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View
runAnim();
}
});
}

....

}

This does not seem to work. I do not want to setup the animation and then immediately run it when I press the button because it causes a small delay in the animation on older devices. So instead I'm setting up the animation before hand.

Can you please help me out understand how I can get this to work?

Sent from Mailbird

Signed Apk Issue

Hello I face a problem after i generate a signed APK, The animation not works my minimum SDK 17

NineOldAndroids dependency

Hello, I looked at NineOldAndroids repository and saw that author said this:

NineOldAndroids is deprecated. No new development will be taking place. Existing versions will (of course) continue to function. New applications should use minSdkVersion="14" or higher which has access to the platform animation APIs.

ArcAnimator suports API>=14, so looks like you can remove this dependency, or this is will require too much work or API of NineOldAndroids is much nice then system provided? Do you have any plans on this?

I am asking because some other libraries depend on ArcAnimator and nineoldandroid increases method count.

Proguard

I've had problems using proguard, I've solved adding the rule:
-keep class io.codetail.animation.arcanimator.** { *; }

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.