A Span-based library to make your text jump like Mexican beans. Oh, and the "..."s in Hangouts.
Java
1,104
60 commits
updated Dec 6, 2018

The JumpingBeans make your test jump to the eye. Literally!
Have you ever used Hangouts? If not, do it and then come back here. Go. Go, I said!
Good. With that under our belt, we can be confident you've seen at least once those fancy, nice jumping suspension dots that Hangouts uses to indicate that someone is typing, or some other kind of ongoing activity (e.g., connecting to a video hangout).
Well, since there's no official naming for them, and since they remind me of the jumping Mexican beans, the name for a library that emulates their behaviour has come to be exactly that: JumpingBeans.
Please come closer, ladies and gentlemen! Here you have, for your own amusement, the amazing JumpingBeans:


In order to use JumpingBeans in your own project, you can use the wonderous remote dependencies capabilities that Gradle offers you (if you're not using Gradle and Android Studio/IntelliJ offer you, I'm sorry for you.) (No, I mean it, I'm really sorry for you!)
Just make sure you have jcenter() in your root build.gradle:
allprojects {
repositories {
jcenter()
}
}
And then just add the JumpingBeans dependency to your module's build.gradle:
dependencies {
compile 'net.frakbot:jumpingbeans:1.3.0'
}
The library supports two main operation modes: appending three jumping dots, Hangouts-style, or making any arbitrary subsection of a CharSequence jump, either as a wave or as a single block.
This method takes the trailing ... (or appends them, if the given TextView's text
doesn't end in three dots), and makes them jump like it was -the 70s- Hangouts.
The defaults emulate the Hangouts L&F as closely as possible, but you can easily change the animation properties to suit your needs.
This method takes the specified subsection a the TextView text and animates it as to make it jump.
Just create a JumpingBeans by using its Builder and call the method you want:
// Append jumping dots
final TextView textView1 = (TextView) findViewById(R.id.jumping_text_1);
jumpingBeans1 = JumpingBeans.with(textView1)
.appendJumpingDots()
.build();
// Make the first word's letters jump
final TextView textView2 = (TextView) findViewById(R.id.jumping_text_2);
jumpingBeans2 = JumpingBeans.with(textView2)
.makeTextJump(0, textView2.getText().toString().indexOf(' '))
.setIsWave(false)
.setLoopDuration(1000) // ms
.build();
Just act on the Builder. Don't want the dots to jump in a wave? Call
setIsWave(false). Don't like the default loop duration? setLoopDuration(int)
is here to help. Fancy different per-char delays in waves? Well, ya know that
setWavePerCharDelay(int) is the one you want. Maybe you wanted to have a
shorter pause between jumping cycles? BAM, setAnimatedDutyCycle(float) and
you're all set.
Since Spans were not really designed to be animated, there's some trickery
going on behind the scenes to make this happen. You needn't be concerned with it,
but make sure you call the stopJumping() method on your JumpingBeans object
whenever you stop using the TextView (it's detaching from the view tree, or the
container Activity or Fragment is going in paused state, ...).
This allows a deeper cleanup than what the JumpingBeans library is trying to
perform if you forget to. Don't leave stuff lying around if you can!
Please note that you:
stopJumping() as to avoid unnecessary invalidation calls;
the JumpingBeans class cannot know when this happens and will keep
animating the textview (well, try to, anyway), wasting resourcestextAllCaps.You can find the JumpingBeans demo app on the Google Play Store.
This library was written by Sebastiano Poggi and released by Frakbot under the Apache 2.0 License.
Please see the NOTICE file for details.
261 followers · starred Oct 2015
96 followers · starred Dec 2014
A Span-based library to make your text jump like Mexican beans. Oh, and the "..."s in Hangouts.
Java
1,104
60 commits
updated Dec 6, 2018

The JumpingBeans make your test jump to the eye. Literally!
Have you ever used Hangouts? If not, do it and then come back here. Go. Go, I said!
Good. With that under our belt, we can be confident you've seen at least once those fancy, nice jumping suspension dots that Hangouts uses to indicate that someone is typing, or some other kind of ongoing activity (e.g., connecting to a video hangout).
Well, since there's no official naming for them, and since they remind me of the jumping Mexican beans, the name for a library that emulates their behaviour has come to be exactly that: JumpingBeans.
Please come closer, ladies and gentlemen! Here you have, for your own amusement, the amazing JumpingBeans:


In order to use JumpingBeans in your own project, you can use the wonderous remote dependencies capabilities that Gradle offers you (if you're not using Gradle and Android Studio/IntelliJ offer you, I'm sorry for you.) (No, I mean it, I'm really sorry for you!)
Just make sure you have jcenter() in your root build.gradle:
allprojects {
repositories {
jcenter()
}
}
And then just add the JumpingBeans dependency to your module's build.gradle:
dependencies {
compile 'net.frakbot:jumpingbeans:1.3.0'
}
The library supports two main operation modes: appending three jumping dots, Hangouts-style, or making any arbitrary subsection of a CharSequence jump, either as a wave or as a single block.
This method takes the trailing ... (or appends them, if the given TextView's text
doesn't end in three dots), and makes them jump like it was -the 70s- Hangouts.
The defaults emulate the Hangouts L&F as closely as possible, but you can easily change the animation properties to suit your needs.
This method takes the specified subsection a the TextView text and animates it as to make it jump.
Just create a JumpingBeans by using its Builder and call the method you want:
// Append jumping dots
final TextView textView1 = (TextView) findViewById(R.id.jumping_text_1);
jumpingBeans1 = JumpingBeans.with(textView1)
.appendJumpingDots()
.build();
// Make the first word's letters jump
final TextView textView2 = (TextView) findViewById(R.id.jumping_text_2);
jumpingBeans2 = JumpingBeans.with(textView2)
.makeTextJump(0, textView2.getText().toString().indexOf(' '))
.setIsWave(false)
.setLoopDuration(1000) // ms
.build();
Just act on the Builder. Don't want the dots to jump in a wave? Call
setIsWave(false). Don't like the default loop duration? setLoopDuration(int)
is here to help. Fancy different per-char delays in waves? Well, ya know that
setWavePerCharDelay(int) is the one you want. Maybe you wanted to have a
shorter pause between jumping cycles? BAM, setAnimatedDutyCycle(float) and
you're all set.
Since Spans were not really designed to be animated, there's some trickery
going on behind the scenes to make this happen. You needn't be concerned with it,
but make sure you call the stopJumping() method on your JumpingBeans object
whenever you stop using the TextView (it's detaching from the view tree, or the
container Activity or Fragment is going in paused state, ...).
This allows a deeper cleanup than what the JumpingBeans library is trying to
perform if you forget to. Don't leave stuff lying around if you can!
Please note that you:
stopJumping() as to avoid unnecessary invalidation calls;
the JumpingBeans class cannot know when this happens and will keep
animating the textview (well, try to, anyway), wasting resourcestextAllCaps.You can find the JumpingBeans demo app on the Google Play Store.
This library was written by Sebastiano Poggi and released by Frakbot under the Apache 2.0 License.
Please see the NOTICE file for details.
261 followers · starred Oct 2015
96 followers · starred Dec 2014