Hey subscribers and watchers What's up
it's me wes here sliden in this video
I'm going to talk about how to implement
dependency injection with the Butter
knife Library Before I start There are
two things that I would like to Point
out first if you go to Google and if you
type slide Note dependency injection We
have a post right here that talks about
all the libraries of dependency
injection in detail that includes Butter
knife Robo guys Android annotations and
dagger the first two videos are
obviously there and the last two videos
will be available on your email if you
Subscribe to our email list you will get
an email that looks like this that talks
about the videos their Links the
comparison between different libraries
and a stack of work flow that compares
performance wise which Library is good
not to mention the code samples for all
the libraries and all the examples that
We have run here so be sure to Subscribe
to our email list on slide.com so Let's
take a look at What our activity looks
like before adding Butter knife This is
like any other activity you have three
text views Here you use the find view by
ID methods to call and initialize your
text views but with Butter knife This is
what you do you use this annotation
called at inject view And you Supply the
ID Of Your view inside the brackets
which means you don't have to call find
view by ID instead you write this
statement Which is Butter knife inject
this now This Is Better Than writing
find view by ID 10 times once you agree
with me even if you are using a fragment
The process is the same you call inject
view and then you say butter knife
inject inside your own create view or on
view created depends on you Where you
want to initialize stuff if you take a
look at How a list adapter can change if
you remember earlier We had a view
Holder where we would take a view OB in
the parameter right here and then Use
this view object to call find viw by ID
but Again that can be eliminated by
saying Butter knife inject this object
Take This view and use this view to find
our tex views that we need inside our
view Holder So this is how you can use
it with list adapter as well and this
would Be The complete cde roughly for
your base adapter now I did not get
enough time to experiment Butter knife
with a recycle view adapter However I
would like to know from you in the coms
what do you think is it working for you
Are you experiencing any issues do let
me know and Don't Forget to Subscribe to
our email list at slide.com and If You
can go ahead and Google us say slid em
You Will Find all our coures out there
our social account on SL Twitter and SL
Facebook and thee for this the pral
example and Everything is out there on
giub Thanks for watching I'll cch you
guys in the next Have a nice day