skip to Main Content

Android Studio – Moving a button randomly onClick() with ObjectAnimator

I have this code: button3.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ObjectAnimator animX = ObjectAnimator.ofFloat(button3, "X", 0f, 50f); ObjectAnimator animY = ObjectAnimator.ofFloat(button3, "Y", 0f, 50f); AnimatorSet animSet = new AnimatorSet(); animSet.playSequentially(animX, animY); animSet.setDuration(500); animSet.start(); } }); I'm trying…

VIEW QUESTION
Back To Top
Search