Right now, I can change the cursor drawable through reflection and using property android:textCursorDrawable
. I looked at the TextView
code, and its actually reading the drawables from Resources.Theme. I'm wondering if its possible and how to change it by creating a custom theme in styles.xml
?
final Resources.Theme theme = context.getTheme();
/*
* Look the appearance up without checking first if it exists because
* almost every TextView has one and it greatly simplifies the logic
* to be able to parse the appearance first and then let specific tags
* for this View override it.
*/
TypedArray a = theme.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.TextViewAppearance, defStyleAttr, defStyleRes);