This code is duplicated, I guess that you copy it from onTouchEnd, right? IMHO you calculate it here and there. I guess that it should be re-implemented