Пример #1
0
        public AutoComplete_Mobile()
        {
            mainPageDesign();
            //countryAutoComplete
            countryAutoComplete = new SfAutoComplete();
            countryAutoComplete.AutoCompleteSource   = countryList;
            countryAutoComplete.SuggestionMode       = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeStartsWith;
            countryAutoComplete.Watermark            = (NSString)"Enter a country name";
            countryAutoComplete.MaxDropDownHeight    = 100;
            countryAutoComplete.TextHighlightMode    = OccurrenceMode.FirstOccurrence;
            countryAutoComplete.HighlightedTextColor = UIColor.Blue;
            countryAutoComplete.AutoCompleteMode     = SFAutoCompleteAutoCompleteMode.SFAutoCompleteAutoCompleteModeSuggest;

            //jobFieldAutoComplete
            jobFieldAutoComplete = new SfAutoComplete();
            jobFieldAutoComplete.AutoCompleteSource   = jobTitle;
            jobFieldAutoComplete.SuggestionMode       = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeStartsWith;
            jobFieldAutoComplete.Watermark            = (NSString)"Starts with ’S’, ‘M’ or ‘B’";
            jobFieldAutoComplete.MaxDropDownHeight    = 90;
            jobFieldAutoComplete.TextHighlightMode    = OccurrenceMode.FirstOccurrence;
            jobFieldAutoComplete.HighlightedTextColor = UIColor.Blue;
            jobFieldAutoComplete.AutoCompleteMode     = SFAutoCompleteAutoCompleteMode.SFAutoCompleteAutoCompleteModeSuggest;

            this.AddSubview(countryAutoComplete);
            this.AddSubview(jobFieldAutoComplete);

            loadOptionView();
        }
Пример #2
0
        UIView NativeAutoComplete_DropDownItemChanged(object sender, DropDownItemEventArgs e)
        {
            UIView         parentView = new UIView();
            SfAutoComplete auto       = (sender as SfAutoComplete);

            parentView.Frame = new CGRect(0, 0, auto.Bounds.Width, auto.ItemHeight);
            UIImageView imageView = new UIImageView();

            imageView.Frame = new CGRect(5, 5, 50, auto.ItemHeight - 10);
            UILabel titleLabel = new UILabel();

            titleLabel.Frame         = new CGRect(60, 5, auto.Bounds.Width - 65, auto.ItemHeight / 2 - 5);
            titleLabel.TextAlignment = UITextAlignment.Left;
            UILabel resultLabel = new UILabel();

            resultLabel.Frame         = new CGRect(60, auto.ItemHeight / 2, auto.Bounds.Width - 65, auto.ItemHeight / 2 - 5);
            resultLabel.Font          = UIFont.FromName("Helvetica", 12f);
            resultLabel.TextAlignment = UITextAlignment.Left;

            var item           = auto.DataSource.ElementAt((int)e.Index);
            var selectedObject = (item as ContactsInfo);

            imageView.Image  = new UIImage(selectedObject.ContactImage);
            titleLabel.Text  = selectedObject.ContactName;
            resultLabel.Text = selectedObject.ContactNumber;

            parentView.AddSubview(imageView);
            parentView.AddSubview(titleLabel);
            parentView.AddSubview(resultLabel);

            e.View = parentView;

            return(e.View);
        }
Пример #3
0
        public ToleratingTypos_Tablet()
        {
            headerlabel               = new UILabel();
            headerlabel.Text          = "Search by Countries";
            headerlabel.TextColor     = UIColor.Black;
            headerlabel.TextAlignment = UITextAlignment.Left;
            this.AddSubview(headerlabel);

            countryAutoComplete = new SfAutoComplete();
            CountryCollection();
            countryAutoComplete.Watermark          = (NSString)"Search Here";
            countryAutoComplete.MaxDropDownHeight  = 100;
            countryAutoComplete.FilterItemChanged += CountryAutoComplete_FilterItemChanged;
            this.AddSubview(countryAutoComplete);
            List <string> items = new List <string>();

            items.Add("India");
            items.Add("Iran");
            items.Add("Iraq");
            items.Add("Indonesia");
            countryAutoComplete.DataSource     = items;
            countryAutoComplete.SuggestionMode = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeCustom;
            searchresults               = new UILabel();
            searchresults.Text          = "Search Results";
            searchresults.TextColor     = UIColor.Gray;
            searchresults.TextAlignment = UITextAlignment.Left;
            this.AddSubview(searchresults);
            tableView  = new UITableView();
            tableItems = new string[] { "General", "Maps", "News", "Video", "Music", "Books", "Flight", "Quick Search" };
            imageItems = new string[] { "all.png", "Maps1.png", "Newspaper.png", "Media.png", "Music.png", "Book.png", "Aeroplane.png", "Picture.png" };

            ToleratingTypoTableView tableViewSource = new ToleratingTypoTableView(tableItems, imageItems);

            tableView.Source = tableViewSource;
            this.AddSubview(tableView);
            countryAutoComplete.SelectionChanged += (object sender, SelectionEventArgs e) =>
            {
                if ((sender as SfAutoComplete).SelectedIndex != -1)
                {
                    tableViewSource.initial = true;
                    tableViewSource.random  = new Random().Next(10000, 99999);
                    tableView.ReloadData();
                }
                if ((sender as SfAutoComplete).SelectedIndex == -1)
                {
                    tableViewSource.initial = false;
                    tableViewSource.random  = 0;
                    tableView.ReloadData();
                }
            };

            countryAutoComplete.TextChanged += (object sender, TextEventArgs e) =>
            {
                tableViewSource.initial = false;
                tableViewSource.random  = 0;
                tableView.ReloadData();
            };
            helper = new ToleratingTyposHelper();
        }
Пример #4
0
        public void UpdateStoreName(Object sender, EventArgs e)
        {
            try
            {
                ObservableCollection <ListStores>  listStores   = SharedUserData.listStore; //Change ObservableCollection into List
                ObservableCollection <ListProduct> listProducts = SharedUserData.addProduct;
                Button b = (Button)sender;                                                  //Change var into Button

                AbsoluteLayout relative   = (AbsoluteLayout)b.ParentView;                   //Change var into AbsoluteLayout
                SfAutoComplete viewEntry1 = (SfAutoComplete)relative.Children[2];           //Change var into SfAutoComplete
                Entry          viewEntry2 = (Entry)relative.Children[3];                    //Change var into Entry

                Label labelStore1 = (Label)relative.Children[0];                            //Change var into Label
                labelStore1.IsVisible = false;

                Label labelStore2 = (Label)relative.Children[1]; //Change var into Label
                labelStore2.IsVisible = false;

                foreach (ListStores list in listStores)
                {
                    if (labelStore1.Text == list.store)
                    {
                        list.store = viewEntry1.Text;
                        if (viewEntry2.Text == "")
                        {
                            list.storeSuburb = "(No Suburbs)";
                        }
                        else
                        {
                            list.storeSuburb = viewEntry2.Text;
                        }
                    }
                }

                if (listProducts != null)
                {
                    foreach (ListProduct listProduct in listProducts)
                    {
                        if (labelStore1.Text == listProduct.store)
                        {
                            listProduct.store = viewEntry1.Text;

                            listProduct.detailItem = listProduct.quantity + " " + listProduct.unit + " " + listProduct.items + " " + listProduct.size + " FROM " + viewEntry1.Text;
                        }
                    }
                }
                SharedUserData.listStore  = listStores;
                SharedUserData.addProduct = listProducts;
                viewEntry1.IsVisible      = false;
                labelStore1.IsVisible     = true;
                labelStore2.IsVisible     = true;
                listView.ItemsSource      = null;
                listView.ItemsSource      = SharedUserData.listStore;
            }catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }
Пример #5
0
        public async Task <object> GetMatchingItemsAsync(SfAutoComplete source, AutoCompleteFilterInfo filterInfo)
        {
            IEnumerable itemssource   = source.ItemsSource as IEnumerable;
            var         filteredItems = (from CityInfo item in itemssource
                                         where item.CountryName.StartsWith(filterInfo.Text, StringComparison.CurrentCultureIgnoreCase) ||
                                         item.CityName.StartsWith(filterInfo.Text, StringComparison.CurrentCultureIgnoreCase)
                                         select item);

            return(await Task.FromResult(filteredItems));
        }
