use of com.helger.jcodemodel.JVar in project androidannotations by androidannotations.
the class EFragmentHolder method setOnCreateView.
private void setOnCreateView() {
JMethod onCreateView = generatedClass.method(PUBLIC, getClasses().VIEW, "onCreateView");
onCreateView.annotate(Override.class);
inflater = onCreateView.param(getClasses().LAYOUT_INFLATER, "inflater");
container = onCreateView.param(getClasses().VIEW_GROUP, "container");
JVar savedInstanceState = onCreateView.param(getClasses().BUNDLE, "savedInstanceState");
boolean forceInjection = getAnnotatedElement().getAnnotation(EFragment.class).forceLayoutInjection();
JBlock body = onCreateView.body();
if (!forceInjection) {
body.assign(contentView, _super().invoke(onCreateView).arg(inflater).arg(container).arg(savedInstanceState));
}
setContentViewBlock = body.blockSimple();
body._return(contentView);
}
use of com.helger.jcodemodel.JVar in project androidannotations by androidannotations.
the class EFragmentHolder method setOnViewCreated.
private void setOnViewCreated() {
JMethod onViewCreated = generatedClass.method(PUBLIC, getCodeModel().VOID, "onViewCreated");
onViewCreated.annotate(Override.class);
JVar view = onViewCreated.param(getClasses().VIEW, "view");
JVar savedInstanceState = onViewCreated.param(getClasses().BUNDLE, "savedInstanceState");
JBlock onViewCreatedBody = onViewCreated.body();
onViewCreatedBody.invoke(_super(), onViewCreated).arg(view).arg(savedInstanceState);
viewNotifierHelper.invokeViewChanged(onViewCreatedBody);
}
use of com.helger.jcodemodel.JVar in project androidannotations by androidannotations.
the class EFragmentHolder method setOnCreate.
private void setOnCreate() {
JMethod onCreate = generatedClass.method(PUBLIC, getCodeModel().VOID, "onCreate");
onCreate.annotate(Override.class);
JVar onCreateSavedInstanceState = onCreate.param(getClasses().BUNDLE, "savedInstanceState");
JBlock onCreateBody = onCreate.body();
JVar previousNotifier = viewNotifierHelper.replacePreviousNotifier(onCreateBody);
setFindViewById();
onCreateBody.invoke(getInit()).arg(onCreateSavedInstanceState);
onCreateBody.invoke(_super(), onCreate).arg(onCreateSavedInstanceState);
onCreateAfterSuperBlock = onCreateBody.blockSimple();
viewNotifierHelper.resetPreviousNotifier(onCreateBody, previousNotifier);
}
use of com.helger.jcodemodel.JVar in project androidannotations by androidannotations.
the class EFragmentHolder method setFindViewById.
private void setFindViewById() {
JMethod findViewById = generatedClass.method(PUBLIC, getClasses().VIEW, "findViewById");
findViewById.annotate(Override.class);
JVar idParam = findViewById.param(getCodeModel().INT, "id");
JBlock body = findViewById.body();
JFieldVar contentView = getContentView();
//
body._if(contentView.eq(_null()))._then()._return(_null());
body._return(contentView.invoke(findViewById).arg(idParam));
}
use of com.helger.jcodemodel.JVar in project androidannotations by androidannotations.
the class EActivityHolder method setFindSupportFragmentByTag.
@Override
protected void setFindSupportFragmentByTag() {
JMethod method = generatedClass.method(PRIVATE, getClasses().SUPPORT_V4_FRAGMENT, "findSupportFragmentByTag");
JVar tagParam = method.param(getClasses().STRING, "tag");
JBlock body = method.body();
body._return(invoke("getSupportFragmentManager").invoke("findFragmentByTag").arg(tagParam));
findSupportFragmentByTag = method;
}
Aggregations