我在单击textview时正在检查背景可绘制对象,并在运行时更改背景。是否有任何方法可以在运行时比较背景可绘制对象
tvFollowFollowing.setOnClickListener {
//on clicking on textview tvFollowFollowing check the background drawable of textview and change the background
if(tvFollowFollowing.background==ContextCompat.getDrawable(context,R.drawable.item_follow_border)){
tvFollowFollowing.text=context.getString(R.string.following)
tvFollowFollowing.setTextColor(ContextCompat.getColor(context,R.color.colorGreyHeader))
tvFollowFollowing.background=ContextCompat.getDrawable(context,R.drawable.item_grey_border)
}else {
tvFollowFollowing.text=context.getString(R.string.follow)
tvFollowFollowing.setTextColor(ContextCompat.getColor(context,R.color.colorWhite))
tvFollowFollowing.background=ContextCompat.getDrawable(context,R.drawable.item_follow_border)
}
}