public TabViewAvailableUserList(string name, UserAdapter uAdapter, StaffingDb argDbObj, ViewAllUsersList argDhis)
 {
     mylocalName = name;
     userList    = uAdapter;
     tempDb      = argDbObj;
     dhis        = argDhis;
 }
        private void MySearchView_QueryTextChange(object sender, SearchView.QueryTextChangeEventArgs e)
        {
            String typedText = e.NewText;

            List <SingleUser> usersArray = tempDb.getAllusers();
            List <SingleUser> userList2  = new List <SingleUser>();



            if (typedText.Length >= 1)
            {
                string currentItemText = "";

                //Console.WriteLine("TYPED TEXT IS "+ typedText);

                for (int i = 0; i < usersArray.Count; i++)
                {
                    currentItemText = usersArray[i].fname;

                    Console.WriteLine(currentItemText);

                    if (currentItemText.Contains(typedText))
                    {
                        userList2.Add(usersArray[i]);
                    }
                }
                UserAdapter myAdapter2 = new UserAdapter(dhis, userList2);

                availbleListView.Adapter = myAdapter2;
            }
            else
            {
                availbleListView.Adapter = userList;
            }
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(Android.Views.WindowFeatures.ActionBar);
            this.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;

            base.OnCreate(savedInstanceState);

            tempDb = new StaffingDb(this);


            SetContentView(Resource.Layout.FMlayout);



            List <SingleUser> userRecords = tempDb.getAllusers();
            UserAdapter       tbvallList  = new UserAdapter(this, userRecords);

            //mylistview.Adapter = myAdapter;

            _fragmentsArray = new Fragment[]
            {
                new TabViewAllUsersList("All Users", tbvallList, tempDb, this),     //, TabViewAllUsersList
                new TabViewAvailableUserList("Available Users", tbvallList, tempDb, this),
                new TabViewSelectedList("Selected", tbvallList, tempDb, this),      //, myAdapter
            };


            AddTabToActionBar("View All");  //First Tab
            AddTabToActionBar("Available"); //Second Tab
            AddTabToActionBar("Selected");  //Third Tab

            //
        }