protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); RecyclerListAdapter adapter = new RecyclerListAdapter(this); RecyclerView recyclerView = FindViewById<RecyclerView>(Resource.Id.recycler_view); recyclerView.HasFixedSize = true; recyclerView.SetAdapter(adapter); recyclerView.SetLayoutManager(new LinearLayoutManager(this)); ItemTouchHelper.Callback callback = new SimpleItemTouchHelperCallback(adapter); mItemTouchHelper = new ItemTouchHelper(callback); mItemTouchHelper.AttachToRecyclerView(recyclerView); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); RecyclerListAdapter adapter = new RecyclerListAdapter(this); RecyclerView recyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view); recyclerView.HasFixedSize = true; recyclerView.SetAdapter(adapter); recyclerView.SetLayoutManager(new LinearLayoutManager(this)); ItemTouchHelper.Callback callback = new SimpleItemTouchHelperCallback(adapter); mItemTouchHelper = new ItemTouchHelper(callback); mItemTouchHelper.AttachToRecyclerView(recyclerView); }