Permalink
Browse files

Add swipe ability

  • Loading branch information...
david-szabo97 committed Dec 11, 2017
1 parent 2b07633 commit ab961bf26ce729cbfe4848cf51d44a5df755712c
@@ -4,6 +4,7 @@
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
public class MainActivity extends AppCompatActivity {
@@ -21,6 +22,11 @@ protected void onCreate(Bundle savedInstanceState) {
// Layout manager
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManager);
// Add swipe
CustomItemTouchHelperCallback helperCb = new CustomItemTouchHelperCallback();
ItemTouchHelper helper = new ItemTouchHelper(helperCb);
helper.attachToRecyclerView(recyclerView);
}
}

0 comments on commit ab961bf

Please sign in to comment.