protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource

            SetContentView(Resource.Layout.Main);

            recycler = FindViewById <RecyclerView>(Resource.Id.recyclerView);

            btnFloatCreateUser = FindViewById <FloatingActionButton>(Resource.Id.fab);

            //Plug in the linear layout manager:

            layoutManager = new LinearLayoutManager(this);
            recycler.SetLayoutManager(layoutManager);

            // Plug in my adapter:

            Repository repo = new Repository(new UsersList());

            adapter            = new RecyclerViewAdapter(repo);
            adapter.ItemClick += OnItemClick;
            recycler.SetAdapter(adapter);

            btnFloatCreateUser.Click += delegate
            {
                ShowCreateNewUserPage();
            };

            var controller = new Controller(this, repo);

            controller.Start();
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource

            SetContentView(Resource.Layout.Main);

            recycler = FindViewById <RecyclerView>(Resource.Id.recyclerView);

            // Plug in the linear layout manager:

            layoutManager = new LinearLayoutManager(this);
            recycler.SetLayoutManager(layoutManager);

            // Plug in my adapter:

            Repository repo = new Repository(new UsersList());

            adapter = new RecyclerViewAdapter(repo);
            recycler.SetAdapter(adapter);


            var controller = new Controller(this, repo);

            controller.Start();
        }