Changing Android's EditText cursor pointer color programmatically

So, i've searched a lot but i couldn't find anything, if this ends up being a duplicate i'm sorry, but i want to cange the color of the EditText's cursor pointer that is used to move the cursor

enter image description here

I already managed to change the cursor's color itself but it doesn't affect the pointer which seems to only respond to accentColor.

I'm pretty sure it's possible because i recall seeing an app that did it, it had the pointer and all the elements in a dialog change color based on a color that you choose without changing the accent color of the view below the dialog.

Please help :)


You can create your own style/theme for only this EditText and change the ColorAccent :

<style name="EditTextColorCustom" parent="@style/AppBaseTheme">
        <!-- Customize your theme here. -->
        <item name="colorAccent">@color/colorAccent</item>
    </style>

You can do this by creating new style in style.xml like this

<style name="CustomEditTextTheme" parent="TextAppearance.AppCompat">
    <item name="colorAccent">@color/primary_dark_material_dark</item>       
</style>

Then in EditText tag use this

style="@style/CustomEditTextTheme"

you can use textSelectHandle to replace it by your drawable like this:

android:textSelectHandle="@drawable/your_drawble"