Difference between Dagger and ButterKnife Android

前端 未结 5 1683
旧巷少年郎
旧巷少年郎 2020-12-07 12:47

Can anyone point out the difference between Dagger and Butterknife? I know that Butterknife is a view injection library and Dagger is a dependency injection library. But the

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 13:47

    Here is a link to the Buterknife documentation. It's very straightforward. However, what the documentation doesn't say but the design of Butter Knife implies is that you can also use Butter Knife in custom views. Just replace "this" with "context" or "getContext" so you determine the scope.

    Link: http://jakewharton.github.io/butterknife/

    I combine Butter Knife, parcelable and easyAdapter for list views in my project. Reason is less boilerplate and with parcelable faster and cleaner parceling. So if you have a lot of ListViews, I recommend this approach.

    Links:

    https://github.com/johncarl81/parceler

    https://github.com/ribot/easy-adapter

提交回复
热议问题