@Retention(value=CLASS)
@Target(value=TYPE)
public @interface EViewGroup
Should be used on View
classes to enable usage of
AndroidAnnotations.
Your code related to injected beans should go in an AfterInject
annotated method.
Any view related code should happen in an AfterViews
annotated
method.
If the class is abstract, the enhanced view will not be generated. Otherwise, it will be generated as a final class. You can use AndroidAnnotations to create Abstract classes that handle common code.
The annotation value should be one of R.layout.* fields. If not set, no content view will be set, and you should inflate the layout yourself by calling View.inflate() method
Example :@EViewGroup(R.layout.component) public class CustomFrameLayout extends FrameLayout { @ViewById TextView titleView; @AfterViews void initViews() { titleView.setText("test"); } }
AfterInject
,
AfterViews
,
ViewById
,
View
,
How to build a custom component.Copyright © 2010-2014. All Rights Reserved.