daimajia / AndroidSwipeLayout

The Most Powerful Swipe Layout!
MIT License
12.38k stars 2.67k forks source link

recycler view swipe from both side? #282

Open MohsenShafiee opened 8 years ago

MohsenShafiee commented 8 years ago

is it possible to swipe recycler view from right and left and show to different layouts there?

thanks...

xdgimf commented 8 years ago

Yes, you can do something like this

<com.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="80dp">
    <!-- Left View Start-->
     <LinearLayout
        android:background="#66ddff00"
        android:id="@+id/left_view"
        android:layout_width="160dp"
        android:weightSum="1"
        android:layout_height="match_parent">
        <!--What you want to show-->
    </LinearLayout>
    <!-- Left View End-->

     <!-- Right View Start-->
     <LinearLayout
        android:background="#66ddffff"
        android:id="@+id/right_view"
        android:layout_width="160dp"
        android:weightSum="1"
        android:layout_height="match_parent">
        <!--What you want to show-->
    </LinearLayout>
    <!-- Right View End-->

    <!-- Surface View Start -->
     <LinearLayout
        android:padding="10dp"
        android:background="#ffffff"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <!--What you want to show in SurfaceView-->
    </LinearLayout>
    <!-- Surface View End -->

</com.daimajia.swipe.SwipeLayout>
Hemant0601 commented 8 years ago

@xdgimf Can you please tell me how to get if the view is swiped to left or right. Thanks