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

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

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