setActionTextColor not work properly

#26 · closed · 1 comments

View on GitHub ↗

ganbarelabs

Hi, first of all, thanks for this awesome library. I had some problem with this peace of code. `val snacky = Snacky.builder() .setView(root) .setText(msg) .setDuration(time) .setBackgroundColor(Color.WHITE) .setTextColor(R.color.material_color_blue_grey_500) .setTextTypeface(ResourcesCompat.getFont(this, R.font.montserrat_regular)) .setActionTextTypeface(ResourcesCompat.getFont(this, R.font.montserrat_bold)) .setActionTextColor(R.color.colorAccent) .build()` Result -> the action text color had the same color of text message Thanks

Comments

matecode

Hi! Sorry for your confusion. setActionTextColor is working properly, but the readme was not clear enough. You have to give a real ColorInt to the function, not a resourceId. So for your example just use **ContextCompat.getColor(context,R.color.YOURCOLOR)**: `val snacky = Snacky.builder() .setView(root) .setText(msg) .setDuration(time) .setBackgroundColor(Color.WHITE) .setTextColor(ContextCompat.getColor(R.color.material_color_blue_grey_500)) .setTextTypeface(ResourcesCompat.getFont(this, R.font.montserrat_regular)) .setActionTextTypeface(ResourcesCompat.getFont(this, R.font.montserrat_bold)) .setActionTextColor(ContextCompat.getColor(context,R.color.colorAccent)) .build()`