I have a list view with a set of items in it. I user the ACTION_DOWN, ACTION_MOVE, and ACTION_UP events to perform gesture detection on the list items.
In ACTION_MOVE, I have the following line of code : mDownView.setTranslationX(deltaX);
where deltaX is motionEvent.getRawX() - mDownX; mDownX is the X co-ordinate of the ACTION_DOWN event.
The problem I am facing is that the list item movement is not smooth.It appears choppy. What can I do to make it look fluid ?
Please note that I am making a database call in ACTION_MOVE (Code snippet below).
case MotionEvent.ACTION_MOVE: {
// Check the view type
Log.d(tag, "------- IN ACTION MOVE -------");
if (mVelocityTracker == null || mPaused) {
break;
}
// the line below slows down the swipe
DataBaseHandler db = new DataBaseHandler(mcontext);
int status = db.getStatus(row_id);