When I do a simple tween animation in a new project, regardless if I'm moving an image or a say a button, the animation is jerky / twitchy. On physical devices such as the S3 & RAZR.
Am I doing something wrong? Why would simple tween animations for moving a view in an IDE boilerplate app be twitchy / jerky on modern (4.x) devices?
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
// called from a button's on click
public void doImageAnimation(View view) {
ImageView iv = (ImageView)findViewById(R.id.mciamge);
iv.setY(200f);
ObjectAnimator oa = ObjectAnimator.ofFloat(iv, "x",1000);
oa.setInterpolator(new LinearInterpolator());
oa.setRepeatCount(5);
oa.setDuration(3000l);
oa.start();
}
// called from a button's on click
public void doButtonAnimation(View view) {
Button iv = (Button)findViewById(R.id.mcbutton);
iv.setX(0f);
ObjectAnimator oa = ObjectAnimator.ofFloat(iv, "x",1000);
oa.setInterpolator(new LinearInterpolator());
oa.setRepeatCount(5);
oa.setDuration(3000l);
oa.start();
}
}