Is there anything butterknife can do that databinding can't?

4.3k views Asked by At

we're just starting a new project

And it seems like both butterknife and databinding are awesome tools to reduce boilerplate code.

We started with butterkife and added databinding later, the idea is to not have viewmodel classes in java instead express them in xml.

Is there any reason to keep butterkife around ?

3

There are 3 answers

0
bshears On BEST ANSWER

The same situation happened in my current project. We used ButterKnife and DataBinding alongside. We decided to get rid of one of those as we used ButterKnife version 7.X (converting to 8.X would be quite painful in such a big app). We got much cleaner code with DataBinding and removing the other library reduced build time :)

BUT notice that DataBinding still won't work with enabled Jack&Jill compiler, which will change soon hopefully. Using neenbedankt-apt and Retrolambda is still OK.

TL;DR

Get rid of ButterKnife.

0
Ali Habbash On

Butter Knife come with bind resource like color, animation,...etc.

that data binding can't do actually.

1
Ayush Jain On

For a small XML view Data binding is good but as your view will become complex then it really hard to maintain it. Please check the below link https://medium.com/@Miqubel/4-reasons-im-not-using-android-data-binding-e62127c2650c