iapp 修改编辑框颜色

设置编辑框颜色

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)
}
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。