{"id":13390504,"url":"https://github.com/xcodebuild/RecyclerViewSwipeDismiss","last_synced_at":"2025-03-13T15:32:02.928Z","repository":{"id":31378256,"uuid":"34941290","full_name":"xcodebuild/RecyclerViewSwipeDismiss","owner":"xcodebuild","description":"A very easy-to-use and non-intrusive implement of Swipe to dismiss for RecyclerView.","archived":false,"fork":false,"pushed_at":"2018-05-03T21:00:54.000Z","size":149,"stargazers_count":430,"open_issues_count":8,"forks_count":87,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-04-24T11:13:39.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xcodebuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-02T08:51:19.000Z","updated_at":"2023-09-04T00:24:48.000Z","dependencies_parsed_at":"2022-08-17T18:31:02.694Z","dependency_job_id":null,"html_url":"https://github.com/xcodebuild/RecyclerViewSwipeDismiss","commit_stats":null,"previous_names":["codefalling/recyclerviewswipedismiss"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcodebuild%2FRecyclerViewSwipeDismiss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcodebuild%2FRecyclerViewSwipeDismiss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcodebuild%2FRecyclerViewSwipeDismiss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcodebuild%2FRecyclerViewSwipeDismiss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xcodebuild","download_url":"https://codeload.github.com/xcodebuild/RecyclerViewSwipeDismiss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221380072,"owners_count":16809014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T14:01:07.053Z","updated_at":"2024-10-25T03:30:39.638Z","avatar_url":"https://github.com/xcodebuild.png","language":"Java","readme":"![](https://img.shields.io/badge/Maintained%3F-NO%20LONGER-red.svg?style=flat)\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-RecyclerViewSwipeDismiss-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1838)\n![BSD](http://img.shields.io/badge/license-BSD-green.svg)\n[![Jitpack](https://img.shields.io/github/release/CodeFalling/RecyclerViewSwipeDismiss.svg?label=JitPack%20Maven)](https://jitpack.io/#CodeFalling/RecyclerViewSwipeDismiss/)\n[![Build Status](https://travis-ci.org/CodeFalling/RecyclerViewSwipeDismiss.svg?branch=master)](https://travis-ci.org/CodeFalling/RecyclerViewSwipeDismiss)\n# RecyclerViewSwipeDismiss\nA very easy-to-use and non-intrusive implement of Swipe to dismiss for RecyclerView.\n\n## Preview\n\n![preview](RecyclerViewSwipeDismiss.gif)\n\n\n## How to use\n\n- Add these lines to your `build.gradle`\n\n```gradle\nrepositories {\n\tmaven {\n\t    url \"https://jitpack.io\"\n\t}\n}\n\ndependencies {\n\t compile 'com.github.CodeFalling:RecyclerViewSwipeDismiss:v1.1.3'\n}\n```\n\n- Build `onTouchListener` and bind it to your `RecyclerView`\n\n```java\n\nSwipeDismissRecyclerViewTouchListener listener = new SwipeDismissRecyclerViewTouchListener.Builder(\n        recyclerView,\n        new SwipeDismissRecyclerViewTouchListener.DismissCallbacks() {\n            @Override\n            public boolean canDismiss(int position) {\n                return true;\n            }\n\n            @Override\n            public void onDismiss(View view) {\n                // Do what you want when dismiss\n                \n            }\n        })\n        .setIsVertical(false)\n        .setItemTouchCallback(\n                new SwipeDismissRecyclerViewTouchListener.OnItemTouchCallBack() {\n                    @Override\n                    public void onTouch(int index) {\n                    \t// Do what you want when item be touched\n                    }\n                })\n        .setItemClickCallback(new SwipeDismissRecyclerViewTouchListener.OnItemClickCallBack() {\n                    @Override\n                    public void onClick(int position) {\n                        // Do what you want when item be clicked                    }\n                })\n        .setBackgroundId(R.drawable.bg_item_normal, R.drawable.bg_item_selected)\n        .create();\nrecyclerView.setOnTouchListener(listener);\n```\n\n## More\n\n- `setIsVertical(false)` means allow **swipe in horizontal direction** \n\n- `listener.setEnabled(false)` can disable swipe to dismiss\n\n- `onTouch` will be called when MOUSE_UP on item without swipe\n\n- `onClick` will be called when ACTION_UP on item within 1 second and move no more than a fixed distance\n\n- By use `setBackgroundId`, you can set background id for item's normal and pressed state, just like the normal effect in RecyclerView\n\n## Sample\n\nYou can see sample code in [`sample/MainActivity.java`](https://github.com/CodeFalling/RecyclerViewSwipeDismiss/blob/master/app%2Fsrc%2Fmain%2Fjava%2Fio%2Fgithub%2Fcodefalling%2Frecyclerviewswipedismiss%2Fsample%2FMainActivity.java)\n","funding_links":[],"categories":["Index `(light-weight pages)`","Index"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcodebuild%2FRecyclerViewSwipeDismiss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxcodebuild%2FRecyclerViewSwipeDismiss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcodebuild%2FRecyclerViewSwipeDismiss/lists"}