declex icon indicating copy to clipboard operation
declex copied to clipboard

Add @Inflate annotation to improve automatic inflation of layouts

Open smaugho opened this issue 7 years ago • 0 comments

Right now, layouts can be inflated by the framework like this:

@Model
@Populator(R.layout.layout_to_inflate)
SomeModel_ model;

or

@Model
@Populator(R.layout.layout_to_inflate)
List<SomeModel_> model;

But this is hard to understand, and the use of the inflated layout it is limited in the activity.

The idea is to add a new annotation, for instance:

@Inflate
View layout_to_inflate;

This annotation will inflate the layout, and will add all it's views to the current viewsHolder, the inflation process would be executed with priority, and it should be available to annotaitons like ViewById and ViewsById, and all the Views Injections mechanism.

Also this mechanism it is easier to understand.

smaugho avatar Feb 20 '17 00:02 smaugho