@@ -0,0 +1,1313 @@
+package com.parse.anypic.util;%0A%0Aimport android.os.Build;%0Aimport android.view.MotionEvent;%0Aimport android.view.View;%0Aimport android.view.animation.AlphaAnimation;%0A%0A/**%0A *%0A * View Press Effect Helper%0A * - usage : do some simple press effect like iOS%0A *%0A * Simple Usage:%0A * ImageView img = (ImageView) findViewById(R.id.img);%0A * ViewPressEffectHelper.attach(img)%0A *%0A * @author Lam @ HongKong%0A *%0A */%0Apublic class ViewPressEffectHelper %7B%0A%0A%09public static void attach(View view)%7B%0A%09%09view.setOnTouchListener(new View.OnTouchListener() %7B%0A%0A%09%09%09@Override%0A%09%09%09public boolean onTouch(View v, MotionEvent event) %7B%0A%09%09%09%09switch (event.getAction()) %7B%0A%09%09%09%09case MotionEvent.ACTION_DOWN: %7B%0A%09%09%09%09%09if (Build.VERSION.SDK_INT %3C 11) %7B%0A%09%09%09%09%09%09final AlphaAnimation animation = new AlphaAnimation(1.0f, 0.5f);%0A%09%09%09%09%09%09animation.setDuration(100);%0A%09%09%09%09%09%09animation.setFillAfter(true);%0A%09%09%09%09%09%09v.startAnimation(animation);%0A%09%09%09%09%09%7D else%0A%09%09%09%09%09%09v.setAlpha(0.5f);%0A%09%09%09%09%7D%0A%09%09%09%09break;%0A%0A%09%09%09%09case MotionEvent.ACTION_UP:%0A%09%09%09%09case MotionEvent.ACTION_CANCEL:%7B%0A%09%09%09%09%09if (Build.VERSION.SDK_INT %3C 11) %7B%0A%09%09%09%09%09%09final AlphaAnimation animation = new AlphaAnimation(0.5f, 1.0f);%0A%09%09%09%09%09%09animation.setDuration(100);%0A%09%09%09%09%09%09animation.setFillAfter(true);%0A%09%09%09%09%09%09v.startAnimation(animation);%0A%09%09%09%09%09%7D else%0A%09%09%09%09%09%09v.setAlpha(1.0f);%0A%09%09%09%09%7D%0A%09%09%09%09break;%0A%09%09%09%09%7D%0A%0A%09%09%09%09return false;%0A%09%09%09%7D%0A%09%09%7D);%0A%09%7D%0A%7D%0A

Add ViewPressEffectHelper