Unfortunately, Google have not exposed xml attributes to tint, or methods to set, the drawables for these even in the compatability libraries, so currently the only way to dynamically set them is via reflection as described.
However, you can set the drawables in xml, and if you just want to tint the existing material design drawables this can be done by tinting xml for the text select handles as they are bitmap drawables, but the cursor drawable is an inset drawable, so will have to be recreated from the source code.
The drawables used are:
R.drawable.abc_text_select_handle_left_mtrl_light
R.drawable.abc_text_select_handle_middle_mtrl_light
R.drawable.abc_text_select_handle_right_mtrl_light
R.drawable.abc_text_cursor_material
You can create tinted versions of the text select handle drawables like this:
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/abc_text_select_handle_left_mtrl_light"
android:tint="@color/my_text_select_handle_color" />
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/abc_text_select_handle_middle_mtrl_light"
android:tint="@color/my_text_select_handle_color" />
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/abc_text_select_handle_right_mtrl_light"
android:tint="@color/my_text_select_handle_color" />
The cursor drawable can be recreated from the source code like this:
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:inset="2dp">
<shape
android:tint="@color/my_text_cursor_color"
android:shape="rectangle">
<size
android:height="2dp"
android:width="2dp" />
<solid
android:color="@color/white" />
</shape>
</inset>
Place these in the drawables folder and reference them in your AppCompatEditText xml definition using:
android:textCursorDrawable
android:textSelectHandle
android:textSelectHandleLeft
android:textSelectHandleRight
and voila, custom colored cursor and select handles that exactly match the default material design version that avoids reflection so won't cause warnings or errors.