All Projects → TUBB → Swipemenu

TUBB / Swipemenu

Licence: apache-2.0
[DEPRECATED] A swipe menu for horizontal/vertical, support left/right and top/bottom directions

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Swipemenu

Overscroll Decor
Android: iOS-like over-scrolling effect applicable over almost all scrollable Android views.
Stars: ✭ 2,671 (+226.93%)
Mutual labels:  recyclerview, listview, scrollview
Ultimaterefreshview
UltimateRefreshView 实现下拉刷新,上拉加载更多的轻量级库;支持RecyclerView ,ListView ,ScrollView & WebView
Stars: ✭ 64 (-92.17%)
Mutual labels:  recyclerview, listview, scrollview
react-recycled-scrolling
Simulate normal scrolling by using only fixed number of DOM elements for large lists of items with React Hooks
Stars: ✭ 26 (-96.82%)
Mutual labels:  listview, recyclerview
adapster
Android library designed to enrich and make your RecyclerView adapters more SOLID
Stars: ✭ 17 (-97.92%)
Mutual labels:  listview, recyclerview
Swipedelmenulayout
The most simple SwipeMenu in the history, 0 coupling, support any ViewGroup. Step integration swipe (delete) menu, high imitation QQ, iOS. ~史上最简单侧滑菜单,0耦合,支持任意ViewGroup。一步集成侧滑(删除)菜单,高仿QQ、IOS。~
Stars: ✭ 3,376 (+313.22%)
Mutual labels:  recyclerview, listview
kandy
Sweet Android libraries written in Kotlin
Stars: ✭ 19 (-97.67%)
Mutual labels:  listview, recyclerview
react-native-nlist
原生Listview Native lListView react-native encapsulation Memory recovery reusing High performance
Stars: ✭ 60 (-92.66%)
Mutual labels:  listview, recyclerview
React Native Sortable List
React Native Sortable List component
Stars: ✭ 678 (-17.01%)
Mutual labels:  listview, scrollview
android-page
android 分页列表数据加载引擎,主要封装了android分页列表数据加载的各个组件,如果你有一个需要分页加载的List列表,都可以使用此框架实现。
Stars: ✭ 15 (-98.16%)
Mutual labels:  listview, recyclerview
Recyclerlistview
High performance listview for React Native and web!
Stars: ✭ 4,033 (+393.64%)
Mutual labels:  recyclerview, listview
Giraffeplayer2
out of the box android video player(support lazy load, ListView/RecyclerView and hight performance)
Stars: ✭ 344 (-57.89%)
Mutual labels:  recyclerview, listview
Brv
Android上最强大的RecyclerView库
Stars: ✭ 345 (-57.77%)
Mutual labels:  recyclerview, listview
react-native-dual
ScrollView, FlatList, SectionList and ListView with dual background
Stars: ✭ 28 (-96.57%)
Mutual labels:  listview, scrollview
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (-84.82%)
Mutual labels:  listview, recyclerview
recyclerview-list-drag-and-drop
No description or website provided.
Stars: ✭ 50 (-93.88%)
Mutual labels:  listview, recyclerview
GenericRecyclerAdapter
Easiest way to use RecyclerView. Reduce boilerplate code! You don't need to write adapters for listing pages anymore!
Stars: ✭ 53 (-93.51%)
Mutual labels:  listview, recyclerview
Boardview
A draggable boardview for java android (Kanban style)
Stars: ✭ 309 (-62.18%)
Mutual labels:  recyclerview, listview
Adapter
A quick adapter library for RecyclerView, GridView, ListView, ViewPager, Spinner
Stars: ✭ 376 (-53.98%)
Mutual labels:  recyclerview, listview
InfiniteScrollRecyclerView
Enables the RecyclerView to Auto scroll for indefinite time.
Stars: ✭ 49 (-94%)
Mutual labels:  recyclerview, scrollview
GenericAdapter
⛳️ Easy to use android databinding ready recyclerview adapter
Stars: ✭ 26 (-96.82%)
Mutual labels:  listview, recyclerview

SwipeMenu

A swipe menu for horizontal/vertical, support left/right and top/bottom directions, low coupling, can fast rapid integration into your project

