I'm trying to change the foreground color and get the foreground color of a relative layout but I'm getting a warning that it is only available for API 23 (my app minimum is API 17).
I can't use the color as background since the appearance of the view is way different compared to applying a foreground color.
Is there a way to change the foreground color of the relative layout even on devices running on API 17?
EDIT:
This is what I've tried so far
programEventItem.setForeground(ContextCompat.getDrawable(context, R.color.light_gray));
EDIT 2:
This is what I'm trying to achieve. The user will be given tasks (let's say 4 or 14) and at first only first task will be unlocked to complete. The user has to complete these tasks one after the other (linearly). He/she can't skip the order and try 3rd one without doing the first two (or do a 10th task without doing 9 before it). If the user clicks on a task they unlocked then they will be shown the task to complete it. But, if the user clicks on a task that is locked a dialog will show reminding them that they have to complete the tasks in the order given to them. This is the reason these locked views should be clickable but their foreground should be a different color.