android - How could I swipe view using Fling Gesture -
i need swipe views using fling gestures how that have searched alot got idea like:
@override public boolean onfling(motionevent e1, motionevent e2, float velocityx, float velocityy) { string swipe = ""; float sensitvity = 50; // todo auto-generated method stub if((e1.getx() - e2.getx()) > sensitvity){ swipe += "swipe left\n"; swipeleft(); }else if((e2.getx() - e1.getx()) > sensitvity){ swipe += "swipe right\n"; }else{ swipe += "\n"; } if((e1.gety() - e2.gety()) > sensitvity){ swipe += "swipe up\n"; }else if((e2.gety() - e1.gety()) > sensitvity){ swipe += "swipe down\n"; }else{ swipe += "\n"; } gestureevent.settext(swipe); return super.onfling(e1, e2, velocityx, velocityy); } };
i need create
could suggest me how that? @thanks
Comments
Post a Comment