@Retention(value=CLASS) @Target(value=FIELD) public @interface ViewsById
Use it on a List of View or
View subtype fields in a view related (ie
EActivity,
EFragment,
EViewGroup, ...) annotated class.
The annotation value should be an array of R.id.* fields.
Your code related to injected views should go in an
AfterViews annotated method.
Example :
@EActivity(R.layout.main)
public class MyActivity extends Activity {
// Injects R.id.edit1 and R.id.edit2 into the List.
@ViewsById({ R.id.edit1, R.id.edit2 })
List<EditText> myEditTexts;
@ViewsById({ R.id.myTextView1, R.id.myOtherTextView })
List<TextView> textViews;
@AfterViews
void updateTextWithDate() {
for (TextView textView : textViews) {
textView.setText("Date: " + new Date());
}
}
}
AfterViewspublic abstract int[] value
public abstract String[] resName
Copyright © 2010-2015. All Rights Reserved.