roboguice/roboguice — pull request #24 by stephanenicolas (2013-04-06 00:19:39+00:00)
Title: Add injection for custom views

This pull request is about injecting stuff in views in the same way as we do in activities and fragments.

I know this has been asked a lot and up to now, roboguice didn't support it directly. It was possible, mainly by calling manually `Roboguice.injectMembers` as mentioned [here](https://groups.google.com/forum/?fromgroups#!topic/roboguice/65U3m8ykT18).

Nevertheless, this technique could be improved and the same result could be achieved automatically in the following case :

* custom view is used inside an XML Layout, not programmatically.
* custom view inside a RoboActivity

In that case, which is the most common one, this pull request will inject everything annotated via Roboguice inside the custom view.

The main idea is to use the fact that activities are also view factories when XML inflation is used.

N.B : 1 I couldn't write a robolectric test using a xml layout inside roboguice tests.
N.B : 2 code has only been tested manually within astroboy

Sorry to have messed up configuration files (so don't take them), but I had to do it to achieve a proper eclipse configuration using maven android plugin.