Android数据绑定不适用于Kotlin的class级授权

我的ViewModel:

class MyVM( app: Application, private val observableImpl: BaseObservable, /* other colaborators*/ ) : AndroidViewModel(app), Observable by observableImpl { var currencyCode: String by Delegates.observable("") { _, _, newValue -> /* business logic methods */ notifyPropertyChanged(BR.currencyCode) } @Bindable get } 

我的布局:

          

currencyCode在数据模型中更新时, TextView不会自动更改文本。

我试图摆脱从AndroidViewModelinheritance和定义MyVM ,如下所示:

 class MyVM(/* other colaborators*/) : BaseObservable() { } 

它的工作。 问题是,我不能丢弃我的生产代码中的AndroidViewModel的inheritance。

尽管有一个解决方法:

 val currencyCode = ObservableField() 

但我不熟悉在我的ViewModel中使用ObservableFields。 你有什么建议吗?