I am starting to use ButterKnife and I got it is working inside fragment with views that are inflated.
But I have a question, is it possible to get views which aren't inflated?
For example, I have a toolbar inside of my MainActivity, but not inside the fragment. Can I access to this toolbar using ButterKnife?.
And other question. I tried to get the toolbar height using:
Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
int toolbarHeight = toolbar.getHeight();
But this return always 0. How can I get the toolbar size from the view directly? Now I am using:
getActivity().getTheme().resolveAttribute(android.R.attr.actionBarSize, typedValueToolbarHeight, true);
But really I would like to get the toolbar from the view.