Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8878213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:39:38+00:00 2026-06-14T19:39:38+00:00

I have a question concerning ObjectAnimator in Android. I am trying to model a

  • 0

I have a question concerning ObjectAnimator in Android. I am trying to model a Bounce effect whereby the View slides up (decreasing Y value) and back down after by the same amount ‘n’, followed by the View sliding up and down again but this time by ‘n/2’ (so half the distance).

So a bigger bounce, followed by a shallower bounce – i.e., the kinda thing a Mac icon does in the tray when it wants your attention.

Here is what I’ve tried so far (assume v is a View):

float y = v.getTranslationY(),distance = 20F;

                AnimatorSet s = new AnimatorSet();
                s.play(ObjectAnimator.ofFloat(v, "translationY", y- distance).setDuration(500))
                .before(ObjectAnimator.ofFloat(v, "translationY", y).setDuration(500))
                .before(ObjectAnimator.ofFloat(v, "translationY", y- (distance/2)).setDuration(500))
                .before(ObjectAnimator.ofFloat(v, "translationY", y).setDuration(500));
                s.start();

Ignore the code quality, it’s a POC! I was hoping this would work, but it seems to only ‘bounce’ once as if its combined the animations despite the use of .before().

Could you please show me how I can create complex AnimatorSet chains that do not amalgamate in to one, as I seem to be missing something?

BONUS: For extra points, how can I set the repeat of an AnimatorSet?

Many thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:39:40+00:00Added an answer on June 14, 2026 at 7:39 pm

    OK so I eventually found a fairly neat way to achieve sequential animation by ignoring the fluent builder, and just using the playSequentially() method such that:

    AnimatorSet as = new AnimatorSet();
    as.playSequentially(ObjectAnimator.ofFloat(...), // anim 1
                        ObjectAnimator.ofFloat(...), // anim 2
                        ObjectAnimator.ofFloat(...), // anim 3
                        ObjectAnimator.ofFloat(...)); // anim 4
    as.setDuration(600);
    as.start();
    

    Still haven’t worked out repeating though, other than a dirty hack involving the callback onAnimationEnd in a listener. Must be a simpler way, so perhaps someone can edit this when they know of one.

    Anyway, hope the above helps someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple question concerning Javascript. I am trying to print in a
I have a really basic question concerning unix timestamp and mysql date. I'm trying
I have a question concerning Javascript: I want to have the same effect of
I'm new to MVC and I have a question concerning my view. I have
I have an architectural question concerning custom fields in a view for an object.
i just have a question concerning publishing android apps can i publish my app
I have a question concerning enumerations and floats. I'm trying to pass an enum
I have a question concerning the following model. I want to populate the ManyToManyField
I have question concerning a function I created. I would like to show the
I have a question concerning active record association, referring to this part of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.