I want to create a swipeable ListView that swipes to both right and left, and I want to use a library for that in my project, but I don't find a suitable library. Can you help me?


I want to create a swipeable ListView that swipes to both right and left, and I want to use a library for that in my project, but I don't find a suitable library. Can you help me?


I usually use Swipe Layout from Rambler Digital Solution. You can check this link: https://github.com/rambler-digital-solutions/swipe-layout-android
Add to your project:
compile 'ru.rambler.android:swipe-layout:1.0.15'
And here is the basic layout for your list item:
<ru.rambler.libs.swipe_layout.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/item_height">
<!--CENTER. app:gravity="center" - is default value -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
...
</LinearLayout>
<!--RIGHT-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:gravity="right"
app:bring_to_clamp="150dp"
app:clamp="self"
app:sticky="100dp">
...
</LinearLayout>
<!--LEFT-->
<FrameLayout
android:layout_width="200dp"
android:layout_height="match_parent"
app:gravity="left"
app:bring_to_clamp="100dp"
app:clamp="self"
app:sticky="none">
...
</FrameLayout>