Suggested Extension: Custom Cursors for TextBox Component

  1. An extension that gives the App Developer a selection of cursors to choose from and if possible also allow the App User to select cursors.

  2. An advanced version that allows App Developer/App User to define their own cursor using an image (.png).


Great suggestion :+1: - I will start working on this immediately.


This can be helpful for you.


Here is also another approach.

This is possible with Kodular by setting AccentColor accordingly.

1 Like

Yes, it is in the Kodular documentation, bbut I don't think this applies to App Inventor (although App Inventor does have an AccentColor property as well.).

You are going to create the extension right? If you aren't then i will give a try.

I am trying to implement the cursor features in this extension. Currently testing.

EDIT: Verified not working. Failed attempt.

1 Like

you might show current code maybe you are doing something wrong?

I removed the code already unfortunately. :disappointed_relieved: Same as this.

public void ColorFilter(int color) {
Drawable drawable = view.getBackground(); // get current EditText drawable
drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP); // change the drawable color

if(Build.VERSION.SDK_INT > 16) {
  view.setBackground(drawable); // set the new drawable to EditText
  view.setBackgroundDrawable(drawable); // use setBackgroundDrawable because setBackground required API 16


Maybe try this one :grinning_face_with_smiling_eyes:


I tested, it instead filled the BackgroundColor of the TextBox.

We already have BackgroundColor for Textbox, don't we?

TextCursorDrawable is added on API 29. You can use the getter and setter properties.

Example :

EditText editText =...;
public void SetCursorColor(int color){
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
            editText.setTextCursorDrawable(//drawable or intDrawableResId);

Before API 29, Only a solution is using java reflection.

1 Like