Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (C) 2010-2016 eBusiness Information, Excilys Group
* Copyright (C) 2016 the AndroidAnnotations project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
Expand Down Expand Up @@ -73,4 +74,11 @@ void calledAfterViewInjection() {

}

@ViewById(R.id.my_text_view)
void methodView1(TextView methodView1) {
}

void methodView2(@ViewById(R.id.my_text_view) TextView methodView2) {
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (C) 2010-2016 eBusiness Information, Excilys Group
* Copyright (C) 2016 the AndroidAnnotations project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
Expand All @@ -19,6 +20,7 @@

import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.type.TypeMirror;

import org.androidannotations.AndroidAnnotationsEnvironment;
Expand Down Expand Up @@ -67,12 +69,17 @@ public void validate(Element element, ElementValidation validation) {
@Override
public void process(Element element, EComponentWithViewSupportHolder holder) {
injectHelper.process(element, holder);
if (holder instanceof EFragmentHolder) {
if (holder instanceof EFragmentHolder && isFieldInjection(element)) {
String fieldName = element.getSimpleName().toString();
((EFragmentHolder) holder).clearInjectedView(ref(fieldName));
}
}

private boolean isFieldInjection(Element element) {
Element enclosingElement = element.getEnclosingElement();
return !((element instanceof ExecutableElement) || (enclosingElement instanceof ExecutableElement));
}

@Override
public JBlock getInvocationBlock(EComponentWithViewSupportHolder holder) {
return holder.getOnViewChangedBodyInjectionBlock();
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.