Пример #6
0
        public MultiSelection()
        {
            //ToAutoComplete
            toAutoComplete = new SfAutoComplete();
            toAutoComplete.MultiSelectMode      = MultiSelectMode.Token;
            toAutoComplete.TokensWrapMode       = TokensWrapMode.Wrap;
            toAutoComplete.DataSource           = new ContactsInfoCollection().GetContactDetails();
            toAutoComplete.DisplayMemberPath    = (NSString)"ContactName";
            toAutoComplete.ImageMemberPath      = "ContactImage";
            toAutoComplete.ItemHeight           = 60;
            toAutoComplete.SuggestionMode       = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeStartsWith;
            toAutoComplete.DropDownItemChanged += NativeAutoComplete_DropDownItemChanged;
            this.AddSubview(toAutoComplete);

            //CCAutoComplete
            ccAutoComplete = new SfAutoComplete();
            ccAutoComplete.MultiSelectMode      = MultiSelectMode.Token;
            ccAutoComplete.TokensWrapMode       = TokensWrapMode.Wrap;
            ccAutoComplete.DataSource           = new ContactsInfoCollection().GetContactDetails();
            ccAutoComplete.DisplayMemberPath    = (NSString)"ContactName";
            ccAutoComplete.ImageMemberPath      = "ContactImage";
            ccAutoComplete.ItemHeight           = 60;
            ccAutoComplete.DropDownItemChanged += NativeAutoComplete_DropDownItemChanged;
            ccAutoComplete.SuggestionMode       = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeStartsWith;
            this.AddSubview(ccAutoComplete);

            //BCCAutoComplete
            bccAutoComplete = new SfAutoComplete();
            bccAutoComplete.MultiSelectMode      = MultiSelectMode.Token;
            bccAutoComplete.TokensWrapMode       = TokensWrapMode.Wrap;
            bccAutoComplete.DataSource           = new ContactsInfoCollection().GetContactDetails();
            bccAutoComplete.DisplayMemberPath    = (NSString)"ContactName";
            bccAutoComplete.ItemHeight           = 60;
            bccAutoComplete.ImageMemberPath      = "ContactImage";
            bccAutoComplete.DropDownItemChanged += NativeAutoComplete_DropDownItemChanged;
            bccAutoComplete.SuggestionMode       = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeStartsWith;
            this.AddSubview(bccAutoComplete);

            //SubjectBox
            subjectBox                    = new UITextField();
            subjectBox.Placeholder        = " Subject";
            subjectBox.Font               = UIFont.FromName("Helvetica", 15f);
            subjectBox.Layer.BorderWidth  = 0.5f;
            subjectBox.Layer.CornerRadius = 5f;
            subjectBox.Layer.BorderColor  = UIColor.FromRGB(200, 200, 200).CGColor;
            this.AddSubview(subjectBox);
            //MessageBox
            messageBox      = new UITextField();
            messageBox.Text = "Sent from my smart phone.";
            messageBox.Font = UIFont.FromName("Helvetica", 12f);
            this.AddSubview(messageBox);

            mainPageDesign();
        }
        private void BccMethod(Android.Content.Context con)
        {
            LinearLayout bccLayout = new LinearLayout(con);

            bccLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(50 * density));
            bccLayout.Orientation      = Orientation.Horizontal;
            bccLayout.SetGravity(GravityFlags.Center);
            bccLayout.SetPadding(0, 0, 10, 0);

            TextView bccText = new TextView(con);

            bccText.LayoutParameters = new LinearLayout.LayoutParams((int)(width * 0.15), (int)(50 * density));
            bccText.Text             = "Bcc";
            bccText.TextSize         = 20;
            bccText.TextAlignment    = TextAlignment.Center;
            bccText.Gravity          = GravityFlags.Center;
            bccLayout.AddView(bccText);

            SfAutoComplete bccAutoComplete = new SfAutoComplete(con);

            bccAutoComplete.LayoutParameters = new LinearLayout.LayoutParams((int)(width * 0.85), (int)(45));
            bccAutoComplete.MultiSelectMode  = MultiSelectMode.Token;
            bccAutoComplete.SetGravity(GravityFlags.Center);
            bccAutoComplete.DataSource            = new AutoCompleteContactsInfoRepository().GetContactDetails();
            bccAutoComplete.DisplayMemberPath     = "ContactName";
            bccAutoComplete.TokensWrapMode        = TokensWrapMode.Wrap;
            bccAutoComplete.DropDownCornerRadius  = 4;
            bccAutoComplete.ImageMemberPath       = "ContactImage";
            bccAutoComplete.MaximumDropDownHeight = 150;
            bccAutoComplete.DropDownItemHeight    = 60;
            CustomAutoCompleteAdapterToken customAdapter = new CustomAutoCompleteAdapterToken();

            customAdapter.autoComplete1 = bccAutoComplete;
            bccAutoComplete.Adapter     = customAdapter;
            bccLayout.AddView(bccAutoComplete);
            bccAutoComplete.FocusChanged += (sender, e) =>
            {
                //if (e.HasFocus)
                //{
                //	bccLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(90 * density));
                //	bccText.LayoutParameters = new LinearLayout.LayoutParams((int)(width * 0.15), (int)(90 * density));
                //	bccAutoComplete.LayoutParameters = new LinearLayout.LayoutParams((int)(width * 0.85), (int)(90 ));
                //}
                //else
                //{
                //	bccLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(50 * density));
                //	bccText.LayoutParameters = new LinearLayout.LayoutParams((int)(width * 0.15), (int)(50 * density));
                //	bccAutoComplete.LayoutParameters = new LinearLayout.LayoutParams((int)(width * 0.85), (int)(50 ));
                //}
            };

            mainLayout.AddView(bccLayout);
        }
 public Diacritics_Sense()
 {
     this.addingdiacriticsList();
     diacriticsAutoComplete = new SfAutoComplete();
     diacriticsAutoComplete.AutoCompleteSource = diacriticsList;
     diacriticsAutoComplete.SuggestionMode     = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeContains;
     diacriticsAutoComplete.Watermark          = (NSString)"Search Text";
     diacriticsAutoComplete.MaxDropDownHeight  = 200;
     diacriticsAutoComplete.AutoCompleteMode   = SFAutoCompleteAutoCompleteMode.SFAutoCompleteAutoCompleteModeSuggest;
     diacriticsAutoComplete.IgnoreDiacritic    = false;
     this.AddSubview(diacriticsAutoComplete);
 }
        private void FilterSelection_Changed(object sender, Syncfusion.SfAutoComplete.XForms.SelectionChangedEventArgs e)
        {
            SfAutoComplete autoComplete = (SfAutoComplete)sender;

            if (autoComplete.SelectedItem != null)
            {
                Apply.IsEnabled = true;
            }
            else
            {
                Apply.IsEnabled = false;
            }
        }
Пример #10
0
        public int GetHighlightIndex(SfAutoComplete source, AutoCompleteSearchInfo searchInfo)
        {
            var filteredCapitals = from CityInfo cityInfo in searchInfo.FilteredItems
                                   where cityInfo.IsCapital
                                   select searchInfo.FilteredItems.IndexOf(cityInfo);

            if (filteredCapitals.Count() > 0)
            {
                return(filteredCapitals.FirstOrDefault());
            }

            return(0);
        }
Пример #11
0
 public AutoCompletePage()
 {
     Content = new SfAutoComplete
     {
         HeightRequest      = 40,
         AutoCompleteSource = new List <string>
         {
             "Edge",
             "Firefox",
             "Chrome",
             "Opera",
             "Safari",
         }
     }.CenterVertical().FillExpandHorizontal();
 }
Пример #12
0
 public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 {
     view = inflater.Inflate(Resource.Layout.dialog_new_grocery_layout, container, false);
     groceriesAutoComplete = view.FindViewById <SfAutoComplete>(Resource.Id.autoCompleteGrocery);
     categoriesComboBox    = view.FindViewById <SfComboBox>(Resource.Id.cmboBoxCategories);
     AutoCompleteInit();
     unitTextView        = view.FindViewById <TextView>(Resource.Id.txtUnitNewGroceryDialog);
     amountEditText      = view.FindViewById <EditText>(Resource.Id.editTxtAmountGrocery);
     okButton            = view.FindViewById <Button>(Resource.Id.btnOK);
     cancelButton        = view.FindViewById <Button>(Resource.Id.btnCancel);
     okButton.Click     += OkButton_Click;
     cancelButton.Click += CancelButton_Click;
     groceriesAutoComplete.TextChanged += GroceriesAutoComplete_TextChanged;
     return(view);
 }
Пример #13
0
        public async Task <object> GetMatchingItemsAsync(SfAutoComplete source, AutoCompleteFilterInfo filterInfo)
        {
            List <ContinentInfo> list        = new List <ContinentInfo>();
            IEnumerable          itemsSource = source.ItemsSource as IEnumerable;

            list.AddRange(from item in itemsSource.Cast <ContinentInfo>()
                          let filteritem = this.GetStringFromMemberPath(item, nameof(item.Country))
                                           where filteritem.Contains(filterInfo.Text, StringComparison.CurrentCultureIgnoreCase)
                                           select item);

            var collectionViewSource = new CollectionViewSource();

            collectionViewSource.Source          = list.GroupBy(item => item.Continent);
            collectionViewSource.IsSourceGrouped = true;

            return(await Task.FromResult(collectionViewSource.View));
        }
        private void AutoCompleteMethod(Android.Content.Context con)
        {
            SfAutoComplete diacriticAutoComplete = new SfAutoComplete(con);

            diacriticAutoComplete.LayoutParameters = new LinearLayout.LayoutParams((int)(width * 0.95), (int)(50));
            diacriticAutoComplete.SetGravity(GravityFlags.Center);
            diacriticAutoComplete.DisplayMemberPath     = "SongTitle";
            diacriticAutoComplete.DataSource            = new MusicInfoRepository().GetMusicInfo();
            diacriticAutoComplete.MaximumDropDownHeight = 150;
            diacriticAutoComplete.Watermark             = "Search here";
            diacriticAutoComplete.SuggestionMode        = SuggestionMode.Contains;
            diacriticAutoComplete.TextHighlightMode     = OccurrenceMode.MultipleOccurrence;
            diacriticAutoComplete.DropDownItemHeight    = 40;
            diacriticAutoComplete.IgnoreDiacritic       = false;


            mainLayout.AddView(diacriticAutoComplete);
        }
