Exemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            _toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            if (_toolbar != null)
            {
                SetSupportActionBar(_toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);
                _toolbar.NavigationClick += delegate
                {
                    OnBackPressed();
                };
            }

            _adapter            = new ContactsListAdapter(this);
            _adapter.ItemClick += OnItemClick;

            var contactsListView = FindViewById <RecyclerView>(Resource.Id.contactsListView);

            contactsListView.SetAdapter(_adapter);
            contactsListView.SetLayoutManager(new LinearLayoutManager(contactsListView.Context));

            ItemTouchHelper.Callback callback        = new ContactsListCallBacks(_adapter, this);
            ItemTouchHelper          itemTouchHelper = new ItemTouchHelper(callback);

            itemTouchHelper.AttachToRecyclerView(contactsListView);
            contactsListView.SetItemAnimator(new DefaultItemAnimator());
        }
 private void UpdateAdapter()
 {
     if (_contactList != null)
     {
         ContactsListAdapter adapter = new ContactsListAdapter(Activity, this);
         _contactList.Adapter = adapter;
     }
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view = base.OnCreateView(inflater, container, savedInstanceState);
            var contactList = view.FindViewById <MvxListView>(Resource.Id.contacts_list);

            contactsAdapter     = new ContactsListAdapter(Activity, (IMvxAndroidBindingContext)BindingContext);
            contactList.Adapter = contactsAdapter;
            UndateControls();
            inviteService = new InviteService(this);
            return(view);
        }