示例#1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.counters_view);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            var recyclerView = FindViewById <MvxRecyclerView>(Resource.Id.recycler_view);

            recyclerView.SetLayoutManager(new LinearLayoutManager(this));

            var callback    = new SwipeItemTouchHelperCallback(ViewModel);
            var touchHelper = new ItemTouchHelper(callback);

            touchHelper.AttachToRecyclerView(recyclerView);
        }
示例#2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.counters_view);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            var recyclerView = FindViewById <MvxRecyclerView>(Resource.Id.recycler_view); //Finds the recycler view in the UI, and sets its layout manager

            recyclerView.SetLayoutManager(new LinearLayoutManager(this));                 //Layout managers arranges items in a verticle list

            var callback    = new SwipeItemTouchHelperCallback(ViewModel);                //creates the callback and uses it to construct a touch helper and attatch it to the recycler view
            var touchHelper = new ItemTouchHelper(callback);

            touchHelper.AttachToRecyclerView(recyclerView);
        }
示例#3
0
        protected override void OnCreate(Bundle bundle)
        {
            Android.Util.Log.WriteLine(Android.Util.LogPriority.Debug, "Countr", "Tatiana: inside OnCreate() method in CountersView.cs");

            base.OnCreate(bundle);

            SetContentView(Resource.Layout.counters_view);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            var recyclerView = FindViewById <MvxRecyclerView>(Resource.Id.recycler_view);

            recyclerView.SetLayoutManager(new LinearLayoutManager(this));

            var callback    = new SwipeItemTouchHelperCallback(ViewModel);
            var touchHelper = new ItemTouchHelper(callback);

            touchHelper.AttachToRecyclerView(recyclerView);
        }