Пример #15
0
        public async Task <object> GetMatchingItemsAsync(SfAutoComplete source, AutoCompleteFilterInfo filterInfo)
        {
            if (this.cancellationTokenSource != null)
            {
                this.cancellationTokenSource.Cancel();
                this.cancellationTokenSource.Dispose();
            }

            this.cancellationTokenSource = new CancellationTokenSource();
            CancellationToken token = this.cancellationTokenSource.Token;

            return(await Task.Run(() =>
            {
                List <string> list = new List <string>();
                for (int i = 1; i < 100; i++)
                {
                    list.Add(filterInfo.Text + i);
                }

                return list;
            }, token));
        }
Пример #16
0
        private void AutoCompleteMethod(Android.Content.Context con)
        {
            SfAutoComplete toleratingAutoComplete = new SfAutoComplete(con);

            toleratingAutoComplete.LayoutParameters = new LinearLayout.LayoutParams((int)(width * 0.95), (int)(50));
            toleratingAutoComplete.SetGravity(GravityFlags.Start);
            toleratingAutoComplete.DataSource            = new Countrylist().Country;
            toleratingAutoComplete.Filter                = AutoCompleteSearch;
            toleratingAutoComplete.SuggestionMode        = SuggestionMode.Custom;
            toleratingAutoComplete.DropDownItemHeight    = 40;
            toleratingAutoComplete.MaximumDropDownHeight = 150;
            toleratingAutoComplete.Watermark             = "Search Here";
            CustomAutoCompleteAdapter customAdapter = new CustomAutoCompleteAdapter();

            customAdapter.autoComplete1    = toleratingAutoComplete;
            toleratingAutoComplete.Adapter = customAdapter;
            ListSource          = userData.Users;
            myCustomListAdapter = new MyCustomListAdapter(ListSource);

            toleratingAutoComplete.SelectionChanged += (sender, e) => {
                int valueCount = 0;
                if (e.Value == null || e.Value.ToString() == "")
                {
                    valueCount = 0;
                }
                else
                {
                    valueCount = 100000;
                }

                foreach (var item in ListSource)
                {
                    item.Count = random.Next(valueCount).ToString();
                }
                myCustomListAdapter.NotifyDataSetChanged();
            };

            mainLayout.AddView(toleratingAutoComplete);
        }
Пример #17
0
        private void LabelInitialization()
        {
            //LabelInizialization
            countryNameAutoComplete     = new SfAutoComplete(con);
            jobFieldAutoComplete        = new SfAutoComplete(con);
            jobSearchLabel              = new TextView(con);
            countryLabel                = new TextView(con);
            jobFieldLabel               = new TextView(con);
            experienceLabel             = new TextView(con);
            jobSearchLabelSpacing       = new TextView(con);
            countryLabelSpacing         = new TextView(con);
            countryAutoCompleteSpacing  = new TextView(con);
            jobFieldLabelSpacing        = new TextView(con);
            jobFieldAutoCompleteSpacing = new TextView(con);
            experienceLabelSpacing      = new TextView(con);
            experienceSpinnerSpacing    = new TextView(con);
            searchButtonSpacing         = new TextView(con);


            countryLabelSpacing.SetHeight(10);
            countryAutoCompleteSpacing.SetHeight(30);
            jobFieldLabelSpacing.SetHeight(10);
            jobFieldAutoCompleteSpacing.SetHeight(30);
            experienceLabelSpacing.SetHeight(10);
            experienceSpinnerSpacing.SetHeight(30);
            searchButtonSpacing.SetHeight(30);
            jobSearchLabel.Text      = "Job Search";
            jobSearchLabel.TextSize  = 30;
            jobSearchLabel.Typeface  = Typeface.DefaultBold;
            countryLabel.Text        = "Country";
            countryLabel.TextSize    = 16;
            jobFieldLabel.Text       = "Job Field";
            jobFieldLabel.TextSize   = 16;
            experienceLabel.Text     = "Experience";
            experienceLabel.TextSize = 16;
            jobSearchLabelSpacing.SetHeight(40);
        }
        public View GetSampleContent(Android.Content.Context con)
        {
            SamplePageContents(con);

            //countryNameAutoComplete
            countryNameAutoComplete = new SfAutoComplete(con);
            ArrayAdapter <String> countryAdapter = new ArrayAdapter <String>(con,
                                                                             Android.Resource.Layout.SimpleListItem1, new Countrylist().Country);

            countryNameAutoComplete.LayoutParameters      = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 50);
            countryNameAutoComplete.AutoCompleteSource    = (countryAdapter);
            countryNameAutoComplete.SuggestionMode        = SuggestionMode.StartsWith;
            countryNameAutoComplete.MaximumDropDownHeight = 150;
            countryNameAutoComplete.Watermark             = "Enter a country name";
            countryNameAutoComplete.GetAutoEditText().SetTextSize(ComplexUnitType.Sp, 20);
            countryNameAutoComplete.TextHighlightMode    = OccurrenceMode.FirstOccurrence;
            countryNameAutoComplete.HighlightedTextColor = Color.Blue;

            //jobFieldAutoComplete
            jobFieldAutoComplete = new SfAutoComplete(con);
            ArrayAdapter <String> titleAdapter = new ArrayAdapter <String>(con,
                                                                           Android.Resource.Layout.SimpleListItem1, Title);

            jobFieldAutoComplete.AutoCompleteSource    = (titleAdapter);
            jobFieldAutoComplete.LayoutParameters      = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 50);
            jobFieldAutoComplete.SuggestionMode        = SuggestionMode.Contains;
            jobFieldAutoComplete.MaximumDropDownHeight = 150;
            jobFieldAutoComplete.Watermark             = "Starts with ’S’, ‘M’ or ‘B’";
            jobFieldAutoComplete.GetAutoEditText().SetTextSize(ComplexUnitType.Sp, 20);
            jobFieldAutoComplete.TextHighlightMode    = OccurrenceMode.FirstOccurrence;
            jobFieldAutoComplete.HighlightedTextColor = Color.Blue;

            //main view
            LinearLayout mainView = GetView(con);

            return(mainView);
        }
Пример #19
0
        public MultiSelection()
        {
            //ToAutoComplete
            toAutoComplete = new SfAutoComplete();
            toAutoComplete.MultiSelectMode   = MultiSelectMode.Token;
            toAutoComplete.TokensWrapMode    = TokensWrapMode.Wrap;
            toAutoComplete.DataSource        = new ContactsInfoCollection().GetContactDetails();
            toAutoComplete.DisplayMemberPath = (NSString)"ContactName";
            toAutoComplete.ImageMemberPath   = "ContactImage";
            this.AddSubview(toAutoComplete);

            //CCAutoComplete
            ccAutoComplete = new SfAutoComplete();
            ccAutoComplete.MultiSelectMode   = MultiSelectMode.Token;
            ccAutoComplete.TokensWrapMode    = TokensWrapMode.Wrap;
            ccAutoComplete.DataSource        = new ContactsInfoCollection().GetContactDetails();
            ccAutoComplete.DisplayMemberPath = (NSString)"ContactName";
            ccAutoComplete.ImageMemberPath   = "ContactImage";
            this.AddSubview(ccAutoComplete);

            //BCCAutoComplete
            bccAutoComplete = new SfAutoComplete();
            bccAutoComplete.MultiSelectMode   = MultiSelectMode.Token;
            bccAutoComplete.TokensWrapMode    = TokensWrapMode.Wrap;
            bccAutoComplete.DataSource        = new ContactsInfoCollection().GetContactDetails();
            bccAutoComplete.DisplayMemberPath = (NSString)"ContactName";
            bccAutoComplete.ImageMemberPath   = "ContactImage";
            this.AddSubview(bccAutoComplete);

            //MessageBox
            messageBox      = new UITextField();
            messageBox.Text = "Send from my smart phone";
            this.AddSubview(messageBox);

            mainPageDesign();
        }
