android - ButterKnife - bind drawable resource -


how eliminate following initialization code using butterknife annotations?

private drawable mexpanddrawable; private drawable mcollapsedrawable;  void init() {     mexpanddrawable = getresources().getdrawable(r.drawable.ic_expand_small_holo_light);     mcollapsedrawable = getresources().getdrawable(r.drawable.ic_collapse_small_holo_light); } 

use @binddrawable butterknife 7 api.

import butterknife.binddrawable;  @binddrawable(r.drawable.ic_expand_small_holo_light) protected drawable mexpanddrawable; @binddrawable(r.drawable.ic_collapse_small_holo_light) protected drawable mcollapsedrawable;  void init() {     butterknife.bind(this); } 

there @bindstring, @bindint, @binddimen, @bindcolor, @bindbool other resource types.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -