frakbot / jumpingbeans Goto Github PK
View Code? Open in Web Editor NEWA Span-based library to make your text jump like Mexican beans. Oh, and the "..."s in Hangouts.
A Span-based library to make your text jump like Mexican beans. Oh, and the "..."s in Hangouts.
Sorry I'm very stupid. How can I create а JumpingBeans by using its Builder? I do not know how to do that.
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?
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?
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:
java.lang.StackOverflowError
and possibly resulting app crashes.Unfortunately, I don't have time to work out a PR at the moment, but I thought I'd share this issue anyway.
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
If this can't be worked around, a note should be made that android:textAllCaps
must be false
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.