Android Scale Button On Touch


Answer :

Try the following:

@Override public boolean onTouch(View v, MotionEvent motionEvent) {     int action = motionEvent.getAction();     if (action == MotionEvent.ACTION_DOWN) {         v.animate().scaleXBy(100f).setDuration(5000).start();         v.animate().scaleYBy(100f).setDuration(5000).start();         return true;     } else if (action == MotionEvent.ACTION_UP) {         v.animate().cancel();         v.animate().scaleX(1f).setDuration(1000).start();         v.animate().scaleY(1f).setDuration(1000).start();         return true;     }      return false; } 

This should do the trick ;)


Comments

Popular posts from this blog

Chemistry - Bond Angles In NH3 And NCl3

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Change The Font Size Of Visual Studio Solution Explorer