Skip to content

Fix crash with samsung keyboard when using password textboxes #18793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,20 +279,20 @@ public CapitalizationMode GetCursorCapsMode([GeneratedEnum] CapitalizationMode r

public ICharSequence? GetSelectedTextFormatted([GeneratedEnum] GetTextFlags flags)
{
return new SpannableString(_editBuffer.SelectedText);
return new Java.Lang.String(_editBuffer.SelectedText ?? "");
}

public ICharSequence? GetTextAfterCursorFormatted(int n, [GeneratedEnum] GetTextFlags flags)
{
var end = Math.Min(_editBuffer.Selection.End, _editBuffer.Text.Length);
return new SpannableString(_editBuffer.Text.Substring(end, Math.Min(n, _editBuffer.Text.Length - end)));
return new Java.Lang.String(_editBuffer.Text.Substring(end, Math.Min(n, _editBuffer.Text.Length - end)));
}

public ICharSequence? GetTextBeforeCursorFormatted(int n, [GeneratedEnum] GetTextFlags flags)
{
var start = Math.Max(0, _editBuffer.Selection.Start - n);
var length = _editBuffer.Selection.Start - start;
return _editBuffer.Text == null ? null : new SpannableString(_editBuffer.Text.Substring(start, length));
return _editBuffer.Text == null ? null : new Java.Lang.String(_editBuffer.Text.Substring(start, length));
}

public bool PerformPrivateCommand(string? action, Bundle? data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public string? ComposingText
SelectionStart = Selection.Start,
SelectionEnd = Selection.End,
StartOffset = 0,
Text = new SpannableString(Text)
Text = new Java.Lang.String(Text)
};

internal void Remove(int index, int length)
Expand Down
Loading