I want an image on an Android screen to appear smaller when the user touches down on it and to get back to its original size when the user releases it. I want the animation to be smooth and I also want to utilize minimum computing resources. How can this best be implemented?
try this code
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// do something here when touch
break;
case MotionEvent.ACTION_UP:
// do something here when touch release
break;
}
return true;
}
for animation try this animation-source_code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With