Saturday 15 February 2014

How to show context menu on long press in list view when using android-swipelistview-sample from 47deg? -



How to show context menu on long press in list view when using android-swipelistview-sample from 47deg? -

i have problem context menu when using android-swipelistview-sample 47deg .(https://github.com/47deg/android-swipelistview). problem when short click made context menu displayed .

how show context menu long click ?

this bug caused curved touch event distribution in 47degrees swipe listview. prepare this, comment out

view.ontouchevent(motionevent);

in ontouch() method, in end of switch case motionevent.action_down: in swipelistviewtouchlistener. issue go away, scrolling listview become dull, soon, touch events not recognized while listview scrolling. overcome problem, add together swipelistview class new flag, isscrolled. then, need update flag each time, scrolling state changes:

mlistview.setonscrolllistener(new abslistview.onscrolllistener() { @override public void onscrollstatechanged(abslistview abslistview, int i) { mlistview.setscrolling(i == scroll_state_fling); } @override public void onscroll(abslistview abslistview, int i, int i2, int i3) { } });

and finally, create distribute touch event when view scrolling:

if(swipelistview.isscrolling()){ view.ontouchevent(motionevent); }

good luck!

android android-listview

No comments:

Post a Comment