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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ before_script:
- export TERM=dumb

script:
- mvn -f AndroidAnnotations/pom.xml install
- mvn -f AndroidAnnotations/pom.xml install -P travis
- mvn -f examples/maveneclipse/pom.xml install -Dandroidannotations.version=3.3-SNAPSHOT
- ./examples/gradle/gradlew build --build-file examples/gradle/build.gradle

Expand Down
17 changes: 17 additions & 0 deletions AndroidAnnotations/androidannotations-api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (C) 2010-2014 eBusiness Information, Excilys Group

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
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed To in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package org.androidannotations.annotations;

import android.text.Editable;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -25,8 +23,8 @@
/**
* <p>
* This annotation is intended to be used on methods to receive events defined
* by {@link android.text.TextWatcher#afterTextChanged(Editable s)} after the
* text is changed on the targeted TextView or subclass of TextView.
* by {@link android.text.TextWatcher#afterTextChanged(android.text.Editable s)}
* after the text is changed on the targeted TextView or subclass of TextView.
* </p>
* <p>
* The annotation value should be one or several R.id.* fields that refers to
Expand Down Expand Up @@ -76,8 +74,18 @@
@Target(ElementType.METHOD)
public @interface AfterTextChange {

/**
* The R.id.* fields which refer to the TextViews.
*
* @return the ids of the TextViews.
*/
int[] value() default ResId.DEFAULT_VALUE;

/**
* The resource names as a strings which refer to the TextViews.
*
* @return the resource names of the TextViews.
*/
String[] resName() default "";

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package org.androidannotations.annotations;

import android.app.Activity;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -25,7 +23,8 @@
/**
* <p>
* Methods annotated with @{@link AfterViews} will be called after
* {@link Activity#setContentView(int)} is called by the generated activity.
* {@link android.app.Activity#setContentView(int) setContentView(int)} is
* called by the generated activity.
* </p>
* <p>
* This occurs AFTER <code>setContentView(View)</code> which is called at the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledThreadPoolExecutor;

/**
* <p>
Expand All @@ -30,7 +28,9 @@
* The annotated method MUST return void and MAY contain parameters.
* </p>
* <p>
* The generated code is based on {@link org.androidannotations.api.BackgroundExecutor} methods.
* The generated code is based on
* {@link org.androidannotations.api.BackgroundExecutor BackgroundExecutor}
* methods.
* </p>
*
* <h2>Cancellation</h2>
Expand Down Expand Up @@ -66,20 +66,25 @@
* <b>Note</b>: Cancellation may or may not be successful. If the task wasn't
* executed yet, it will be removed from the pool. But it could fail if task has
* already completed, has already been cancelled, or could not be cancelled for
* some other reason. See {@link Future#cancel(boolean)} for more information.
* some other reason. See {@link java.util.concurrent.Future#cancel(boolean)
* Future#cancel(boolean)} for more information.
* </p>
*
* <h2>Execution flow</h2>
* <p>
* By default, all tasks will be put in a {@link ScheduledThreadPoolExecutor}
* with a core pool size of <code>2 * numberOfCpu</code>. Which means that
* background methods will be executed in <b>PARALLEL</b>. You can change this
* by calling <code>BackgroundExecutor.setExecutor(...)</code>.
* By default, all tasks will be put in a
* {@link java.util.concurrent.ScheduledThreadPoolExecutor
* ScheduledThreadPoolExecutor} with a core pool size of
* <code>2 * numberOfCpu</code>. Which means that background methods will be
* executed in <b>PARALLEL</b>. You can change this by calling
* <code>BackgroundExecutor.setExecutor(...)</code>.
* </p>
* <p>
* If you want execute ALL background methods SEQUENTIALLY, the best way is to
* change the executor of {@link org.androidannotations.api.BackgroundExecutor} to a
* {@link ScheduledThreadPoolExecutor} with a core pool size of <code>1</code>.
* change the executor of {@link org.androidannotations.api.BackgroundExecutor
* BackgroundExecutor} to a
* {@link java.util.concurrent.ScheduledThreadPoolExecutor
* ScheduledThreadPoolExecutor} with a core pool size of <code>1</code>.
* </p>
* <p>
* If you want execute some background methods SEQUENTIALLY, you should simply
Expand Down Expand Up @@ -146,6 +151,7 @@
* <b>Example</b> :
*
* <blockquote>
*
* <pre>
* &#064;EBean
* public class MyBean {
Expand Down Expand Up @@ -175,15 +181,15 @@
* boolean mayInterruptIfRunning = true;
* BackgroundExecutor.cancelAll(&quot;my_background_id&quot;, mayInterruptIfRunning);
* </pre>
*
* @return the identifier for task cancellation
*
* @return the task id for cancellation
**/
String id() default "";

