static int GetCursorStartPosition(EditorHandler editorHandler) { var control = GetNativeEditor(editorHandler); return(control.SelectionStart); }
string GetNativeText(EditorHandler editorHandler) => GetNativeEditor(editorHandler).Text;
Task <string> GetPlatformText(EditorHandler handler) { return(InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text)); }
public static void MapIsTextPredictionEnabled(EditorHandler handler, IEditor editor) { }
public static void MapKeyboard(EditorHandler handler, IEditor editor) { }
public static void MapTextColor(EditorHandler handler, IEditor editor) { }
public static void MapFont(EditorHandler handler, IEditor editor) { }
bool GetNativeIsTextPredictionEnabled(EditorHandler editorHandler) => !GetNativeEditor(editorHandler).InputType.HasFlag(InputTypes.TextFlagNoSuggestions);
MauiTextView GetNativeEditor(EditorHandler editorHandler) => (MauiTextView)editorHandler.NativeView;
Color GetNativePlaceholderColor(EditorHandler editorHandler) => ((uint)GetNativeEditor(editorHandler).CurrentHintTextColor).ToColor();
bool GetNativeIsReadOnly(EditorHandler editorHandler) => !GetNativeEditor(editorHandler).Focusable;
double GetNativeUnscaledFontSize(EditorHandler editorHandler) { var textView = GetNativeEditor(editorHandler); return(textView.TextSize / textView.Resources.DisplayMetrics.Density); }
static void SetNativeText(EditorHandler editorHandler, string text) => GetNativeEditor(editorHandler).Text = text;
static void UpdateCursorStartPosition(EditorHandler editorHandler, int position) { var control = GetNativeEditor(editorHandler); control.SetSelection(position); }
UITextView GetNativeEditor(EditorHandler editorHandler) => (UITextView)editorHandler.View;
string GetNativePlaceholderText(EditorHandler editorHandler) => GetNativeEditor(editorHandler).PlaceholderText;
void SetPlatformText(EditorHandler editorHandler, string text) => GetPlatformControl(editorHandler).Text = text;
Color GetNativePlaceholderColor(EditorHandler editorHandler) => GetNativeEditor(editorHandler).PlaceholderTextColor.ToColor();
public static void MapCharacterSpacing(EditorHandler handler, IEditor editor) { }
double GetNativeCharacterSpacing(EditorHandler editorHandler) { var editor = GetNativeEditor(editorHandler); return(editor.AttributedText.GetCharacterSpacing()); }
public static void MapIsReadOnly(EditorHandler handler, IEditor editor) { }
double GetNativeUnscaledFontSize(EditorHandler editorHandler) => GetNativeEditor(editorHandler).Font.PointSize;
public static void MapMaxLength(EditorHandler handler, IEditor editor) { }
bool GetNativeIsReadOnly(EditorHandler editorHandler) => !GetNativeEditor(editorHandler).UserInteractionEnabled;
EditText GetNativeEditor(EditorHandler editorHandler) => (EditText)editorHandler.View;
bool GetNativeIsTextPredictionEnabled(EditorHandler editorHandler) => GetNativeEditor(editorHandler).AutocorrectionType == UITextAutocorrectionType.Yes;
AppCompatEditText GetNativeEditor(EditorHandler editorHandler) => (AppCompatEditText)editorHandler.View;
public static void MapText(EditorHandler handler, Editor editor) { Platform.TextBoxExtensions.UpdateText(handler.PlatformView, editor); }
MauiTextView GetPlatformControl(EditorHandler handler) => handler.PlatformView;
bool GetNativeIsUrlKeyboard(EditorHandler editorHandler) => GetNativeEditor(editorHandler).KeyboardType == UIKeyboardType.Url;