在 RoboBinding 中有注释DependsOnStateOf
。在这样的 PresentationModel 中使用它时:
@PresentationModel
class GreetingPresentationModel {
String firstname;
String lastname;
//getters and setters for both
@DependsOnStateOf("firstname")
public boolean isLastnameInputEnabled() {
return !TextUtils.isEmpty(firstname);
}
}
这行不通。以下绑定将始终为 false 并且不会更改。
bind:enabled="{lastnameInputEnabled}"
怎么了?