/**
* Minimum delay, in milliseconds, before the background task is executed.
*
* @return the minimum delay before execution
* @return the delay of the execution
*/
int delay() default 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,11 @@
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
public @interface Bean {

/**
* The implementation class of the injected bean.
*
* @return the implementation class
*/
Class<?> value() default Void.class;
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,18 @@
@Target(ElementType.METHOD)
public @interface BeforeTextChange {

/**
* The R.id.* fields which refer to the TextViews.
*
* @return the ids of the TextViews.
*/
int[] value() default ResId.DEFAULT_VALUE;

/**
* The resource names as a strings which refer to the TextViews.
*
* @return the resource names of the TextViews.
*/
String[] resName() default "";

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,24 @@
*
* </blockquote>
*
* @author Rostislav Chekan
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface CheckedChange {

/**
* The R.id.* fields which refer to the CompoundButtons or subclasses of
* CompoundButton.
*
* @return the ids of the CompoundButtons
*/
int[] value() default ResId.DEFAULT_VALUE;

/**
* The resource names as strings which refer to the CompoundButtons or
* subclasses of CompoundButton.
*
* @return the resource names of the CompoundButtons
*/
String[] resName() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
* The method MAY have one parameter:
* </p>
* <ul>
* <li>A {@link android.view.View} parameter to know which view has been clicked</li>
* <li>A {@link android.view.View} parameter to know which view has been clicked
* </li>
* </ul>
* <blockquote>
*
Expand All @@ -61,8 +62,18 @@
@Target(ElementType.METHOD)
public @interface Click {

/**
* The R.id.* fields which refer to the Views.
*
* @return the ids of the Views
*/
int[] value() default ResId.DEFAULT_VALUE;

/**
* The resource names as strings which refer to the Views.
*
* @return the resource names of the Views
*/
String[] resName() default "";

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface CustomTitle {

/**
* R.layout.* field which refers the the title layout.
*
* @return the id of the layout
*/
int value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,18 @@
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface EActivity {

/**
* The R.layout.* field which refer to the layout.
*
* @return the id of the layout
*/
int value() default ResId.DEFAULT_VALUE;

/**
* The resource name as a string which refer to the layout.
*
* @return the resource name of the layout
*/
String resName() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
* Most annotations are supported in {@link EBean} classes, except the ones
* related to extras. Views related annotations will only work if the bean was
* injected in an activity with a layout containing the views you're dealing
* with. If your bean needs a {@link android.content.Context} you can inject on by
* using an {@link RootContext} annotated field.
* with. If your bean needs a {@link android.content.Context} you can inject on
* by using an {@link RootContext} annotated field.
* </p>
* <p>
* Beans have two possible scopes : default or singleton. Default scope should
Expand Down Expand Up @@ -91,10 +91,13 @@
@Target(ElementType.TYPE)
public @interface EBean {

/**
* The scope of an enhanced bean.
*/
public enum Scope {

/**
* A new instance of the bean is created each time it is needed
* A new instance of the bean is created each time it is needed.
*/
Default, //

Expand All @@ -105,6 +108,11 @@ public enum Scope {
Singleton, //
}

/**
* The scope of the enhanced bean.
*
* @return the scope of the bean.
*/
Scope scope() default Scope.Default;

}
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,19 @@
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface EFragment {

/**
* The R.layout.* field which refer to the layout.
*
* @return the id of the layout
*/
int value() default ResId.DEFAULT_VALUE;

/**
* The resource name as a string which refer to the layout.
*
* @return the resource name of the layout
*/
String resName() default "";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@
*/
package org.androidannotations.annotations;

import android.view.ViewGroup;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* <p>
* Should be used on {@link android.view.View} classes to enable usage of
* Should be used on {@link android.view.View View} classes to enable usage of
* AndroidAnnotations.
* </p>
* <p>
Expand Down Expand Up @@ -62,7 +60,7 @@
*
* @see AfterInject
* @see AfterViews
* @see ViewGroup
* @see android.view.ViewGroup
* @see <a
* href="http://developer.android.com/guide/topics/ui/custom-components.html"
* >How to build a custom component.</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,18 @@
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface EViewGroup {

/**
* The R.layout.* field which refer to the layout.
*
* @return the id of the layout
*/
int value() default ResId.DEFAULT_VALUE;

/**
* The resource name as a string which refer to the layout.
*
* @return the resource name of the layout
*/
String resName() default "";
}
Loading