public async Task AutoCompleteTextField(MLPAutoComplete.MLPAutoCompleteTextField textField, string possibleCompletionsForString, Action <IEnumerable> completionHandler) { var result = await autoCompleteMaps.AutoComplete(textField.Text); var strings = result.Select(rs => rs.description).ToList(); completionHandler(strings); }
UITableView newAutoCompleteTableViewForTextField(MLPAutoCompleteTextField textField) { CGRect dropDownTableFrame = this.autoCompleteTableViewFrameForTextField(textField); var newTableView = new UITableView(dropDownTableFrame, UITableViewStyle.Plain); newTableView.WeakDelegate = textField; newTableView.DataSource = textField; newTableView.ScrollEnabled = true; newTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; return(newTableView); }
nfloat autoCompleteTableHeightForTextField(MLPAutoCompleteTextField textField, int numberOfRows) { nfloat maximumHeightMultiplier = (textField.MaximumNumberOfAutoCompleteRows - textField.PartOfAutoCompleteRowHeightToCut); nfloat heightMultiplier; if (numberOfRows >= textField.MaximumNumberOfAutoCompleteRows) { heightMultiplier = maximumHeightMultiplier; } else { heightMultiplier = numberOfRows; } nfloat height = textField.AutoCompleteRowHeight * heightMultiplier; return(height); }
CGRect autoCompleteTableViewFrameForTextField(MLPAutoCompleteTextField textField, int numberOfRows) { // #if BROKEN // // TODO: Reimplement this code for people using table views. Right now it breaks // // more normal use cases because of UILayoutContainerView // CGRect newTableViewFrame = [self autoCompleteTableViewFrameForTextField:textField]; // // UIView *rootView = [textField.window.subviews objectAtIndex:0]; // CGRect textFieldFrameInContainerView = [rootView convertRect:textField.bounds // fromView:textField]; // // CGFloat textfieldTopInset = textField.autoCompleteTableView.contentInset.top; // CGFloat converted_originY = textFieldFrameInContainerView.origin.y + textfieldTopInset; // // #else // CGRect newTableViewFrame = [self autoCompleteTableViewFrameForTextField:textField]; // CGFloat textfieldTopInset = textField.autoCompleteTableView.contentInset.top; // #endif // // CGFloat height = [self autoCompleteTableHeightForTextField:textField withNumberOfRows:numberOfRows]; // // newTableViewFrame.size.height = height; // #if BROKEN // newTableViewFrame.origin.y = converted_originY; // #endif // // if(!textField.autoCompleteTableAppearsAsKeyboardAccessory){ // newTableViewFrame.size.height += textfieldTopInset; // } // // return newTableViewFrame; CGRect newTableViewFrame = autoCompleteTableViewFrameForTextField(textField); nfloat textfieldTopInset = textField.AutoCompleteTableView.ContentInset.Top; nfloat height = this.autoCompleteTableHeightForTextField(textField, numberOfRows); newTableViewFrame.Height = height; if (!textField.AutoCompleteTableAppearsAsKeyboardAccessory) { newTableViewFrame.Height += textfieldTopInset; } return(newTableViewFrame); }
CGRect autoCompleteTableViewFrameForTextField(MLPAutoCompleteTextField textField) { CGRect frame = CGRect.Empty; if ((this.AutoCompleteTableFrame).Width > 0) { frame = this.AutoCompleteTableFrame; } else { frame = textField.Frame; frame.Y += textField.Frame.Size.Height; } frame.X += textField.AutoCompleteTableOriginOffset.Width; frame.Y += textField.AutoCompleteTableOriginOffset.Height; frame.Height += textField.AutoCompleteTableSizeOffset.Height; frame.Width += textField.AutoCompleteTableSizeOffset.Width; frame = RectangleFExtensions.Inset(frame, 1, 0); return(frame); }
public bool ShouldConfigureCell(MLPAutoCompleteTextField AutoCompleteTextField, UITableViewCell cell, string autoCompleteString, MLPAutoCompletionObject autoObject, Foundation.NSIndexPath NSIndexPath) { return true; }
public void DidShowAutoCompleteTableView(MLPAutoCompleteTextField textField, UITableView autoCompleteTableView) { Console.WriteLine ("Autocomplete table view is showing from the view hierarchy"); }
public void DidChangeNumberOfSuggestions(MLPAutoCompleteTextField textField, int numberOfSuggestions) { Console.WriteLine ("Did change number of suggestions"); }
public void DidShowAutoCompleteTableView(MLPAutoCompleteTextField textField, UITableView autoCompleteTableView) { Console.WriteLine("Autocomplete table view is showing from the view hierarchy"); }
public async Task<string[]> AutoCompleteTextField (MLPAutoCompleteTextField textField, string possibleCompletionsForString) { throw new NotImplementedException (); }
public void WillShowAutoCompleteTableView(MLPAutoCompleteTextField textField, UITableView autoCompleteTableView) { Console.WriteLine ("Autocomplete table view will be added to the view hierarchy"); }
UITableView newAutoCompleteTableViewForTextField(MLPAutoCompleteTextField textField) { CGRect dropDownTableFrame = this.autoCompleteTableViewFrameForTextField (textField); var newTableView = new UITableView (dropDownTableFrame, UITableViewStyle.Plain); newTableView.WeakDelegate = textField; newTableView.DataSource = textField; newTableView.ScrollEnabled = true; newTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; return newTableView; }
CGRect autoCompleteTableViewFrameForTextField(MLPAutoCompleteTextField textField) { CGRect frame = CGRect.Empty; if ((this.AutoCompleteTableFrame).Width > 0){ frame = this.AutoCompleteTableFrame; } else { frame = textField.Frame; frame.Y += textField.Frame.Size.Height; } frame.X += textField.AutoCompleteTableOriginOffset.Width; frame.Y += textField.AutoCompleteTableOriginOffset.Height; frame.Height += textField.AutoCompleteTableSizeOffset.Height; frame.Width += textField.AutoCompleteTableSizeOffset.Width; frame = RectangleFExtensions.Inset(frame, 1, 0); return frame; }
CGRect autoCompleteTableViewFrameForTextField(MLPAutoCompleteTextField textField, int numberOfRows) { // #if BROKEN // // TODO: Reimplement this code for people using table views. Right now it breaks // // more normal use cases because of UILayoutContainerView // CGRect newTableViewFrame = [self autoCompleteTableViewFrameForTextField:textField]; // // UIView *rootView = [textField.window.subviews objectAtIndex:0]; // CGRect textFieldFrameInContainerView = [rootView convertRect:textField.bounds // fromView:textField]; // // CGFloat textfieldTopInset = textField.autoCompleteTableView.contentInset.top; // CGFloat converted_originY = textFieldFrameInContainerView.origin.y + textfieldTopInset; // // #else // CGRect newTableViewFrame = [self autoCompleteTableViewFrameForTextField:textField]; // CGFloat textfieldTopInset = textField.autoCompleteTableView.contentInset.top; // #endif // // CGFloat height = [self autoCompleteTableHeightForTextField:textField withNumberOfRows:numberOfRows]; // // newTableViewFrame.size.height = height; // #if BROKEN // newTableViewFrame.origin.y = converted_originY; // #endif // // if(!textField.autoCompleteTableAppearsAsKeyboardAccessory){ // newTableViewFrame.size.height += textfieldTopInset; // } // // return newTableViewFrame; CGRect newTableViewFrame = autoCompleteTableViewFrameForTextField(textField); nfloat textfieldTopInset = textField.AutoCompleteTableView.ContentInset.Top; nfloat height = this.autoCompleteTableHeightForTextField(textField, numberOfRows); newTableViewFrame.Height = height; if(!textField.AutoCompleteTableAppearsAsKeyboardAccessory){ newTableViewFrame.Height += textfieldTopInset; } return newTableViewFrame; }
nfloat autoCompleteTableHeightForTextField(MLPAutoCompleteTextField textField, int numberOfRows) { nfloat maximumHeightMultiplier = (textField.MaximumNumberOfAutoCompleteRows - textField.PartOfAutoCompleteRowHeightToCut); nfloat heightMultiplier; if(numberOfRows >= textField.MaximumNumberOfAutoCompleteRows){ heightMultiplier = maximumHeightMultiplier; } else { heightMultiplier = numberOfRows; } nfloat height = textField.AutoCompleteRowHeight * heightMultiplier; return height; }
public bool ShouldStyleAutoCompleteTableView(MLPAutoCompleteTextField AutoCompleteTextField, UITableView autoCompleteTableView, UITextBorderStyle borderStyle) { return(true); }
public void DidChangeNumberOfSuggestions(MLPAutoCompleteTextField textField, int numberOfSuggestions) { Console.WriteLine("Did change number of suggestions"); }
public void DidHideAutoCompleteTableView(MLPAutoCompleteTextField textField, UITableView autoCompleteTableView) { Console.WriteLine("Autocomplete table view is removed from the view hierarchy"); }
public bool ShouldStyleAutoCompleteTableView(MLPAutoCompleteTextField AutoCompleteTextField, UITableView autoCompleteTableView, UITextBorderStyle borderStyle) { return true; }
public void WillHideAutoCompleteTableView(MLPAutoCompleteTextField textField, UITableView autoCompleteTableView) { Console.WriteLine ("Autocomplete table view will be removed from the view hierarchy"); }
public async Task AutoCompleteTextField(MLPAutoComplete.MLPAutoCompleteTextField textField, string possibleCompletionsForString, Action <IEnumerable> completionHandler) { completionHandler(countries); }
public MLPAutoCompleteFetchOperation(MLPAutoCompleteTextField textField) { _textField = textField; sortOperation = new MLPAutoCompleteSortOperation(_textField); }
public MLPAutoCompleteSortOperation(MLPAutoCompleteTextField textField) { _textField = textField; }
public void AutoCompleteTextField(MLPAutoCompleteTextField textField, string selectedString, MLPAutoCompletionObject selectedObject, Foundation.NSIndexPath indexPath) { Console.WriteLine("AutoCompleteTextField method called in delegate"); }
public bool ShouldConfigureCell(MLPAutoCompleteTextField AutoCompleteTextField, UITableViewCell cell, string autoCompleteString, MLPAutoCompletionObject autoObject, Foundation.NSIndexPath NSIndexPath) { return(true); }
public async Task <string[]> AutoCompleteTextField(MLPAutoComplete.MLPAutoCompleteTextField textField, string possibleCompletionsForString) { throw new NotImplementedException(); }
public void WillShowAutoCompleteTableView(MLPAutoCompleteTextField textField, UITableView autoCompleteTableView) { Console.WriteLine("Autocomplete table view will be added to the view hierarchy"); }
public MLPAutoCompleteFetchOperation(MLPAutoCompleteTextField textField) { _textField = textField; sortOperation = new MLPAutoCompleteSortOperation (_textField); }
public void AutoCompleteTextField(MLPAutoCompleteTextField textField, string selectedString, MLPAutoCompletionObject selectedObject, Foundation.NSIndexPath indexPath) { Console.WriteLine ("AutoCompleteTextField method called in delegate"); }
public void WillHideAutoCompleteTableView(MLPAutoCompleteTextField textField, UITableView autoCompleteTableView) { Debug.WriteLine("Autocomplete table view will be removed from the view hierarchy"); }