Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: use Data Binding #14

Open
IgorGanapolsky opened this issue Jun 24, 2015 · 16 comments
Open

Enhancement: use Data Binding #14

IgorGanapolsky opened this issue Jun 24, 2015 · 16 comments

Comments

@IgorGanapolsky
Copy link

Hi,
I was wondering if there are any plans to use Android's new Data Binding framework inside of AnnotatedAdapter. Or perhaps there is an easy way for devs to integrate it themselves now?

@sockeqwe
Copy link
Owner

I haven't had time yet to have a deep look at data binding for adapters, but my understanding is that is makes creating ViewHolders useless (there is something called BindingHolder that seems to be a replacement for creating ViewHolders on your own). Therefore, I'm not sure if data binding is a complete replace AnnotatedAdapter. I will have a look at the data binding framework once it's out of beta later this summer. If it makes sense then I think I will integrate data binding in AnnotatedAdapter (i.e. as far as I see distinguishing between different ViewTypes must still be done by hand, maybe AnnotatedAdapter could reduce writing that code).

@IgorGanapolsky
Copy link
Author

You are correct that it does all the work of ViewHolders for us. You just call the ViewHolder's constructor like ViewHolder(ViewDataBinding binding), and it does the rest. But I do think that we need support for different ViewTypes - as AnnotatedAdapter does.

@sockeqwe
Copy link
Owner

Ah thanks, good to know. I will wait until a final 1.0.0 release of data binding and then I will see what is possible and whether it makes sense or not.

@IgorGanapolsky
Copy link
Author

@sockeqwe Thanks for making your framework better. Have some @changetip $1 bitcoin.

@sockeqwe sockeqwe reopened this Jun 25, 2015
@BashCo
Copy link

BashCo commented Jun 25, 2015

@IgorGanapolsky Don't mind me, just testing the tip bot. $1 @changetip

@changetip
Copy link

Hi @IgorGanapolsky, I've delivered a Bitcoin tip worth 4,025 bits ($1.00) from @BashCo to your ChangeTip wallet.

Learn about ChangeTip

@changetip
Copy link

Hi @sockeqwe, @IgorGanapolsky sent you a Bitcoin tip worth 4,025 bits ($1.00), and I'm here to deliver it ➔ collect your tip.

Learn more about ChangeTip

@IgorGanapolsky
Copy link
Author

Hey, I was wondering if you've considered the Data Binding option for Mosby 2.0?

@sockeqwe
Copy link
Owner

sockeqwe commented Sep 1, 2015

Hi, this library AnnotatedAdapter is not Mosby related nor part of mosby. However, right now I have no plans to add DataBinding to AnnotatedAdapter since I have other projects with higher priority. I have started another library for Adapters called AdapterDelegates which you may find useful. I think I will spend more time on the new library (AdapterDelegates) than on this one. There were some requests in combining AnnotatedAdapter withwith the new one (AdapterDelegates) but this will not happen: see sockeqwe/AdapterDelegates#2 .

Regarding, data binding and Mosby: Yes I do have plans to add MVVM (Model-View-ViewModel) with data binding as addition to Mosby (addition to MVP, not replacement) but I can't say any concrete date when this will be implemented. It will definitely not be part of Mosby 2.0 (probably in Mosby 3.0). There is a issue on mosby's github repo for that sockeqwe/mosby#71. Also I'm not 100% convinced that MVVM is the best choice as Android application architecture. Nevertheless, I see the benefit of data binding frameworks and I hope to come up with a solution.

@IgorGanapolsky
Copy link
Author

Awesome, thanks. So are AdapterDelegates gonna repace AnnotatedAdapter in
your Mosby samples eventually?
On Sep 1, 2015 6:02 PM, "Hannes Dorfmann" notifications@github.com wrote:

