vicpinm / Kotlin-Realm-Extensions

Kotlin extensions to simplify Realm API.
Apache License 2.0
535 stars 53 forks source link

ObservableList in result #38

Closed AndroFlo closed 6 years ago

AndroFlo commented 6 years ago

Hello,

I would to query my object and have in result an ObservableList. I need this to use the lib with the lib LastAdapter, is it possible ?

Thank's

vicpinm commented 6 years ago

Hi @AndroFlo, this library has no dependencies with databinding and is not aware of how your data is bound to your view. I think you shouldn't use this class in your database layer. Maybe you can create yourself an observablelist instance in your view layer.

AndroFlo commented 6 years ago

@vicpinm thank's for your response.I'm beginning with DataBinding, but if i understand , LastAdapter library know the link between my models and my database; because it is bind into my layout. So if i have a result of realm converted into an ObservableList that can't work ?

vicpinm commented 6 years ago

@AndroFlo I'm not familiar with DataBinding nor LastAdapter library, but I suppose you can create your own ObservableList instance and update it with the data obtained from your database layer.