Ok im still really struggling with this(see my previous question here), i need to balloons to float up the screen so they rise up from below the screen and slightly zigzag as they go up ive achieved this with object animators and although i am quite close the result differs from screen to screen (slightly) here is a snippet of what i have LEFT BALLOON
ObjectAnimator sqbalAnim3 =
ObjectAnimator.ofFloat(rb,"x",0f,100f);
sqbalAnim3.setDuration(700);
sqbalAnim3.setRepeatCount(6);
sqbalAnim3.setRepeatMode(ValueAnimator.REVERSE);
ObjectAnimator sqbalAnim =
ObjectAnimator.ofFloat(rb,"y",1000f,0f);
sqbalAnim.setDuration(7000);
sqbalAnim.setRepeatMode(ValueAnimator.RESTART);
AnimatorSet animSetXY = new AnimatorSet();
animSetXY.playTogether(sqbalAnim, sqbalAnim3);
animSetXY.setStartDelay(5);
animSetXY.start();
RIGHT BALLOON
ObjectAnimator sqbal2Anim =
ObjectAnimator.ofFloat(findViewById(R.id.rectballoon2),"y",1000f,0f);
sqbal2Anim.setDuration(7000);
sqbal2Anim.setRepeatMode(ValueAnimator.RESTART);
ObjectAnimator sqbalAnim4 =
ObjectAnimator.ofFloat(findViewById(R.id.rectballoon2),"x",400f,500f);
sqbalAnim4.setStartDelay(5);
sqbalAnim4.setDuration(700);
sqbalAnim4.setRepeatCount(6);
sqbalAnim4.setRepeatMode(ValueAnimator.REVERSE);
AnimatorSet animSetXY2 = new AnimatorSet();
animSetXY2.playTogether(sqbal2Anim,sqbalAnim4);
animSetXY2.start();
return true;
}
These values make it look very similar to what im looking for but it has a couple or glitches. 1) the balloon view appears in its starting point (from the XML) then disappears and starts the animation 2) The balloon views are significantly different on different screens. So my question is; is there anyway i can tweak what i have to make it more consistent from device to device (doesnt need to be exact) they just need to float from bottom to top zigzagging slightly as they go until they reach near the top of the screen where they burst. Any and all suggestions welcome