Skip to content
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
Remove GreenDroid support
The library is deprecated since early 2013, so it is time to drop
support of it.
  • Loading branch information
WonderCsabo committed Aug 22, 2014
commit 2fa58f8eabc54f04d5142ddc65b2c06b933102e6

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,52 @@
*/
package org.androidannotations.holder;

import com.sun.codemodel.*;
import org.androidannotations.api.SdkVersionHelper;
import org.androidannotations.helper.*;
import org.androidannotations.process.ProcessHolder;
import static com.sun.codemodel.JExpr.FALSE;
import static com.sun.codemodel.JExpr.TRUE;
import static com.sun.codemodel.JExpr._new;
import static com.sun.codemodel.JExpr._null;
import static com.sun.codemodel.JExpr._super;
import static com.sun.codemodel.JExpr._this;
import static com.sun.codemodel.JExpr.cast;
import static com.sun.codemodel.JExpr.invoke;
import static com.sun.codemodel.JMod.PRIVATE;
import static com.sun.codemodel.JMod.PUBLIC;
import static org.androidannotations.helper.ModelConstants.GENERATION_SUFFIX;

import java.util.ArrayList;
import java.util.List;

import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.util.ElementFilter;
import java.util.ArrayList;
import java.util.List;

import static com.sun.codemodel.JExpr.*;
import static com.sun.codemodel.JMod.PRIVATE;
import static com.sun.codemodel.JMod.PUBLIC;
import org.androidannotations.api.SdkVersionHelper;
import org.androidannotations.helper.ActionBarSherlockHelper;
import org.androidannotations.helper.ActivityIntentBuilder;
import org.androidannotations.helper.AndroidManifest;
import org.androidannotations.helper.AnnotationHelper;
import org.androidannotations.helper.CanonicalNameConstants;
import org.androidannotations.helper.IntentBuilder;
import org.androidannotations.process.ProcessHolder;

import com.sun.codemodel.JBlock;
import com.sun.codemodel.JClass;
import com.sun.codemodel.JClassAlreadyExistsException;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JExpr;
import com.sun.codemodel.JExpression;
import com.sun.codemodel.JFieldVar;
import com.sun.codemodel.JInvocation;
import com.sun.codemodel.JMethod;
import com.sun.codemodel.JMod;
import com.sun.codemodel.JType;
import com.sun.codemodel.JVar;

public class EActivityHolder extends EComponentWithViewSupportHolder implements HasIntentBuilder, HasExtras, HasInstanceState, HasOptionsMenu, HasOnActivityResult, HasReceiverRegistration {

private GreenDroidHelper greenDroidHelper;
private ActivityIntentBuilder intentBuilder;
private JMethod onCreate;
private JMethod setIntent;
Expand Down Expand Up @@ -297,22 +321,15 @@ public JMethod getSetContentViewLayout() {
private void setSetContentView() {
getOnCreate();

String setContentViewMethodName;
if (usesGreenDroid()) {
setContentViewMethodName = "setActionBarContentView";
} else {
setContentViewMethodName = "setContentView";
}

JClass layoutParamsClass = classes().VIEW_GROUP_LAYOUT_PARAMS;

setContentViewLayout = setContentViewMethod(setContentViewMethodName, new JType[] { codeModel().INT }, new String[] { "layoutResID" });
setContentViewMethod(setContentViewMethodName, new JType[] { classes().VIEW, layoutParamsClass }, new String[] { "view", "params" });
setContentViewMethod(setContentViewMethodName, new JType[] { classes().VIEW }, new String[] { "view" });
setContentViewLayout = setContentViewMethod(new JType[] { codeModel().INT }, new String[] { "layoutResID" });
setContentViewMethod(new JType[] { classes().VIEW, layoutParamsClass }, new String[] { "view", "params" });
setContentViewMethod(new JType[] { classes().VIEW }, new String[] { "view" });
}

private JMethod setContentViewMethod(String setContentViewMethodName, JType[] paramTypes, String[] paramNames) {
JMethod method = generatedClass.method(JMod.PUBLIC, codeModel().VOID, setContentViewMethodName);
private JMethod setContentViewMethod(JType[] paramTypes, String[] paramNames) {
JMethod method = generatedClass.method(JMod.PUBLIC, codeModel().VOID, "setContentView");
method.annotate(Override.class);

ArrayList<JVar> params = new ArrayList<JVar>();
Expand All @@ -333,13 +350,6 @@ public JVar getInitSavedInstanceParam() {
return initSavedInstanceParam;
}

private boolean usesGreenDroid() {
if (greenDroidHelper == null) {
greenDroidHelper = new GreenDroidHelper(processingEnvironment());
}
return greenDroidHelper.usesGreenDroid(annotatedElement);
}

private void handleBackPressed() {
Element declaredOnBackPressedMethod = getOnBackPressedMethod(annotatedElement);
if (declaredOnBackPressedMethod != null) {
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion AndroidAnnotations/functional-test-1-5/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
<activity android:name="org.androidannotations.test15.rest.MyServiceActivity_" />
<activity android:name="org.androidannotations.test15.instancestate.SaveInstanceStateActivity_" />
<activity android:name="org.androidannotations.test15.afterinject.AfterInjectActivity_" />
<activity android:name="org.androidannotations.test15.greendroid.MyGreenDroidActivity_" />
<activity android:name="org.androidannotations.test15.nonconfiguration.NonConfigurationActivity_" />
<activity android:name="org.androidannotations.test15.sherlock.MySherlockActivity_" />
<activity android:name="org.androidannotations.test15.efragment.MyFragmentActivity_" />
Expand Down

This file was deleted.

This file was deleted.