GithubHelp home page GithubHelp logo

jumpingbeans's People

Contributors

passy avatar rock3r 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

jumpingbeans's Issues

Short animated duty cycle causes animation repeat

I'm seeing some repeats in animation when I set the animated duty cycle to <= 0.5. And I think this is due to using Math.max() to limit the interpolated value. When the animation range is small enough, the time is interpolated to fit more than one sine wave.

According to the method doc ("Sets the fraction of the animation loop time spent actually animating. The rest of the time will be spent "resting"), it seems that this:

double radians = (input / animRange) * Math.PI;
double interpolatedValue = Math.max(0f, Math.sin(radians));
return (float) interpolatedValue;

Should actually be this:

if (input > animRange) return;
double radians = (input / animRange) * Math.PI;
double interpolatedValue = Math.sin(radians);
return (float) interpolatedValue;

Thoughts?

Adjust jumping bean height

As far as I can tell, there's not a way to adjust how high the beans jump (unless I'm blind and somehow missed it, which is possible...).

Is there any chance of adding this?

Zombie JumpingBeans instance causes java.lang.StackOverflowError

Hi guys,
I'm using your library for an app project and really like it so far.
However, I just stumbled over a rather tricky issue: I'm triggering a JumpingBeans animation on a single TextView from several places in my fragment, like so:

loadingDots = new JumpingBeans.Builder().appendJumpingDots(tvLoading).build();

When the fragment is paused, I cancel any possibly active animation by calling:

if (loadingDots != null)
        loadingDots.stopJumping();

Now, by accident, I actually created a JumpingBeans instance twice, i.e. I assigned a new JumpingBeans instance to loadingDots without calling .stopJumping() on the old one. This doesn't cause any problem until the users leaves the current activity and transitions to a new one. That's when the zombie JumpingBeans instance (which apparently doesn't get GC'ed) actually takes down the entire app with a java.lang.StackOverflowError. The culprit is JumpingBeansSpan, which makes an infinitely recursive call to animation.start() when the TextView still exists but the span is no longer attached to it:

    @Override
    public void onAnimationUpdate(ValueAnimator animation) {
        // No need for synchronization as this always run on main thread anyway
        TextView v = textView.get();
        if (v != null) {
            if (isAttachedToHierarchy(v)) {
                shift = (int) animation.getAnimatedValue();
                v.invalidate();
            } else {
                // If there is a zombie JumpingBeans instance that is not attached
                // to a view, this code block will cause infinite recursion and a
                // java.lang.StackOverflowError.
                animation.setCurrentPlayTime(0);
                animation.start();
            }
        } else {
                ...
        }
    }

I am aware that this error came from improper use of the library (now I actually stop and clean up any existent JumpingBeans instance before creating a new one and it works fine). Still, the consequences of this possibly common pitfall seem a bit harsh, so I'd like to suggest the following:

Unfortunately, I don't have time to work out a PR at the moment, but I thought I'd share this issue anyway.

Import error

Error:(37, 0) Cause: assert localProps['keystore.props.file']
| |
| null
[sdk.dir:F:\adt-bundle-windows-x86_64_with_Android_5.0\sdk]

how can i fix it ? waiting for you answer , thanks

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.