I have the following code:
TextView tv = (TextView) findViewById(R.id.example);
if (condition) {
tv.setEnabled(false);
}
tv.setOnClickListener(new View.OnClickListener() { ... });
If condition
is true, this causes the text to appear in a lighter grey colour but also to stop responding to clicks.
How can I make the TextView take on the 'disabled' appearance whilst still responding to click events? I would like to accomplish this without manually adjusting the colours, something like:
tv.setEnabled(false);
tv.setClickable(true);
(which doesn't work)
Is there a way to do this?