String comparison on Android Data Binding

There is no need to import the String class into your layout file.

To check whether two strings have equal value or not equals() method should be used.

= is used to check the whether the two strings refer to the same reference object or not.

Solution:

android:textColor="@{notice.action.equals(`continue`) ? @color/enabledPurple : @color/disabledGray }"

It can be do in two way :-

1. First way inside xml :-

    android:textColor="@{notice.action.equals(`continue`) ? @color/enabledPurple : @color/disabledGray }"

2. Second way (programatically) Inside xml :-

app:setColor="@{notice.action}" 
inside activity or custom class : -    
    @BindingAdapter("setColor")
        public static void setTextColor(TextView textView, String s) {

             Context context = textView.getContext();

        textView.setTextColor(s.equals("continue") ? context.getResources().getColor(R.color.enabledPurple) : context.getResources().getColor(R.color.disabledGray));
        }

'continue' is char type, so it should be changed to String to compare with notice.action.

android:textColor="@{notice.action.equals(String.valueOf(`continue`)) ? @color/enabledPurple : @color/disabledGray }"