Giter Site home page Giter Site logo

Comments (5)

sheharyarn avatar sheharyarn commented on June 8, 2024 1

Okay, with a little messing around, I was able to fix it. I changed ObjectAnimator to Animator. This is my code:

if (reveal.isNativeAnimator()) {
    Animator a = (Animator) reveal.get();
    a.addListener(new Animator.AnimatorListener() {
        // ...
    });
} else {
    com.nineoldandroids.animation.ObjectAnimator a = (com.nineoldandroids.animation.ObjectAnimator) reveal.get();
    a.addListener(new com.nineoldandroids.animation.Animator.AnimatorListener() {
        // ...
    });
}

I don't think that I should close this issue yet, I think this should be implemented within the library. Anyways, awesome lib and thanks for the quick reply!

from circularreveal.

ozodrukh avatar ozodrukh commented on June 8, 2024

You can add listener through:

SupportAnimator reveal = ViewAnimationUtils.createCircularReveal(view, cX, cY, 0, radius);
if(reveal.isNativeAnimator()){
     ObjectAnimator a = (ObjectAnimator) reveal.get();
     //TODO add listener to android.animation.ObjectAnimator
}else{
     ObjectAnimator a = (ObjectAnimator) reveal.get();
     //TODO add listener to nineoldandroids
}

from circularreveal.

sheharyarn avatar sheharyarn commented on June 8, 2024

It seems to be working on Pre-lollipop devices but doesn't work on Lollipop. I get this error:

java.lang.ClassCastException: android.animation.RevealAnimator cannot be cast to android.animation.ObjectAnimator

This is my code:

if (reveal.isNativeAnimator()) {
    android.animation.ObjectAnimator a = (android.animation.ObjectAnimator) reveal.get();
    a.addListener(new Animator.AnimatorListener() {
        public void onAnimationCancel (Animator animation) { }
        public void onAnimationRepeat (Animator animation) { }
        public void onAnimationStart  (Animator animation) { commonOnStartStuff(); }
        public void onAnimationEnd    (Animator animation) { commonOnEndStuff();   }
    });
} else {
    com.nineoldandroids.animation.ObjectAnimator a = (com.nineoldandroids.animation.ObjectAnimator) reveal.get();
    a.addListener(new com.nineoldandroids.animation.Animator.AnimatorListener() {
        public void onAnimationCancel (com.nineoldandroids.animation.Animator animation) { }
        public void onAnimationRepeat (com.nineoldandroids.animation.Animator animation) { }
        public void onAnimationStart  (com.nineoldandroids.animation.Animator animation) { commonOnStartStuff(); }
        public void onAnimationEnd    (com.nineoldandroids.animation.Animator animation) { commonOnEndStuff();   }
    });
}

from circularreveal.

ozodrukh avatar ozodrukh commented on June 8, 2024

Thanks, have you an idea to solve this problem?

from circularreveal.

sheharyarn avatar sheharyarn commented on June 8, 2024

Yeah, a custom implementation of `AnimatorListerner' that does this?

from circularreveal.

Related Issues (20)

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.