TextEdit.SetCursorColor Android 9

42 views
Skip to first unread message

david sands

unread,
Feb 16, 2020, 10:59:28 PM2/16/20
to DroidScript

On Android 9 (API 28) it seems that it is no longer possible to change the cursor color dynamically via reflection (1), so the TextEdit method, SetCursorColor, doesn't work on my Android 9 devices. It seems that cursor attributes now have to be set in XML (then applied at run-time?) Anyway, I hope there is a work around, or at least a choice between, white and black cursors. As it is, light themes are unusable in API 28 or above if they require user input.



Steve Garman

unread,
Feb 17, 2020, 12:43:55 AM2/17/20
to DroidScript
There is not currently a workaround for this issue.

It is on the TODO list for when DroidScript's targetSdk is increased from 28 to 29 but there is quite a lot of work to be done before that change can be made.

Steve Garman

unread,
Feb 17, 2020, 2:17:51 AM2/17/20
to DroidScript
The nearest thing I have to a workaround at the moment is to ignore the theme colours for the individual TextEdit if running on Android 9+
I realise this is far from ideal

var edt = app.CreateTextEdit( "Hello folks" );
if(app.GetBuildNum() > 27)
{
edt.SetBackColor( "#888888" );
edt.SetTextColor( "#ffffff" );
}
lay.AddChild( edt );

Mikhael

unread,
May 4, 2020, 8:05:06 AM5/4/20
to DroidScript
Please, tell me, will the problem with the cursor color be solved in the near future?

Steve Garman

unread,
May 4, 2020, 9:43:27 AM5/4/20
to DroidScript
It is not fixed in the latest beta and I as far as I know, no fix has been identified while the target SDK is 28.

I would be surprised if a fix makes it into the next release.

Reply all
Reply to author
Forward
0 new messages