I am beginner to Android and I am working on a project, where the butterknife is used, I have to set the dark theme and light theme based on a user preference. I added databinding inorder to apply to the background and the test views based on the theme change. Is it okay to have butterknife and databinding in the same class.
Could you please help clarify.
You can use both alongside in your project.
The downside is that both
butterknifeanddatabindingwill be generating boilerplate code required for you.But
databindinggives has more benefits thanbutterknifeand much more cleaner code also.databindingis much more advanced thanbutterknife. For more about databinding and also some blogs making head-to-head comparison here and here.As officially announced for Butterknife,
The better way is to slowly start to get rid of
butterknifeand start usingdatabinding