Пример #20
0
        public ToleratingTypos()
        {
            headerlabel               = new UILabel();
            headerlabel.Text          = "Search by Countries";
            headerlabel.TextColor     = UIColor.Black;
            headerlabel.TextAlignment = UITextAlignment.Left;
            this.AddSubview(headerlabel);

            countryAutoComplete                    = new SfAutoComplete();
            countryAutoComplete.Watermark          = (NSString)"Search Here";
            countryAutoComplete.MaxDropDownHeight  = 100;
            countryAutoComplete.FilterItemChanged += CountryAutoComplete_FilterItemChanged;
            this.AddSubview(countryAutoComplete);
            List <string> items = new List <string>();

            items.Add("Afghanistan");
            items.Add("Akrotiri");
            items.Add("Albania");
            items.Add("Algeria");
            items.Add("American Samoa");
            items.Add("Andorra");
            items.Add("Angola");
            items.Add("Anguilla");
            items.Add("Antarctica");
            items.Add("Antigua and Barbuda");
            items.Add("Argentina");
            items.Add("Armenia");
            items.Add("Aruba");
            items.Add("Ashmore and Cartier Islands");
            items.Add("Australia");
            items.Add("Austria");
            items.Add("Azerbaijan");
            items.Add("Bahamas, The");
            items.Add("Bahrain");
            items.Add("Bangladesh");
            items.Add("Barbados");
            items.Add("Bassas da India");
            items.Add("Belarus");
            items.Add("Bolivia");
            items.Add("Bosnia and Herzegovina");
            items.Add("Botswana");
            items.Add("Bouvet Island");
            items.Add("Brazil");
            items.Add("British Indian Ocean Territory");
            items.Add("British Virgin Islands");
            items.Add("Brunei");
            items.Add("Bulgaria");
            items.Add("Burkina Faso");
            items.Add("Burma");
            items.Add("Burundi");
            items.Add("Cambodia");
            items.Add("Cameroon");
            items.Add("Canada");
            items.Add("Cape Verde");
            items.Add("Cayman Islands");
            items.Add("Central African Republic");
            items.Add("Chad");
            items.Add("Chile");
            items.Add("China");
            items.Add("Christmas Island");
            items.Add("Clipperton Island");
            items.Add("Cocos (Keeling) Islands");
            items.Add("Colombia");
            items.Add("Comoros");
            items.Add("Congo");
            items.Add("Congo, Republic of the");
            items.Add("Cook Islands");
            items.Add("Coral Sea Islands");
            items.Add("Costa Rica");
            items.Add("Cote d'Ivoire");
            items.Add("Croatia");
            items.Add("Cuba");
            items.Add("Cyprus");
            items.Add("Czech Republic");
            items.Add("Denmark");
            items.Add("Dhekelia");
            items.Add("Djibouti");
            items.Add("Dominica");
            items.Add("Dominican Republic");
            items.Add("Ecuador");
            items.Add("Egypt");
            items.Add("El Salvador");
            items.Add("Equatorial Guinea");
            items.Add("Eritrea");
            items.Add("Estonia");
            items.Add("Ethiopia");
            items.Add("Europa Island");
            items.Add("Falkland Islands");
            items.Add("Faroe Islands");
            items.Add("Fiji");
            items.Add("Finland");
            items.Add("France");
            items.Add("French Guiana");
            items.Add("French Polynesia");
            items.Add("French Southern and Antarctic Lands");
            items.Add("Gabon");
            items.Add("Gambia, The");
            items.Add("Gaza Strip");
            items.Add("Georgia");
            items.Add("Germany");
            items.Add("Ghana");
            items.Add("Gibraltar");
            items.Add("Glorioso Islands");
            items.Add("Greece");
            items.Add("Greenland");
            items.Add("Grenada");
            items.Add("Guadeloupe");
            items.Add("Guam");
            items.Add("Guatemala");
            items.Add("Guernsey");
            items.Add("Guinea");
            items.Add("Guinea-Bissau");
            items.Add("Guyana");
            items.Add("Haiti");
            items.Add("Heard Island and McDonald Islands");
            items.Add("Holy See");
            items.Add("Honduras");
            items.Add("Hong Kong");
            items.Add("Hungary");
            items.Add("Iceland");
            items.Add("India");
            items.Add("Indonesia");
            items.Add("Iran");
            items.Add("Iraq");
            items.Add("Ireland");
            items.Add("Isle of Man");
            items.Add("Israel");
            items.Add("Italy");
            items.Add("Jamaica");
            items.Add("Jan Mayen");
            items.Add("Japan");
            items.Add("Jersey");
            items.Add("Jordan");
            items.Add("Juan de Nova Island");
            items.Add("Kazakhstan");
            items.Add("Kenya");
            items.Add("Kiribati");
            items.Add("Korea, North");
            items.Add("Korea, South");
            items.Add("Kuwait");
            items.Add("Kyrgyzstan");
            items.Add("Laos");
            items.Add("Latvia");
            items.Add("Lebanon");
            items.Add("Lesotho");
            items.Add("Liberia");
            items.Add("Libya");
            items.Add("Liechtenstein");
            items.Add("Lithuania");
            items.Add("Luxembourg");
            items.Add("Macau");
            items.Add("Macedonia");
            items.Add("Madagascar");
            items.Add("Malawi");
            items.Add("Malaysia");
            items.Add("Maldives");
            items.Add("Mali");
            items.Add("Malta");
            items.Add("Marshall Islands");
            items.Add("Martinique");
            items.Add("Mauritania");
            items.Add("Mauritius");
            items.Add("Mayotte");
            items.Add("Mexico");
            items.Add("Micronesia");
            items.Add("Moldova");
            items.Add("Monaco");
            items.Add("Mongolia");
            items.Add("Montserrat");
            items.Add("Morocco");
            items.Add("Mozambique");
            items.Add("Namibia");
            items.Add("Nauru");
            items.Add("Navassa Island");
            items.Add("Nepal");
            items.Add("Netherlands");
            items.Add("Netherlands Antilles");
            items.Add("New Caledonia");
            items.Add("New Zealand");
            items.Add("Nicaragua");
            items.Add("Niger");
            items.Add("Nigeria");
            items.Add("Niue");
            items.Add("Norfolk Island");
            items.Add("Northern Mariana Islands");
            items.Add("Norway");
            items.Add("Oman");
            items.Add("Pakistan");
            items.Add("Palau");
            items.Add("Panama");
            items.Add("Papua New Guinea");
            items.Add("Paracel Islands");
            items.Add("Paraguay");
            items.Add("Peru");
            items.Add("Philippines");
            items.Add("Pitcairn Islands");
            items.Add("Poland");
            items.Add("Portugal");
            items.Add("Puerto Rico");
            items.Add("Qatar");
            items.Add("Reunion");
            items.Add("Romania");
            items.Add("Russia");
            items.Add("Rwanda");
            items.Add("Saint Helena");
            items.Add("Saint Kitts and Nevis");
            items.Add("Saint Lucia");
            items.Add("Saint Pierre and Miquelon");
            items.Add("Saint Vincent");
            items.Add("Samoa");
            items.Add("San Marino");
            items.Add("Sao Tome and Principe");
            items.Add("Saudi Arabia");
            items.Add("Senegal");
            items.Add("Serbia and Montenegro");
            items.Add("Seychelles");
            items.Add("Sierra Leone");
            items.Add("Singapore");
            items.Add("Slovakia");
            items.Add("Slovenia");
            items.Add("Solomon Islands");
            items.Add("Somalia");
            items.Add("South Africa");
            items.Add("South Georgia");
            items.Add("Spain");
            items.Add("Spratly Islands");
            items.Add("Sri Lanka");
            items.Add("Sudan");
            items.Add("Suriname");
            items.Add("Svalbard");
            items.Add("Swaziland");
            items.Add("Sweden");
            items.Add("Switzerland");
            items.Add("Syria");
            items.Add("Taiwan");
            items.Add("Tajikistan");
            items.Add("Tanzania");
            items.Add("Thailand");
            items.Add("Timor-Leste");
            items.Add("Togo");
            items.Add("Tokelau");
            items.Add("Tonga");
            items.Add("Trinidad and Tobago");
            items.Add("Tromelin Island");
            items.Add("Tunisia");
            items.Add("Turkey");
            items.Add("Turkmenistan");
            items.Add("Turks and Caicos Islands");
            items.Add("Tuvalu");
            items.Add("Uganda");
            items.Add("Ukraine");
            items.Add("United Arab Emirates");
            items.Add("United Kingdom");
            items.Add("United States");
            items.Add("Uruguay");
            items.Add("Uzbekistan");
            items.Add("Vanuatu");
            items.Add("Venezuela");
            items.Add("Vietnam");
            items.Add("Virgin Islands");
            items.Add("Wake Island");
            items.Add("Wallis and Futuna");
            items.Add("West Bank");
            items.Add("Western Sahara");
            items.Add("Yemen");
            items.Add("Zambia");
            items.Add("Zimbabwe");


            countryAutoComplete.DataSource     = items;
            countryAutoComplete.SuggestionMode = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeCustom;
            searchresults               = new UILabel();
            searchresults.Text          = "Search Results";
            searchresults.TextColor     = UIColor.Gray;
            searchresults.TextAlignment = UITextAlignment.Left;
            this.AddSubview(searchresults);
            tableView           = new UITableView();
            tableView.RowHeight = 60;
            tableItems          = new string[] { "General", "Maps", "News", "Video", "Music", "Books", "Flight", "Quick Search" };
            imageItems          = new string[] { "all.png", "Maps1.png", "Newspaper.png", "Media.png", "Music.png", "Book.png", "Aeroplane.png", "Picture.png" };

            ToleratingTypoTableView tableViewSource = new ToleratingTypoTableView(tableItems, imageItems);

            tableView.Source = tableViewSource;
            this.AddSubview(tableView);
            countryAutoComplete.SelectionChanged += (object sender, SelectionEventArgs e) =>
            {
                if ((sender as SfAutoComplete).SelectedIndex != -1)
                {
                    tableViewSource.initial = true;
                    tableViewSource.random  = new Random().Next(10000, 99999);
                    tableView.ReloadData();
                }
                if ((sender as SfAutoComplete).SelectedIndex == -1)
                {
                    tableViewSource.initial = false;
                    tableViewSource.random  = 0;
                    tableView.ReloadData();
                }
            };

            countryAutoComplete.TextChanged += (object sender, TextEventArgs e) =>
            {
                tableViewSource.initial = false;
                tableViewSource.random  = 0;
                tableView.ReloadData();
            };
            helper = new ToleratingTyposHelper();
        }
