i using swipe delete in bu using this library. , using swipe refresh , using android.support.v4.widget.swiperefreshlayout design , looks when swipe down refresh. list gets refresh , contents updated.
following layout
<android.support.v4.widget.swiperefreshlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/swipe_refresh_layout" android:layout_width="match_parent" android:layout_height="wrap_content" > <framelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true"> <com.baoyz.swipemenulistview.swipemenulistview android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="match_parent" android:dividerheight="5.0sp" android:divider="@android:color/transparent"/> <scrollview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center"> <textview android:id="@+id/swiperefreshlayout_emptyview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:visibility="gone" android:gravity="center" /></scrollview> </framelayout>
problem :
as want delete item using swipe delete , have swipe right left open menu of delete , gets open when touch on nothing happens.
i on result , think 2 times of gesture intercepting each other. did debug , nothing menu deleting item not listening click.
please stuck in middle. suggestion can me ?
update 1
i debug code , showing me following in log when ever click delete button in menu
d/viewrootimpl: viewpostimeinputstage action_down
i think ignoring touch delete item
the best way here in answer disable sweiprefreshlayout when start sweeping menu , enable again when finish code
list.setonswipelistener(new swipemenulistview.onswipelistener() { @override public void onswipestart(int position) { myswiperefresh.setenabled(false); } @override public void onswipeend(int position) { myswiperefresh.setenabled(true); } });
i hope helps works me.
Comments
Post a Comment