CircularDeletionSwipe

Additional

Language
Java
Version
N/A
Created
Dec 27, 2017
Updated
Dec 27, 2017
Owner
Meclot Yoann (MSay2)
Contributor
Meclot Yoann (MSay2)
1
Activity
Badge
Generate
Download
Source code
APK file

Advertisement

CircularDeletionSwipe

Description

This project implements one of the most beautiful animations of the class RecyclerView, the class ItemTouchHelper.

The ItemTouchHelper class implements the dragging of each object on the RecyclerView class by revealing a view under the first sliding view.

Please, refer to this link to learn more about the class ItemTouchHelper.

This project shows you not only how to implement this animation but also to add a circular animation that will coordinate with the sliding of your finger.

Use

First

Copy the DeletionSwipeHelper java file to your project

Secondly

Implemented the interface of the DeletionSwipeHelper class to include a sliding listener

public class MainActivity extends AppCompatActivity implements DeletionSwipeHelper.OnSwipeListener

Then implement the onSwiped abstract methods

Thirdly

Note this import import android.support.v7.widget.helper.ItemTouchHelper;

Fourth

Note these lines of programming in the onCreate method to initiate the DeletionSwipeHelper class

ItemTouchHelper.Callback callback = new DeletionSwipeHelper(0, ItemTouchHelper.START, this, this);
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(callback);
itemTouchHelper.attachToRecyclerView(recycler);

Example of use

Clone Git Repository

Please refresh build

License

Copyright 2017 MSay2

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.