Пример #21
0
        public AutoComplete()
        {
            label      = new Label();
            label.Text = "Type a country name to display the suggested list in the dropdown";
            label1     = new Label()
            {
                Text = "SuggestionMode", HeightRequest = 50, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label2 = new Label()
            {
                Text = "AutoCompleteMode", HeightRequest = 50, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label3 = new Label()
            {
                Text = "Max DropDown Height", HeightRequest = 40, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label4 = new Label()
            {
                Text = "Min Prefix Character", HeightRequest = 40, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label5 = new Label()
            {
                Text = "Popup Delay", HeightRequest = 40, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label1.FontAttributes = FontAttributes.None;
            label1.FontSize       = 20;
            label2.FontAttributes = FontAttributes.None;
            label2.FontSize       = 20;
            label3.FontAttributes = FontAttributes.None;
            label3.FontSize       = 20;
            label4.FontAttributes = FontAttributes.None;
            label4.FontSize       = 20;
            label5.FontAttributes = FontAttributes.None;
            label5.FontSize       = 20;
            text1               = new Entry();
            text2               = new Entry();
            text3               = new Entry();
            label1.YAlign       = TextAlignment.End;
            label2.YAlign       = TextAlignment.End;
            label3.YAlign       = TextAlignment.Center;
            label4.YAlign       = TextAlignment.Center;
            label5.YAlign       = TextAlignment.Center;
            text1.WidthRequest  = 80;
            text2.WidthRequest  = 80;
            text3.WidthRequest  = 80;
            text1.HeightRequest = 40;
            text2.HeightRequest = 40;
            text3.HeightRequest = 40;
            picker1             = new PickerExt();
            picker2             = new PickerExt();
            label3.WidthRequest = 300;
            label4.WidthRequest = 300;
            label5.WidthRequest = 300;
            picker1.Items.Add("StartsWith");
            picker1.Items.Add("StartsWithCaseSensitive");
            picker1.Items.Add("Contains");
            picker1.Items.Add("ContainsWithCaseSensitive");
            picker1.Items.Add("EndsWith");
            picker1.Items.Add("EndsWithCaseSensitive");
            picker1.Items.Add("Equals");
            picker1.Items.Add("EqualsWithCaseSensitive");

            picker2.Items.Add("Append");
            picker2.Items.Add("Suggest");
            picker2.Items.Add("SuggestAppend");
            picker1.SelectedIndex = 0;
            picker2.SelectedIndex = 1;
            text1.Text            = "300";
            text2.Text            = "2";
            text3.Text            = "100";
            text1.TextChanged    += (object sender, TextChangedEventArgs e) =>
            {
                if (e.NewTextValue.Length > 0)
                {
                    autocomplete1.MaximumDropDownHeight = int.Parse(e.NewTextValue);
                    autocomplete2.MaximumDropDownHeight = int.Parse(e.NewTextValue);
                }
                else
                {
                    autocomplete1.MaximumDropDownHeight = 100;
                    autocomplete2.MaximumDropDownHeight = 100;
                }
            };
            text2.TextChanged += (object sender, TextChangedEventArgs e) =>
            {
                if (e.NewTextValue.Length > 0)
                {
                    autocomplete1.MinimumPrefixCharacters = int.Parse(e.NewTextValue);
                    autocomplete2.MinimumPrefixCharacters = int.Parse(e.NewTextValue);
                }
                else
                {
                    autocomplete1.MinimumPrefixCharacters = 1;
                    autocomplete2.MinimumPrefixCharacters = 1;
                }
            };
            text3.TextChanged += (object sender, TextChangedEventArgs e) =>
            {
                if (e.NewTextValue.Length > 0)
                {
                    autocomplete1.PopupDelay = int.Parse(e.NewTextValue);
                    autocomplete2.PopupDelay = int.Parse(e.NewTextValue);
                }
                else
                {
                    autocomplete1.PopupDelay = 100;
                    autocomplete2.PopupDelay = 100;
                }
            };
            picker1.SelectedIndexChanged += (object sender, EventArgs e) => {
                switch (picker1.SelectedIndex)
                {
                case 0:
                {
                    autocomplete1.SuggestionMode = SuggestionMode.StartsWith;
                    autocomplete2.SuggestionMode = SuggestionMode.StartsWith;
                }
                break;

                case 1:
                {
                    autocomplete1.SuggestionMode = SuggestionMode.StartsWithCaseSensitive;
                    autocomplete2.SuggestionMode = SuggestionMode.StartsWithCaseSensitive;
                }
                break;

                case 2:
                {
                    autocomplete1.SuggestionMode = SuggestionMode.Contains;
                    autocomplete2.SuggestionMode = SuggestionMode.Contains;
                }
                break;

                case 3:
                {
                    autocomplete1.SuggestionMode = SuggestionMode.ContainsWithCaseSensitive;
                    autocomplete2.SuggestionMode = SuggestionMode.ContainsWithCaseSensitive;
                }
                break;

                case 4:
                {
                    autocomplete1.SuggestionMode = SuggestionMode.EndsWith;
                    autocomplete2.SuggestionMode = SuggestionMode.EndsWith;
                }
                break;

                case 5:
                {
                    autocomplete1.SuggestionMode = SuggestionMode.EndsWithCaseSensitive;
                    autocomplete2.SuggestionMode = SuggestionMode.EndsWithCaseSensitive;
                }
                break;

                case 6:
                {
                    autocomplete1.SuggestionMode = SuggestionMode.Equals;
                    autocomplete2.SuggestionMode = SuggestionMode.Equals;
                }
                break;

                case 7:
                {
                    autocomplete1.SuggestionMode = SuggestionMode.EqualsWithCaseSensitive;
                    autocomplete2.SuggestionMode = SuggestionMode.EqualsWithCaseSensitive;
                }
                break;
                }
            };
            picker2.SelectedIndexChanged += (object sender, EventArgs e) => {
                switch (picker2.SelectedIndex)
                {
                case 0:
                {
                    autocomplete1.AutoCompleteMode = AutoCompleteMode.Append;
                    autocomplete2.AutoCompleteMode = AutoCompleteMode.Append;
                }
                break;

                case 1:
                {
                    autocomplete1.AutoCompleteMode = AutoCompleteMode.Suggest;
                    autocomplete2.AutoCompleteMode = AutoCompleteMode.Suggest;
                }
                break;

                case 2:
                {
                    autocomplete1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                    autocomplete2.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                }
                break;
                }
            };
            s1 = string.Empty;
            s2 = string.Empty;
            pp = new PickerExt();
            title.Add("Software");
            title.Add("Banking");
            title.Add("Media");
            title.Add("Medical");

            exp.Add("1");
            exp.Add("2");
            label5s = new Label();
            label1s = new Label()
            {
                Text = "Job Search", HeightRequest = 40, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label2s = new Label()
            {
                Text = "Country", HeightRequest = 30, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label3s = new Label()
            {
                Text = "Job Field", HeightRequest = 30, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label4s = new Label()
            {
                Text = "Experience", HeightRequest = 30, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray
            };
            label1s.FontAttributes = FontAttributes.Bold;
            label1s.FontSize       = 24;
            label2s.FontAttributes = FontAttributes.None;
            label2s.FontSize       = 18;
            label3s.FontAttributes = FontAttributes.None;
            label3s.FontSize       = 18;
            label4s.FontAttributes = FontAttributes.None;
            label4s.FontSize       = 18;
            label5s.HeightRequest  = 10;
            label1s.TextColor      = Color.Black;
            label2s.TextColor      = Color.Black;
            label3s.TextColor      = Color.Black;
            label4s.TextColor      = Color.Black;
            label5s.TextColor      = Color.Black;
            buttons          = new Button();
            buttons.Text     = "Search";
            buttons.Clicked += (object sender, EventArgs e) => {
                if (s1 != "" && s2 != "")
                {
                    Random r = new Random();
                    DisplayAlert("Results", r.Next(9, 50) + " Jobs found", "OK");
                }
                else
                {
                    DisplayAlert("Results", "0 Jobs found", "OK");
                }
            };

            autocomplete1 = new SfAutoComplete();
            autocomplete1.SuggestionMode        = SuggestionMode.StartsWith;
            autocomplete1.AutoCompleteMode      = AutoCompleteMode.Suggest;
            autocomplete1.MaximumDropDownHeight = 300;
            autocomplete1.AutoCompleteSource    = new Countrylist().Country;
            autocomplete1.HeightRequest         = 40;
            autocomplete1.Watermark             = "Enter a country name";
            autocomplete1.ValueChanged         += (object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e) =>
            {
                s1 = e.Value;
            };
            autocomplete2 = new SfAutoComplete();
            autocomplete2.SuggestionMode        = SuggestionMode.StartsWith;
            autocomplete2.AutoCompleteMode      = AutoCompleteMode.Suggest;
            autocomplete2.MaximumDropDownHeight = 300;
            autocomplete2.AutoCompleteSource    = title;
            autocomplete2.HeightRequest         = 40;
            autocomplete2.Watermark             = "Enter 'B' , 'S' , 'M' to start";
            autocomplete2.ValueChanged         += (object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e) =>
            {
                s2 = e.Value;
            };
            pp.Items.Add("1");
            pp.Items.Add("2");
            pp.SelectedIndex   = 0;
            pp.BackgroundColor = Color.White;



            //this.BackgroundColor = Color.FromRgb(236, 235, 242);
            if (Device.OS == TargetPlatform.WinPhone)
            {
                autocomplete1.HeightRequest   = 80;
                autocomplete2.HeightRequest   = 80;
                this.BackgroundColor          = Color.Black;
                label1s.TextColor             = Color.White;
                label2s.TextColor             = Color.White;
                label3s.TextColor             = Color.White;
                label4s.TextColor             = Color.White;
                label5s.TextColor             = Color.White;
                autocomplete2.BackgroundColor = Color.White;
                autocomplete1.BackgroundColor = Color.White;
                pp.BackgroundColor            = Color.Black;
                text2.WidthRequest            = 120;
                text3.WidthRequest            = 120;
                text2.HeightRequest           = 80;
                text3.HeightRequest           = 80;
            }
            if (Device.OS == TargetPlatform.Windows)
            {
                this.BackgroundColor          = Color.Black;
                label1s.TextColor             = Color.Black;
                label2s.TextColor             = Color.Black;
                label3s.TextColor             = Color.Black;
                label4s.TextColor             = Color.Black;
                label5s.TextColor             = Color.Black;
                autocomplete2.BackgroundColor = Color.White;
                autocomplete1.BackgroundColor = Color.White;
                //pp.BackgroundColor = Color.Gray;
                text2.WidthRequest = 120;
                text3.WidthRequest = 120;
                if (Device.Idiom != TargetIdiom.Tablet)
                {
                    this.BackgroundColor = Color.Black;
                    label1s.TextColor    = Color.White;
                    label2s.TextColor    = Color.White;
                    label3s.TextColor    = Color.White;
                    label4s.TextColor    = Color.White;
                    label5s.TextColor    = Color.White;
                    pp.BackgroundColor   = Color.Black;
                }
            }


            this.ContentView = GetAutoComplete();
            PropertyView     = GetOptionPage();
        }
Пример #22
0
 public Task <object> GetMatchingItemsAsync(SfAutoComplete source, AutoCompleteFilterInfo filterInfo)
 {
     return(GetGoogleSuggestions(filterInfo.Text));
 }
Пример #23
0
        public override View GetSampleContent(Android.Content.Context con)
        {
            dlgAlert = new AlertDialog.Builder(con);

            dlgAlert.SetTitle("Results");
            dlgAlert.SetPositiveButton("OK", (object sender, DialogClickEventArgs e) =>
            {
            });
            dlgAlert.SetCancelable(true);

            Title.Add("Software");
            Title.Add("Banking");
            Title.Add("Media");
            Title.Add("Medical");
            spinners = new Spinner(con);
            spinners.DropDownWidth = 500;
            spinners.SetBackgroundColor(Color.Gray);

            ArrayAdapter <String> dataAdapter = new ArrayAdapter <String>
                                                    (con, Android.Resource.Layout.SimpleSpinnerItem, Experience);

            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinners.Adapter = dataAdapter;

            Country.Add("UAE");
            Country.Add("Uruguay");
            Country.Add("United States");
            Country.Add("United Kingdom");
            Country.Add("Ukraine");

            Experience.Add("1");
            Experience.Add("2");

            autoComplete1 = new SfAutoComplete(con);
            autoComplete2 = new SfAutoComplete(con);

            text1s = new TextView(con);
            text2s = new TextView(con);
            text3s = new TextView(con);
            text4s = new TextView(con);
            text6s = new TextView(con);

            text11 = new TextView(con);
            text22 = new TextView(con);
            text33 = new TextView(con);
            text44 = new TextView(con);
            text55 = new TextView(con);
            text66 = new TextView(con);
            text77 = new TextView(con);
            text88 = new TextView(con);

            buttons = new Button(con);
            buttons.SetWidth(ActionBar.LayoutParams.MatchParent);
            buttons.SetHeight(40);
            buttons.Text = "Search";
            buttons.SetTextColor(Color.White);
            buttons.SetBackgroundColor(Color.Gray);
            buttons.Click += (object sender, EventArgs e) => {
                GetResult();
                //dlgAlert.SetMessage(count + " Jobs Found");
                dlgAlert.SetMessage(cc + " Jobs Found");
                dlgAlert.Create().Show();
            };
            text11.SetHeight(10);
            text22.SetHeight(30);
            text33.SetHeight(10);
            text44.SetHeight(30);
            text55.SetHeight(10);
            text66.SetHeight(30);
            text77.SetHeight(10);
            text88.SetHeight(30);

            text1s.Text     = "Job Search";
            text1s.TextSize = 30;
            text1s.Typeface = Typeface.DefaultBold;
            text2s.Text     = "Country";
            text2s.TextSize = 16;
            text3s.Text     = "Job Field";
            text3s.TextSize = 16;
            text4s.Text     = "Experience";
            text4s.TextSize = 16;
            text6s.SetHeight(40);

            ArrayAdapter <String> adapters = new ArrayAdapter <String>(con,
                                                                       Android.Resource.Layout.SimpleListItem1, new Countrylist().Country);

            autoComplete1.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60);
            autoComplete1.SetAutoCompleteSource(adapters);
            autoComplete1.SuggestionMode        = SuggestionMode.StartsWith;
            autoComplete1.MaximumDropDownHeight = 200;
            autoComplete1.Watermark             = "Enter a country name";

            ArrayAdapter <String> adapters1 = new ArrayAdapter <String>(con,
                                                                        Android.Resource.Layout.SimpleListItem1, Title);

            autoComplete2.SetAutoCompleteSource(adapters1);
            autoComplete2.LayoutParameters      = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60);
            autoComplete2.SuggestionMode        = SuggestionMode.Contains;
            autoComplete2.MaximumDropDownHeight = 200;
            autoComplete2.Watermark             = "Starts with ’S’, ‘M’ or ‘B’";

            ArrayAdapter <String> adapters2 = new ArrayAdapter <String>(con,
                                                                        Android.Resource.Layout.SimpleListItem1, Experience);

            spinners.Adapter          = adapters2;
            spinners.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60);

            LinearLayout linearLayout = new LinearLayout(con);

            linearLayout.SetPadding(20, 20, 20, 30);
            linearLayout.SetBackgroundColor(Color.Rgb(236, 236, 236));
            linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            linearLayout.Orientation      = Orientation.Vertical;
            linearLayout.AddView(text1s);
            linearLayout.AddView(text6s);
            linearLayout.AddView(text2s);
            linearLayout.AddView(text11);
            linearLayout.AddView(autoComplete1);
            linearLayout.AddView(text22);
            linearLayout.AddView(text3s);
            linearLayout.AddView(text33);
            linearLayout.AddView(autoComplete2);
            linearLayout.AddView(text44);
            linearLayout.AddView(text4s);
            linearLayout.AddView(text55);
            linearLayout.AddView(spinners);
            linearLayout.AddView(text66);
            linearLayout.AddView(text88);
            linearLayout.AddView(buttons);
            linearLayout.Touch += (object sender, View.TouchEventArgs e) => {
                //if(autoComplete1.IsFocused || autoComplete2.IsFocused ){
                Rect outRect = new Rect();
                autoComplete1.GetGlobalVisibleRect(outRect);
                autoComplete2.GetGlobalVisibleRect(outRect);

                if (!outRect.Contains((int)e.Event.RawX, (int)e.Event.RawY))
                {
                    autoComplete1.ClearFocus();
                    autoComplete2.ClearFocus();
                }
                hideSoftKeyboard((Activity)con);
                //}
            };
            return(linearLayout);
        }
Пример #24
0
		public AutoComplete ()
		{
			label = new Label ();
			label.Text = "Type a country name to display the suggested list in the dropdown";
			label1 = new Label() { Text = "SuggestionMode", HeightRequest = 50, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label2 = new Label() { Text = "AutoCompleteMode", HeightRequest = 50, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label3 = new Label() { Text = "Max DropDown Height", HeightRequest = 40, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label4 = new Label() { Text = "Min Prefix Character", HeightRequest = 40, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label5 = new Label() { Text = "Popup Delay", HeightRequest = 40, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label1.FontAttributes = FontAttributes.None;
			label1.FontSize = 20;
			label2.FontAttributes = FontAttributes.None;
			label2.FontSize = 20;
			label3.FontAttributes = FontAttributes.None;
			label3.FontSize = 20;
			label4.FontAttributes = FontAttributes.None;
			label4.FontSize = 20;
			label5.FontAttributes = FontAttributes.None;
			label5.FontSize = 20;
			text1 = new Entry ();
			text2 = new Entry ();
			text3 = new Entry ();
			label1.YAlign = TextAlignment.End;
			label2.YAlign = TextAlignment.End;
			label3.YAlign = TextAlignment.Center;
			label4.YAlign = TextAlignment.Center;
			label5.YAlign = TextAlignment.Center;
			text1.WidthRequest = 80;
			text2.WidthRequest = 80;
			text3.WidthRequest = 80;
			text1.HeightRequest = 40;
			text2.HeightRequest = 40;
			text3.HeightRequest = 40;
			picker1 = new PickerExt ();
			picker2 = new PickerExt ();
			label3.WidthRequest = 300;
			label4.WidthRequest = 300;
			label5.WidthRequest = 300;
			picker1.Items.Add ("StartsWith");
			picker1.Items.Add ("StartsWithCaseSensitive");
			picker1.Items.Add ("Contains");
			picker1.Items.Add ("ContainsWithCaseSensitive");
			picker1.Items.Add ("EndsWith");
			picker1.Items.Add ("EndsWithCaseSensitive");
			picker1.Items.Add ("Equals");
			picker1.Items.Add ("EqualsWithCaseSensitive");

			picker2.Items.Add ("Append");
			picker2.Items.Add ("Suggest");
			picker2.Items.Add ("SuggestAppend");
			picker1.SelectedIndex = 0;
			picker2.SelectedIndex = 1;
			text1.Text = "300";
			text2.Text = "2";
			text3.Text = "100";
			text1.TextChanged+= (object sender, TextChangedEventArgs e) => 
			{
				if(e.NewTextValue.Length >0){
					autocomplete1.MaximumDropDownHeight = int.Parse(e.NewTextValue);
					autocomplete2.MaximumDropDownHeight = int.Parse(e.NewTextValue);
				}
				else{
					autocomplete1.MaximumDropDownHeight = 100;
					autocomplete2.MaximumDropDownHeight = 100;
				}
			};
			text2.TextChanged+= (object sender, TextChangedEventArgs e) => 
			{
				if(e.NewTextValue.Length > 0){
                    autocomplete1.MinimumPrefixCharacters = int.Parse(e.NewTextValue);
                    autocomplete2.MinimumPrefixCharacters = int.Parse(e.NewTextValue);
				}
				else{
					autocomplete1.MinimumPrefixCharacters = 1;
					autocomplete2.MinimumPrefixCharacters = 1;
				}
			};
			text3.TextChanged+= (object sender, TextChangedEventArgs e) => 
			{
				if(e.NewTextValue.Length > 0){
					autocomplete1.PopupDelay = int.Parse(e.NewTextValue);
					autocomplete2.PopupDelay = int.Parse(e.NewTextValue);
				}
				else{
					autocomplete1.PopupDelay = 100;
					autocomplete2.PopupDelay = 100;
				}
			};
			picker1.SelectedIndexChanged += (object sender, EventArgs e) => {
				switch (picker1.SelectedIndex) {
				case 0:
					{
						autocomplete1.SuggestionMode = SuggestionMode.StartsWith;
						autocomplete2.SuggestionMode = SuggestionMode.StartsWith;
					}
					break;
				case 1:
					{
						autocomplete1.SuggestionMode = SuggestionMode.StartsWithCaseSensitive;
						autocomplete2.SuggestionMode = SuggestionMode.StartsWithCaseSensitive;
					}
					break;
				case 2:
					{
						autocomplete1.SuggestionMode = SuggestionMode.Contains;
						autocomplete2.SuggestionMode = SuggestionMode.Contains;
					}
					break;
				case 3:
					{
						autocomplete1.SuggestionMode = SuggestionMode.ContainsWithCaseSensitive;
						autocomplete2.SuggestionMode = SuggestionMode.ContainsWithCaseSensitive;
					}
					break;
				case 4:
					{
						autocomplete1.SuggestionMode = SuggestionMode.EndsWith;
						autocomplete2.SuggestionMode = SuggestionMode.EndsWith;
					}
					break;
				case 5:
					{
						autocomplete1.SuggestionMode = SuggestionMode.EndsWithCaseSensitive;
						autocomplete2.SuggestionMode = SuggestionMode.EndsWithCaseSensitive;
					}
					break;
				case 6:
					{
						autocomplete1.SuggestionMode = SuggestionMode.Equals;
						autocomplete2.SuggestionMode = SuggestionMode.Equals;
					}
					break;
				case 7:
					{
						autocomplete1.SuggestionMode = SuggestionMode.EqualsWithCaseSensitive;
						autocomplete2.SuggestionMode = SuggestionMode.EqualsWithCaseSensitive;
					}
					break;
				}
			};
			picker2.SelectedIndexChanged += (object sender, EventArgs e) => {
				switch (picker2.SelectedIndex) {
				case 0:
					{
						autocomplete1.AutoCompleteMode = AutoCompleteMode.Append;
						autocomplete2.AutoCompleteMode = AutoCompleteMode.Append;
					}
					break;
				case 1:
					{
						autocomplete1.AutoCompleteMode = AutoCompleteMode.Suggest;
						autocomplete2.AutoCompleteMode = AutoCompleteMode.Suggest;
					}
					break;
				case 2:
					{
						autocomplete1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
						autocomplete2.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
					}
					break;
				}
			};
			s1 = string.Empty;
			s2 = string.Empty;
			pp = new PickerExt ();
			title.Add ("Software");
			title.Add ("Banking");
			title.Add ("Media");
			title.Add ("Medical");

			exp.Add ("1");
			exp.Add ("2");
			label5s = new Label ();
			label1s = new Label() { Text = "Job Search", HeightRequest = 40,VerticalOptions=LayoutOptions.Center, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label2s = new Label() { Text = "Country", HeightRequest = 30, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label3s = new Label() { Text = "Job Field", HeightRequest = 30, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label4s = new Label() { Text = "Experience", HeightRequest = 30, HorizontalOptions=LayoutOptions.Start, TextColor = Color.Gray };
			label1s.FontAttributes = FontAttributes.Bold;
			label1s.FontSize = 24;
			label2s.FontAttributes = FontAttributes.None;
			label2s.FontSize = 18;
			label3s.FontAttributes = FontAttributes.None;
			label3s.FontSize = 18;
			label4s.FontAttributes = FontAttributes.None;
			label4s.FontSize = 18;
			label5s.HeightRequest = 10;
			label1s.TextColor = Color.Black;
			label2s.TextColor = Color.Black;
			label3s.TextColor = Color.Black;
			label4s.TextColor = Color.Black;
			label5s.TextColor = Color.Black;
			buttons = new Button ();
			buttons.Text = "Search";
			buttons.Clicked += (object sender, EventArgs e) => {
				if (s1 != "" && s2 != "") {
					Random r = new Random ();
					DisplayAlert ("Results", r.Next (9, 50) + " Jobs found", "OK");
				} else
					DisplayAlert ("Results", "0 Jobs found", "OK");
			};

			autocomplete1 = new SfAutoComplete ();
            autocomplete1.SuggestionMode = SuggestionMode.StartsWith;
            autocomplete1.AutoCompleteMode = AutoCompleteMode.Suggest;
            autocomplete1.MaximumDropDownHeight = 300;
            autocomplete1.AutoCompleteSource = new Countrylist().Country;
			autocomplete1.HeightRequest = 40;
            autocomplete1.Watermark = "Enter a country name";
            autocomplete1.ValueChanged += (object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e) =>
            {
                s1 = e.Value;
            };
			autocomplete2 = new SfAutoComplete ();
			autocomplete2.SuggestionMode = SuggestionMode.StartsWith;
			autocomplete2.AutoCompleteMode = AutoCompleteMode.Suggest;
			autocomplete2.MaximumDropDownHeight = 300;
            autocomplete2.AutoCompleteSource = title;
			autocomplete2.HeightRequest = 40;
            autocomplete2.Watermark = "Enter 'B' , 'S' , 'M' to start";
            autocomplete2.ValueChanged += (object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e) =>
            {
                s2 = e.Value;
            };
			pp.Items.Add ("1");
			pp.Items.Add ("2");
			pp.SelectedIndex = 0;
			pp.BackgroundColor = Color.White;
			

			
			//this.BackgroundColor = Color.FromRgb(236, 235, 242);
			if (Device.OS == TargetPlatform.WinPhone)
			{
                autocomplete1.HeightRequest = 80;
                autocomplete2.HeightRequest = 80;
				this.BackgroundColor = Color.Black;
				label1s.TextColor = Color.White;
				label2s.TextColor = Color.White;
				label3s.TextColor = Color.White;
				label4s.TextColor = Color.White;
				label5s.TextColor = Color.White;
                autocomplete2.BackgroundColor = Color.White;
                autocomplete1.BackgroundColor = Color.White;
				pp.BackgroundColor = Color.Black;
                text2.WidthRequest = 120;
                text3.WidthRequest = 120;
                text2.HeightRequest = 80;
                text3.HeightRequest = 80;
			}
            if ( Device.OS == TargetPlatform.Windows)
            {
                
                this.BackgroundColor = Color.Black;
                label1s.TextColor = Color.Black;
                label2s.TextColor = Color.Black;
                label3s.TextColor = Color.Black;
                label4s.TextColor = Color.Black;
                label5s.TextColor = Color.Black;
                autocomplete2.BackgroundColor = Color.White;
                autocomplete1.BackgroundColor = Color.White;
                //pp.BackgroundColor = Color.Gray;
                text2.WidthRequest = 120;
                text3.WidthRequest = 120;
                if (Device.Idiom != TargetIdiom.Tablet)
                {
                    this.BackgroundColor = Color.Black;
                    label1s.TextColor = Color.White;
                    label2s.TextColor = Color.White;
                    label3s.TextColor = Color.White;
                    label4s.TextColor = Color.White;
                    label5s.TextColor = Color.White;
                    pp.BackgroundColor = Color.Black;
                }

            }

           
            this.ContentView = GetAutoComplete();
			PropertyView = GetOptionPage ();
		}
Пример #25
0
		public override View GetSampleContent (Android.Content.Context con)
		{
			
			dlgAlert = new AlertDialog.Builder(con);

			dlgAlert.SetTitle("Results");
			dlgAlert.SetPositiveButton("OK", (object sender, DialogClickEventArgs e) => 
				{
				});
			dlgAlert.SetCancelable(true);

			Title.Add ("Software");
			Title.Add ("Banking");
			Title.Add ("Media");
			Title.Add ("Medical");
			spinners = new Spinner(con);
			spinners.DropDownWidth = 500;
			spinners.SetBackgroundColor(Color.Gray);

			ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>
				(con, Android.Resource.Layout.SimpleSpinnerItem, Experience);
			dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
			spinners.Adapter = dataAdapter;

			Country.Add ("UAE");
			Country.Add ("Uruguay");
			Country.Add ("United States");
			Country.Add ("United Kingdom");
			Country.Add ("Ukraine");

			Experience.Add ("1");
			Experience.Add ("2");

			autoComplete1 = new SfAutoComplete(con);
			autoComplete2 = new SfAutoComplete(con);

			text1s = new TextView(con);
			text2s = new TextView(con);
			text3s = new TextView(con);
			text4s = new TextView(con);
			text6s = new TextView(con);

			text11 = new TextView(con);
			text22 = new TextView(con);
			text33 = new TextView(con);
			text44 = new TextView(con);
			text55 = new TextView(con);
			text66 = new TextView(con);
			text77 = new TextView(con);
			text88 = new TextView(con);

			buttons = new Button(con);
			buttons.SetWidth(ActionBar.LayoutParams.MatchParent);
			buttons.SetHeight(40);
			buttons.Text = "Search";
			buttons.SetTextColor(Color.White);
			buttons.SetBackgroundColor(Color.Gray);
			buttons.Click += (object sender, EventArgs e) => {
				GetResult();
				//dlgAlert.SetMessage(count + " Jobs Found");
				dlgAlert.SetMessage (cc + " Jobs Found");
				dlgAlert.Create ().Show ();
			};
			text11.SetHeight(10);
			text22.SetHeight(30);
			text33.SetHeight(10);
			text44.SetHeight(30);
			text55.SetHeight(10);
			text66.SetHeight(30);
			text77.SetHeight(10);
			text88.SetHeight(30);

			text1s.Text = "Job Search";
			text1s.TextSize = 30;
			text1s.Typeface = Typeface.DefaultBold;
			text2s.Text = "Country";
			text2s.TextSize = 16;
			text3s.Text = "Job Field";
			text3s.TextSize = 16;
			text4s.Text = "Experience";
			text4s.TextSize = 16;
			text6s.SetHeight(40);

			ArrayAdapter<String> adapters = new ArrayAdapter<String>(con,
				Android.Resource.Layout.SimpleListItem1, new Countrylist().Country);
			autoComplete1.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60);
			autoComplete1.SetAutoCompleteSource(adapters);
			autoComplete1.SuggestionMode = SuggestionMode.StartsWith;
			autoComplete1.MaximumDropDownHeight = 200;
			autoComplete1.Watermark = "Enter a country name";

			ArrayAdapter<String> adapters1 = new ArrayAdapter<String>(con,
				Android.Resource.Layout.SimpleListItem1, Title);
			autoComplete2.SetAutoCompleteSource(adapters1);
			autoComplete2.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60);
			autoComplete2.SuggestionMode = SuggestionMode.Contains;
			autoComplete2.MaximumDropDownHeight = 200;
			autoComplete2.Watermark = "Starts with ’S’, ‘M’ or ‘B’";

			ArrayAdapter<String> adapters2 = new ArrayAdapter<String>(con,
				Android.Resource.Layout.SimpleListItem1, Experience);
			spinners.Adapter = adapters2;
			spinners.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60);

			LinearLayout linearLayout = new LinearLayout(con);
			linearLayout.SetPadding(20, 20, 20, 30);
			linearLayout.SetBackgroundColor(Color.Rgb(236, 236, 236));
			linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
			linearLayout.Orientation = Orientation.Vertical;
			linearLayout.AddView(text1s);
			linearLayout.AddView(text6s);
			linearLayout.AddView(text2s);
			linearLayout.AddView(text11);
			linearLayout.AddView(autoComplete1);
			linearLayout.AddView(text22);
			linearLayout.AddView(text3s);
			linearLayout.AddView(text33);
			linearLayout.AddView(autoComplete2);
			linearLayout.AddView(text44);
			linearLayout.AddView(text4s);
			linearLayout.AddView(text55);
			linearLayout.AddView(spinners);
			linearLayout.AddView(text66);
			linearLayout.AddView(text88);
			linearLayout.AddView(buttons);
			linearLayout.Touch+= (object sender, View.TouchEventArgs e) => {
				//if(autoComplete1.IsFocused || autoComplete2.IsFocused ){
					Rect outRect = new Rect();
					autoComplete1.GetGlobalVisibleRect(outRect);
					autoComplete2.GetGlobalVisibleRect(outRect);

					if (!outRect.Contains((int)e.Event.RawX, (int)e.Event.RawY)) {
						autoComplete1.ClearFocus();
						autoComplete2.ClearFocus();

					}
					hideSoftKeyboard((Activity)con);
				//}
			};
			return linearLayout;
		}
Пример #26
0
        public HomePage(SQLiteHandler sq)
        {
            this.Title = "Add a Mushroom";

            List <Mushroom> ms    = sq.GetMushroomTable();
            List <string>   names = new List <string>();

            foreach (Mushroom m in ms)
            {
                if (m.FieldGuide)
                {
                    names.Add(m.CommonName);
                    names.Add(m.LatinName);
                }
            }

            SfAutoComplete mushroomEntry = new SfAutoComplete();

            mushroomEntry.AutoCompleteSource      = names;
            mushroomEntry.SuggestionMode          = SuggestionMode.Contains;
            mushroomEntry.DropDownCornerRadius    = 5;
            mushroomEntry.DropDownBackgroundColor = Color.AntiqueWhite;
            mushroomEntry.Watermark = "Search Here";

            Label questionLabel = new Label
            {
                Text     = "Do you already know what your mushroom is? If so, type the name into the search bar below..",
                FontSize = 20
            };

            Button submitButton = new Button
            {
                Text      = "Submit",
                TextColor = Color.Red,
            };

            submitButton.Clicked += async(sender, args) =>
            {
                string query = mushroomEntry.Text.ToLower();
                if (validateInput(query))
                {
                    List <Mushroom> match = sq.GetMushroom(query);
                    if (match.Count == 1)
                    {
                        mushroomEntry.Text = "";
                        await Navigation.PushAsync(new SearchDetailPage(sq, match[0]));
                    }
                    else
                    {
                        await DisplayAlert("", "Mushroom Hunter does not have a mushroom matching this name.", "OK");
                    }
                }
            };
            Label instr2 = new Label
            {
                Text     = "Not sure what kind of mushroom you have? Select \"Identify\" to find out. ",
                FontSize = 20
            };
            Button button1 = new Button
            {
                Text      = "Identify",
                TextColor = Color.Red,
            };

            button1.Clicked += async(sender, e) =>
            {
                await Navigation.PushAsync(new IdentifyPage(sq));
            };
            Button button2 = new Button
            {
                Text = "Go to Field Guide page"
            };

            button2.Clicked += async(sender, e) =>
            {
                await Navigation.PushAsync(new FieldGuidePage(sq));
            };
            StackLayout sl1 = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Padding         = new Thickness(10, 5, 10, 5),
                Children        =
                {
                    questionLabel,
                    mushroomEntry,
                    submitButton
                }
            };

            StackLayout sl2 = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Padding         = new Thickness(10, 5, 10, 5),
                Children        =
                {
                    instr2,
                    button1
                }
            };
            Frame frame1 = new Frame
            {
                BorderColor  = Color.DarkRed,
                CornerRadius = 10,
                Padding      = 8,
                Content      = sl1
            };
            Frame frame2 = new Frame
            {
                BorderColor  = Color.DarkRed,
                CornerRadius = 10,
                Padding      = 8,
                Content      = sl2
            };

            Grid grid = new Grid
            {
                BackgroundColor = Color.Beige,
                RowDefinitions  =
                {
                    new RowDefinition {
                        Height = new GridLength(8, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = new GridLength(8, GridUnitType.Star)
                    }
                },
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = GridLength.Auto
                    }
                }
            };

            grid.Children.Add(frame1, 0, 0);
            grid.Children.Add(frame2, 0, 2);

            StackLayout sl3 = new StackLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children        =
                {
                    grid
                }
            };

            Padding         = new Thickness(30, 55);
            BackgroundColor = Color.Beige;
            Content         = grid;
        }