private void SetupRecyclerView (LogTimeEntriesViewModel viewModel) { // Touch listeners. itemTouchListener = new ItemTouchListener (recyclerView, this); recyclerView.AddOnItemTouchListener (itemTouchListener); // Scroll listener recyclerView.AddOnScrollListener ( new ScrollListener ((LinearLayoutManager)recyclerView.GetLayoutManager (), viewModel)); var touchCallback = new SwipeDismissCallback (ItemTouchHelper.Up | ItemTouchHelper.Down, ItemTouchHelper.Left, this); var touchHelper = new ItemTouchHelper (touchCallback); touchHelper.AttachToRecyclerView (recyclerView); // Decorations. dividerDecoration = new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList); shadowDecoration = new ShadowItemDecoration (Activity); recyclerView.AddItemDecoration (dividerDecoration); recyclerView.AddItemDecoration (shadowDecoration); recyclerView.GetItemAnimator ().SupportsChangeAnimations = false; }
private void SetupRecyclerView () { // Touch listeners. itemTouchListener = new ItemTouchListener (recyclerView, this); recyclerView.AddOnItemTouchListener (itemTouchListener); var touchCallback = new SwipeDismissCallback (ItemTouchHelper.Up | ItemTouchHelper.Down, ItemTouchHelper.Left, this); var touchHelper = new ItemTouchHelper (touchCallback); touchHelper.AttachToRecyclerView (recyclerView); // Decorations. dividerDecoration = new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList); shadowDecoration = new ShadowItemDecoration (Activity); recyclerView.AddItemDecoration (dividerDecoration); recyclerView.AddItemDecoration (shadowDecoration); recyclerView.GetItemAnimator ().SupportsChangeAnimations = false; }