enpassio / Databinding

Various examples on databinding which can help not only understand how to get started with it but it also shows how this can be used in complex and real use cases
Apache License 2.0
26 stars 14 forks source link

two-way databinding kotlin #26

Closed OyaCanli closed 5 years ago

OyaCanli commented 5 years ago

added warning for unsaved changes, changed data class, check for empty toy

OyaCanli commented 5 years ago

@rajtheinnovator That's good! Thanks for reviewing. I also wanted to use some extension functions for simple repetitive tasks (like toasts, snack, fragment transaction) as it is common in kotlin world. However I wanted to agree together what to use. I think best option is android ktx library but I think it is available only for androidx. Otherwise there is Anko which provides extensions for toast, snack, alertdialog etc.. But I didn't see fragment transaction. And a third option could be to have our own extension functions in a file in the project.

rajtheinnovator commented 5 years ago

@OyaCanli I know, this is lot of hard work already, but maybe you'd like to create an advanced sample including all the complex or easy concepts, to help serve a complete repo. Not now exactly, I'll share more ideas on it once we've first published it or nearing publishing. Great work so far :clap: :raised_hands:

OyaCanli commented 5 years ago

@rajtheinnovator Frankly, I think it is enough. But I want to return working on a project of mine, which use databinding exhaustively. When it will be ready, we can show it as a more complex example as well, if you wish.. By the way, don't forget that there is still kotlin version of the sample with NewsApi.

rajtheinnovator commented 5 years ago

I though we could keep everything on databinding in same repo but yes, you're absolutely right, the more detailed uses can be put in use, in those other samples we have. Let's go with the strategy you suggested here @OyaCanli :+1: