设置编辑框颜色
gvs(4, view)
s color = "#000000"
java(ic,null,"android.graphics.Color.parseColor","String",color)
javags(SDK_INT,null,"android.os.Build$VERSION","SDK_INT")
f(SDK_INT < 28) {
//低于9.0
us(view,"textcursordrawable",color)
} else (SDK_INT == 28) {
javags(editor, view, "android.widget.TextView", "mEditor")
javags(cursor, editor, "android.widget.Editor", "mDrawableForCursor")
f(cursor == null) {
javags(dres,view,"android.widget.TextView","mCursorDrawableRes")
java(res,activity,"android.content.Context.getResources")
java(cursor,res,"android.content.res.Resources.getDrawable","int",dres)
javass(null, editor, "android.widget.Editor", "mDrawableForCursor", cursor)
}
javags(atop,null,"android.graphics.PorterDuff$Mode","SRC_ATOP")
javanew(pdcf,"android.graphics.PorterDuffColorFilter","int",ic,"android.graphics.PorterDuff$Mode",atop)
java(null,cursor,"android.graphics.drawable.Drawable.setColorFilter","android.graphics.ColorFilter",pdcf)
} else {
javanew(cursor,"android.graphics.drawable.ColorDrawable","int",ic)
java(null,view,"android.widget.TextView.setTextCursorDrawable","android.graphics.drawable.Drawable",cursor)
}