Hi, this library AnnotatedAdapter is not Mosby related nor part of mosby.
However, right now I have no plans to add DataBinding to AnnotatedAdapter
since I have other projects with higher priority. I have started another
library for Adapters called AdapterDelegates which you may find useful. I
think I will spend more time on the new library (AdapterDelegates) than on
this one. There were some requests in combining AnnotatedAdapter withwith
the new one (AdapterDelegates) but this will not happen: see
sockeqwe/AdapterDelegates#2
sockeqwe/AdapterDelegates#2 .

Regarding, data binding and Mosby: Yes I do have plans to add MVVM
(Model-View-ViewModel) with data binding as addition to Mosby (addition to
MVP, not replacement) but I can't say any concrete date when this will be
implemented. It will definitely not be part of Mosby 2.0 (probably in Mosby
3.0). There is a issue on mosby's github repo for that sockeqwe/mosby#71
sockeqwe/mosby#71. Also I'm not 100%
convinced that MVVM is the best choice as Android application architecture.
Nevertheless, I see the benefit of data binding frameworks and I hope to
come up with a solution.


Reply to this email directly or view it on GitHub
#14 (comment)
.

@sockeqwe
Copy link
Owner

sockeqwe commented Sep 2, 2015

I don't think so. Eventually the sample adapters get replaced with default handwritten adapter implementations because the users who just want to have a look at mosby samples shouldn't have to understand other third party libraries like AnnotatedAdapter as well...

@IgorGanapolsky
Copy link
Author

Ahh, darn. Just when I started to understand AnnotatedAdapters and
implementing them in my own apps, I will have to go and rip them out :(

On Tue, Sep 1, 2015 at 11:16 PM, Hannes Dorfmann notifications@github.com
wrote:

I don't think so. Eventually the sample adapters get replaced with default
handwritten adapter implementations because the users who just want to have
a look at mosby samples shouldn't have to understand other third party
libraries like AnnotatedAdapter as well...


Reply to this email directly or view it on GitHub
#14 (comment)
.

@sockeqwe
Copy link
Owner

sockeqwe commented Sep 2, 2015

You don't have to, there is nothing wrong with using AnnotatedAdapter...

@IgorGanapolsky
Copy link
Author

Ok, slight comment: in Mosby you are using AnnotatedAdapter v1.0.0, but the latest AnnotatedAdapter available is 1.0.1. They differ specifically on how com.hannesdorfmann.annotatedadapter.annotation.Field defines an id. Is it prudent for me to update my app to the latest AnnotatedAdapter and make the changes, or is it ok to stick with an outdated version?

@sockeqwe
Copy link
Owner

sockeqwe commented Sep 2, 2015

The samples has been updated to latest AnnotatedAdapter version 1.1.1 on Mosby 2.0 branch ( https://github.com/sockeqwe/mosby/tree/2.0 ) .

There was some changes from 1.0.0 to 1.1.0 regarding @Field which has become @ViewFiled. Starting in 1.1.0 @Field can be used to define Fields in ViewHolder, like a Field for a OnClickListener.

1.1.1 added some @SuppressLint annotations since Android build tools 23.0.0 are more aggressive now and need this @SuppressLint. So if you want to use build tools 23.0.0 then you have to use AnnotatedAdapter 1.1.1, sorry

@IgorGanapolsky
Copy link
Author

Looks good thanks!
On Sep 2, 2015 12:52 PM, "Hannes Dorfmann" notifications@github.com wrote:

The samples has been updated to latest AnnotatedAdapter version 1.1.1 on
Mosby 2.0 branch ( https://github.com/sockeqwe/mosby/tree/2.0 ) .

There was some changes from 1.0.0 to 1.1.0 regarding @field which has
become @ViewFiled. Starting in 1.1.0 @field can be used to define Fields
in ViewHolder, like a Field for a OnClickListener.

1.1.1 added some @SuppressLint annotations since Android build tools
23.0.0 are more aggressive now and need this @SuppressLint. So if you
want to use build tools 23.0.0 then you have to use AnnotatedAdapter 1.1.1,
sorry


Reply to this email directly or view it on GitHub
#14 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants