I\'m trying to implement a simple colorfilter on an imageview to turn the black image into a white image. In order to achieve that I do the following:
we
For me, simply calling setColorFilter() on the ImageView wasn't working.
imageView.setColorFilter(ResourcesCompat.getColor(resources, color, null)) //didnt work on 21, only 22+
For whatever reason, on API 21, the only way I could get setColorFilter() to work properly was to post the change to the views message queue.
imageView.post { imageView.setColorFilter(ResourcesCompat.getColor(resources, color, null)) } //this works on 21+