コード例 #1
0
        public void GetAllContacts()
        {
            try
            {
                var listContacts =
                    new ObservableCollection <IMethods.PhoneContactManager.UserContact>(IMethods.PhoneContactManager
                                                                                        .GetAllContacts());
                var OrderBydate = listContacts.OrderBy(a => a.UserDisplayName);

                //Set Adapter
                mLayoutManager = new LinearLayoutManager(this);
                InviteFriendsRecyler.SetLayoutManager(mLayoutManager);

                mAdapter = new InviteFriends_Adapter(this);
                mAdapter.mUsersPhoneContacts =
                    new ObservableCollection <IMethods.PhoneContactManager.UserContact>(OrderBydate);
                //Event
                mAdapter.ItemClick += MAdapterOnItemClick;

                InviteFriendsRecyler.SetAdapter(mAdapter);

                InviteSMSText = GetText(Resource.String.Lbl_InviteSMSText_1) + " " + Settings.Application_Name + " " +
                                GetText(Resource.String.Lbl_InviteSMSText_2);
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                IMethods.IApp.FullScreenApp(this);

                // Set our view from the "BlockedUsers_Layout" layout resource
                SetContentView(Resource.Layout.Invite_Friends_Layout);

                //Get values
                InviteFriendsRecyler = FindViewById <RecyclerView>(Resource.Id.InviteFriends_Recylerview);

                //Set ToolBar
                var ToolBar = FindViewById <Toolbar>(Resource.Id.Searchtoolbar);
                ToolBar.Title = this.GetText(Resource.String.Lbl_Invite_Friends);

                SetSupportActionBar(ToolBar);

                SupportActionBar.SetDisplayShowCustomEnabled(true);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);
                SupportActionBar.SetDisplayShowHomeEnabled(true);

                //Set Adapter
                mLayoutManager = new LinearLayoutManager(this);
                InviteFriendsRecyler.SetLayoutManager(mLayoutManager);
                mAdapter = new InviteFriends_Adapter(this);
                mAdapter.mUsersPhoneContacts = new ObservableCollection <IMethods.PhoneContactManager.UserContact>();
                InviteFriendsRecyler.SetAdapter(mAdapter);


                GetAllContacts();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }