All Projects → BelkaLab → Swiperoo

BelkaLab / Swiperoo

Licence: MIT license
An extendable adapter which provides swipe-to-delete feature on your customized row item

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Swiperoo

ohloh scm
The Ohloh source control management library
Stars: ✭ 58 (+52.63%)
Mutual labels:  adapter
YAAdapterTableViewWithResponderChain
No description or website provided.
Stars: ✭ 15 (-60.53%)
Mutual labels:  adapter
RecyclerViewAdapter
A RecyclerView Adapter that support load more and add headerview
Stars: ✭ 145 (+281.58%)
Mutual labels:  adapter
guzzle-psr18-adapter
A simple guzzle PSR-18 adapter
Stars: ✭ 13 (-65.79%)
Mutual labels:  adapter
Java-design-patterns
Java Design patterns.
Stars: ✭ 49 (+28.95%)
Mutual labels:  factory-pattern
vscode-server-connector
📦 Connects Visual Studio Code to your server adapters and run, deploy apps !!
Stars: ✭ 41 (+7.89%)
Mutual labels:  adapter
serial2mqtt
Serial to MQTT adapter serivce
Stars: ✭ 21 (-44.74%)
Mutual labels:  adapter
laravel-casbin
This repository has moved to https://github.com/php-casbin/laravel-authz
Stars: ✭ 42 (+10.53%)
Mutual labels:  adapter
casbin-pg-adapter
A go-pg adapter for casbin
Stars: ✭ 23 (-39.47%)
Mutual labels:  adapter
ioBroker.vis-inventwo
Individualisierbare VIS Widgets für den ioBroker
Stars: ✭ 38 (+0%)
Mutual labels:  adapter
ARVI
Android library designed to simplify the implementation of the video autoplay in the RecyclerView
Stars: ✭ 69 (+81.58%)
Mutual labels:  adapter
TheGreatAdapter
Multiple items adapter made too easy, including headers and footers.
Stars: ✭ 46 (+21.05%)
Mutual labels:  adapter
sqlx-adapter
Asynchronous casbin adapter for mysql, postgres, sqlite based on sqlx-rs
Stars: ✭ 27 (-28.95%)
Mutual labels:  adapter
ioBroker.epson stylus px830
Zustand Druckerpatronen im EPSON Stylus PX830 für ioBroker auslesen
Stars: ✭ 18 (-52.63%)
Mutual labels:  adapter
ioBroker.homepilot20
Rademacher Homepilot 2.0 (version >= 5.0.39)
Stars: ✭ 19 (-50%)
Mutual labels:  adapter
modules
Java & REST API's for creating and running integrations
Stars: ✭ 16 (-57.89%)
Mutual labels:  adapter
BlueRetro
Multiplayer Bluetooth controllers adapter for retro video game consoles
Stars: ✭ 520 (+1268.42%)
Mutual labels:  adapter
GenericAdapter
⛳️ Easy to use android databinding ready recyclerview adapter
Stars: ✭ 26 (-31.58%)
Mutual labels:  adapter
RvAdapter
万能Adapter for RecyclerView.
Stars: ✭ 34 (-10.53%)
Mutual labels:  adapter
blackmagic-espidf
Blackmagic Wireless SWD Debug probe hosted on esp-idf SDK (for ESP8266) with UART on Telnet port and HTTP using xterm.js
Stars: ✭ 165 (+334.21%)
Mutual labels:  adapter

Swiperoo Adapter

An extandable adapter which provides swipe to delete on your row item.

Live demo

alt text

Inspired by: https://github.com/nemanja-kovacevic/recycler-view-swipe-to-delete

Installation

Gradle

Add Gradle dependency:

dependencies {
    compile 'us.belka:swiperoo-library:1.0.0'
}

Maven

<dependency>
  <groupId>us.belka</groupId>
  <artifactId>swiperoo-library</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Usage

In the app folder you will find a working example of the library

You need to do 3 things to make the library works:

1. Create your ViewHolder

    public class MyViewHolder extends SwiperooViewHolder<String> {

        static class Factory implements SwiperooViewHolder.Factory {

            @Override
            public SwiperooViewHolder createViewHolder(Context context, ViewGroup parent, int viewType) {
                return new MyViewHolder(from(context).inflate(YOUR_ITEM_LAYOUT, parent, false), context);
            }
        }

        public MyViewHolder(View itemView, Context context) {
            super(itemView, context);
        }

        @Override
        public void bindViewHolder(String data) {

        }
    }

Pay attention to the Factory class, you need to return an instance of your ViewHolder (Factory pattern)

2. Create your Adapter

    public class MyAdapter extends SwiperooAdapter<String> {

        public MyAdapter(Context context, List<String> items, Listener listener, SwiperooViewHolder.Factory factory) {
            super(context, items, listener, factory);
        }
    }

3. Put it all togheter

    mSwiperooRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    MyAdapter adapter = new MyAdapter(this, items, this, new MyViewHolder.Factory());

    mSwiperooRecyclerView.setAdapter(adapter);

    adapter.addSupportToSwipeToDelete(this, mSwiperooRecyclerView);

You can use "this" as third parameter in the Adapter or you can directly pass in an implementation of the Listener, both ways you will implement the interface to handle item delete

Listeners

@Override
    public void onItemDeleted(String item) {
       ///Do your stuff with the deleted item
    }

Pay attention

Your item layout container must be a Relative Layout, otherwise the Holder will throw you a NotSupportedException

License

Swiperoo is Copyright (c) 2017 Belka, srl. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About Belka

Belka Logo

Belka is a Digital Agency specialized in design, mobile applications development and custom solutions. We love open source software! You can see our projects or look at our case studies.

Interested? Hire us to help build your next amazing project.

www.belka.us

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].