Features

  • Support LinearLayoutManager、GridLayoutManager and StaggeredGridLayoutManager for RecyclerView (only horizontal)
  • Support ListView and GridView (only horizontal)
  • Support ScrollView (only horizontal and the [SwipeHorizontal/SwipeVertical]MenuLayout must be the direct child of ScrollView's direct child )
  • On-off swipe ability
  • Not intercept item touch event
  • Left/Right and Top/Bottom menu support, free switch

Preview

DEMO

Usage

Add to dependencies

dependencies {
    compile 'com.tubb.smrv:swipemenu-recyclerview:5.4.8'
}

Horizontal

Just use SwipeHorizontalMenuLayout, we use SwipeHorizontalMenuLayout ViewGroup to combine item content view and left/right(at least one) swipe menu

<?xml version="1.0" encoding="utf-8"?>
<com.tubb.smrv.SwipeHorizontalMenuLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:sml="http://schemas.android.com/apk/res-auto"
    android:id="@+id/sml"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    sml:sml_scroller_interpolator="@android:anim/bounce_interpolator"
    sml:sml_auto_open_percent="0.2"
    sml:sml_scroller_duration="250">

    <include android:id="@id/smContentView" layout="@layout/item_simple_content"/>
    <include android:id="@id/smMenuViewLeft" layout="@layout/item_simple_left_menu"/>
    <include android:id="@id/smMenuViewRight" layout="@layout/item_simple_right_menu"/>

</com.tubb.smrv.SwipeHorizontalMenuLayout>

If you have so many items, you may be want to use our custom RecyclerView

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}"
    android:id="@+id/swipeRefreshLayout">

    <com.tubb.smrv.SwipeMenuRecyclerView
        android:id="@+id/listView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</android.support.v4.widget.SwipeRefreshLayout>

Vertical

Just use SwipeVerticalMenuLayout, we use SwipeVerticalMenuLayout ViewGroup to combine item content view and top/bottom (at least one) swipe menu

<com.tubb.smrv.SwipeVerticalMenuLayout
    android:id="@+id/sml"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    sml:sml_scroller_interpolator="@android:anim/bounce_interpolator">

    <LinearLayout
        android:id="@id/smMenuViewTop"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:orientation="horizontal"
        android:clickable="true"
        android:background="@android:color/holo_green_light"
        android:gravity="center_horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="top"
            android:textColor="@color/white"
            android:layout_gravity="top"/>

    </LinearLayout>

    <RelativeLayout
        android:id="@id/smContentView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/red">

        <Button
            android:id="@+id/btLeft"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Top"
            android:layout_centerHorizontal="true"
            />

        <Button
            android:id="@+id/btRight"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Bottom"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"/>

    </RelativeLayout>

    <LinearLayout
        android:id="@id/smMenuViewBottom"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:orientation="horizontal"
        android:clickable="true"
        android:background="@android:color/holo_blue_light"
        android:gravity="center_horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="bottom"
            android:textColor="@color/white"
            android:layout_gravity="bottom"/>

    </LinearLayout>
</com.tubb.smrv.SwipeVerticalMenuLayout>

More details please see the demo project

Listeners

We add a SwipeSwitchListener for actions like open/close

sml.setSwipeListener(new SwipeSwitchListener() {
    @Override
    public void beginMenuClosed(SwipeMenuLayout swipeMenuLayout) {
        Log.e(TAG, "left menu closed");
    }

    @Override
    public void beginMenuOpened(SwipeMenuLayout swipeMenuLayout) {
        Log.e(TAG, "left menu opened");
    }

    @Override
    public void endMenuClosed(SwipeMenuLayout swipeMenuLayout) {
        Log.e(TAG, "right menu closed");
    }

    @Override
    public void endMenuOpened(SwipeMenuLayout swipeMenuLayout) {
        Log.e(TAG, "right menu opened");
    }
});

If you case a few actions, just use SimpleSwipeSwitchListener

sml.setSwipeListener(new SimpleSwipeSwitchListener(){
    @Override
    public void beginMenuClosed(SwipeMenuLayout swipeMenuLayout) {
        Log.e(TAG, "left menu closed");
    }
});

We also add a SwipeFractionListener for complete fraction action

sml.setSwipeFractionListener(new SwipeFractionListener() {
    @Override
    public void beginMenuSwipeFraction(SwipeMenuLayout swipeMenuLayout, float fraction) {
        Log.e(TAG, "top menu swipe fraction:"+fraction);

    }

    @Override
    public void endMenuSwipeFraction(SwipeMenuLayout swipeMenuLayout, float fraction) {
        Log.e(TAG, "bottom menu swipe fraction:"+fraction);
    }
});

If you case a few actions, just use SimpleSwipeFractionListener

sml.setSwipeFractionListener(new SimpleSwipeFractionListener(){
    @Override
    public void beginMenuSwipeFraction(SwipeMenuLayout swipeMenuLayout, float fraction) {
        Log.e(TAG, "top menu swipe fraction:"+fraction);
    }
});

Custom

Supported custom attrs:

  • sml_scroller_duration Scroller duration(ms), sml:sml_scroller_duration="250"
  • sml_auto_open_percent Swipe menu auto open percent(relative to menu's width), sml:sml_auto_open_percent="0.5"
  • sml_scroller_interpolator Scroller open/close interpolation, sml:sml_scroller_interpolator="@android:anim/bounce_interpolator"
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="SwipeMenu">
        <attr name="sml_scroller_duration" format="integer" />
        <attr name="sml_auto_open_percent" format="float"/>
        <attr name="sml_scroller_interpolator" format="reference"/>
    </declare-styleable>
</resources>

Thanks

Inspired by baoyongzhang/SwipeMenuListView

License

Copyright 2016 TUBB

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].