Android.Views.GravityFlags GetNativeVerticalTextAlignment(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().First(); return(editText.Gravity); }
Android.Views.TextAlignment GetNativeTextAlignment(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().First(); return(editText.TextAlignment); }
double GetNativeCharacterSpacing(SearchBarHandler searchBarHandler) { var searchBar = GetNativeSearchBar(searchBarHandler); var textField = searchBar.FindDescendantView <UITextField>(); return(textField.AttributedText.GetCharacterSpacing()); }
static void UpdateCursorStartPosition(SearchBarHandler searchBarHandler, int position) { var control = searchBarHandler.QueryEditor; var endPosition = control.GetPosition(control.BeginningOfDocument, position); control.SelectedTextRange = control.GetTextRange(endPosition, endPosition); }
static void UpdateCursorStartPosition(SearchBarHandler searchBarHandler, int position) { var control = GetNativeSearchBar(searchBarHandler); var editText = control.GetChildrenOfType <EditText>().FirstOrDefault(); editText.SetSelection(position); }
static int GetCursorStartPosition(SearchBarHandler searchBarHandler) { var control = GetNativeSearchBar(searchBarHandler); var editText = control.GetChildrenOfType <EditText>().FirstOrDefault(); return(editText.SelectionStart); }
double GetNativeUnscaledFontSize(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().FirstOrDefault(); if (editText == null) { return(-1); } return(editText.TextSize / editText.Resources.DisplayMetrics.Density); }
bool GetNativeIsItalic(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().FirstOrDefault(); if (editText == null) { return(false); } return(editText.Typeface.IsItalic); }
UIControlContentVerticalAlignment GetNativeVerticalTextAlignment(SearchBarHandler searchBarHandler) { var uiSearchBar = GetNativeSearchBar(searchBarHandler); var textField = uiSearchBar.FindDescendantView <UITextField>(); if (textField == null) { return(UIControlContentVerticalAlignment.Center); } return(textField.VerticalAlignment); }
double GetNativeUnscaledFontSize(SearchBarHandler searchBarHandler) { var uiSearchBar = GetNativeSearchBar(searchBarHandler); var textField = uiSearchBar.FindDescendantView <UITextField>(); if (textField == null) { return(-1); } return(textField.Font.PointSize); }
double GetNativeCharacterSpacing(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().FirstOrDefault(); if (editText != null) { return(editText.LetterSpacing); } return(-1); }
UITextAlignment GetNativeTextAlignment(SearchBarHandler searchBarHandler) { var uiSearchBar = GetNativeSearchBar(searchBarHandler); var textField = uiSearchBar.FindDescendantView <UITextField>(); if (textField == null) { return(UITextAlignment.Left); } return(textField.TextAlignment); }
Android.Views.TextAlignment GetNativeTextAlignment(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().FirstOrDefault(); if (editText == null) { return(Android.Views.TextAlignment.Inherit); } return(editText.TextAlignment); }
bool GetNativeIsItalic(SearchBarHandler searchBarHandler) { var uiSearchBar = GetNativeSearchBar(searchBarHandler); var textField = uiSearchBar.FindDescendantView <UITextField>(); if (textField == null) { return(false); } return(textField.Font.FontDescriptor.SymbolicTraits.HasFlag(UIFontDescriptorSymbolicTraits.Italic)); }
bool GetNativeIsReadOnly(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().First(); if (editText == null) { return(false); } return(!editText.Focusable && !editText.FocusableInTouchMode); }
bool GetNativeIsBold(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().FirstOrDefault(); if (editText == null) { return(false); } return(editText.Typeface.GetFontWeight() == FontWeight.Bold); }
Color GetNativeTextColor(SearchBarHandler searchBarHandler) { var uiSearchBar = GetNativeSearchBar(searchBarHandler); var textField = uiSearchBar.FindDescendantView <UITextField>(); if (textField == null) { return(Colors.Transparent); } return(textField.TextColor.ToColor()); }
Color GetNativePlaceholderColor(SearchBarHandler searchBarHandler) { var searchView = GetNativeSearchBar(searchBarHandler); var editText = searchView.GetChildrenOfType <EditText>().FirstOrDefault(); if (editText != null) { int currentHintTextColor = editText.CurrentHintTextColor; AColor currentPlaceholderColorr = new AColor(currentHintTextColor); return(currentPlaceholderColorr.ToColor()); } return(Colors.Transparent); }
string GetNativePlaceholder(SearchBarHandler searchBarHandler) => GetNativeSearchBar(searchBarHandler).Placeholder;
string GetNativeText(SearchBarHandler searchBarHandler) => GetNativeSearchBar(searchBarHandler).Text;
UISearchBar GetNativeSearchBar(SearchBarHandler searchBarHandler) => (UISearchBar)searchBarHandler.View;
public static void MapText(SearchBarHandler handler, SearchBar searchBar) { Platform.SearchBarExtensions.UpdateText(handler.PlatformView, searchBar); }
static int GetCursorStartPosition(SearchBarHandler searchBarHandler) { var control = searchBarHandler.QueryEditor; return((int)control.GetOffsetFromPosition(control.BeginningOfDocument, control.SelectedTextRange.Start)); }
SearchView GetNativeSearchBar(SearchBarHandler searchBarHandler) => (SearchView)searchBarHandler.View;
Task <string> GetPlatformText(SearchBarHandler handler) { return(InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text)); }
static void SetNativeText(SearchBarHandler searchBarHandler, string text) => GetNativeSearchBar(searchBarHandler).SetQuery(text, false);
static SearchView GetNativeSearchBar(SearchBarHandler searchBarHandler) => searchBarHandler.PlatformView;
static SearchView GetNativeSearchBar(SearchBarHandler searchBarHandler) => searchBarHandler.NativeView;
static void SetNativeText(SearchBarHandler searchBarHandler, string text) => GetNativeSearchBar(searchBarHandler).Text = text;
MauiSearchBar GetPlatformControl(SearchBarHandler handler) => handler.PlatformView;