Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
With introduction to Android API Q, we can change the cursor using textCursorDrawable
Unfortunately after initially set up the textCursorDrawable can no longer be changed.
The problem is that the public method setTextCursorDrawable() is calling the Editor method loadCursorDrawable() and that method sets the private variable mDrawableForCursor only once during the first method call when the initial value is still null.
public void setTextCursorDrawable(@Nullable Drawable textCursorDrawable) {
mCursorDrawable = textCursorDrawable;
mCursorDrawableRes = 0;
if (mEditor != null) {
mEditor.loadCursorDrawable();
}
}
void loadCursorDrawable() {
if (mDrawableForCursor == null) {
mDrawableForCursor = mTextView.getTextCursorDrawable();
}
}
Instead setTextCursorDrawable() should call a new method for example called: reloadCursorDrawable(), and this method should allow to reload the cursor drawable even if the mDrawableForCursor != null
void reloadCursorDrawable() {
mDrawableForCursor = mTextView.getTextCursorDrawable();
}