android - OnFling is not detected in low velocities -


i implementing onfling. works when velocity high. means need move finger very fast fling take place. code:

simpleongesturelistener simpleongesturelistener = new simpleongesturelistener() {      @override     public boolean ondoubletap(motionevent e) {         // todo auto-generated method stub         log.v("ondoubletap: \n", e.tostring());         return super.ondoubletap(e);     }      @override     public boolean onfling(motionevent e1, motionevent e2, float velocityx,          log.v("on fling", "on fling");          if ((e1.gety() < card_position) && (e2.gety() < card_position)                 && (math.abs(e1.getx() - e2.getx()) > card_swipe_min)){                    return super.onfling(e1, e2, velocityx, velocityy);          } else {             return false;         }      } 

see https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/gesturedetector.java, field named mminimumflingvelocity


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -