框架整理系列二十九(左右滑动删除)

2017-09-09  本文已影响0人  I_Gisvity

引用大神:https://github.com/anzaizai/EasySwipeMenuLayout

EasySwipeMenuLayout

A sliding menu library not just for recyclerview, but all views.

Effect picture

EasySwipeMenuLayout.gif

Recommended

Feature

How to use

Step 1

step 2

step 3

such as

        <com.guanaj.easyswipemenulibrary.EasySwipeMenuLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  app:contentView="@+id/content"
                  app:leftMenuView="@+id/left"
                  app:rightMenuView="@+id/right">
                      <LinearLayout
                          android:id="@+id/left"
                          android:layout_width="100dp"
                          android:layout_height="wrap_content"
                          android:background="@android:color/holo_blue_dark"
                          android:orientation="horizontal"
                          android:padding="20dp">
                              <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="分享" />
                        </LinearLayout>
                      <LinearLayout
                          android:id="@+id/content"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:background="#cccccc"
                          android:orientation="vertical"
                          android:padding="20dp">
                              <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="内容区域" />
                      </LinearLayout>
                      <LinearLayout
                          android:id="@+id/right"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:background="@android:color/holo_red_light"
                          android:orientation="horizontal">
                          <TextView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:background="@android:color/holo_blue_bright"
                              android:padding="20dp"
                              android:text="删除" />
                          <TextView
                              android:id="@+id/right_menu_2"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:background="@android:color/holo_orange_dark"
                              android:padding="20dp"
                              android:text="收藏" />
                      </LinearLayout>
                </com.guanaj.easyswipemenulibrary.EasySwipeMenuLayout>
上一篇 下一篇

猜你喜欢

热点阅读