Skip to content

Commit f8e9fba

Browse files
committed
Merge branch 'develop' into 796_Result_annotation
Conflicts: AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/holder/EActivityHolder.java AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/holder/EFragmentHolder.java AndroidAnnotations/functional-test-1-5/src/main/java/org/androidannotations/test15/AwaitingResultFragment.java
2 parents 0dd1eae + 421fa7b commit f8e9fba

240 files changed

Lines changed: 4318 additions & 1710 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
language: android
2+
jdk:
3+
- oraclejdk8
4+
- oraclejdk7
25
android:
36
components:
4-
- build-tools-19.1
57
- android-14
8+
- build-tools-20.0.0
9+
licenses:
10+
- android-sdk-license-5be876d5
11+
before_script:
12+
- export TERM=dumb
613
script:
714
- mvn -f AndroidAnnotations/pom.xml install
8-
- mvn -f examples/maveneclipse/pom.xml install
15+
- mvn -f examples/maveneclipse/pom.xml install -Dandroidannotations.version=3.2-SNAPSHOT
16+
- ./examples/gradle/gradlew build --build-file examples/gradle/build.gradle

AndroidAnnotations/androidannotations-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>androidannotations-parent</artifactId>
77
<groupId>org.androidannotations</groupId>
8-
<version>3.1-SNAPSHOT</version>
8+
<version>3.2-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>androidannotations-api</artifactId>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* Copyright (C) 2010-2014 eBusiness Information, Excilys Group
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed To in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package org.androidannotations.annotations;
17+
18+
import java.lang.annotation.ElementType;
19+
import java.lang.annotation.Retention;
20+
import java.lang.annotation.RetentionPolicy;
21+
import java.lang.annotation.Target;
22+
23+
/**
24+
* Methods annotated with @{@link AfterExtras} will be called after the Extras
25+
* from an Intent have been injected.
26+
*
27+
* Any code depending on injected extras should be done in an
28+
* {@link AfterExtras} annotated method.
29+
*
30+
* The method must have zero parameters.
31+
*
32+
* There may be several methods annotated with @{@link AfterExtras} in the same
33+
* class.
34+
*
35+
* <blockquote>
36+
*
37+
* Example :
38+
*
39+
* <pre>
40+
* &#064;EActivity(R.layout.main)
41+
* public class MyActivity extends Activity {
42+
*
43+
* &#064;Extra
44+
* String myExtra;
45+
*
46+
* &#064;AfterExtras
47+
* void afterExtras() {
48+
* // myExtra is now available
49+
* }
50+
* }
51+
* </pre>
52+
*
53+
* </blockquote>
54+
*/
55+
@Retention(RetentionPolicy.CLASS)
56+
@Target(ElementType.METHOD)
57+
public @interface AfterExtras {
58+
}

AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/EditorAction.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@
4141
* <li>An int parameter to get the actionId</li>
4242
* <li>A {@link android.view.KeyEvent} parameter</li>
4343
* </ul>
44-
*
44+
* <p>
45+
* The return type of the method can be either <b>void</b> or <b>boolean</b>. In
46+
* case of <b>boolean</b>, the value returned from the annotated method will be
47+
* returned in the generated listener method (indicating event consumption). If
48+
* the annotated method is <b>void</b>, always <b>true</b> will be returned in
49+
* the listener method (so the event is consumed).
50+
* </p>
4551
* <blockquote>
4652
*
4753
* Examples :
@@ -66,6 +72,12 @@
6672
* void onEditorActionsOnHelloTextView() {
6773
* // Something Here
6874
* }
75+
*
76+
* &#064;EditorAction(R.id.helloTextView)
77+
* <b>boolean</b> onEditorActionsOnHelloTextView() {
78+
* // Something Here
79+
* <b>return false;</b>
80+
* }
6981
* </pre>
7082
*
7183
* </blockquote>

AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/IgnoredWhenDetached.java

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,46 @@
2121
import java.lang.annotation.Target;
2222

2323
/**
24-
* When used standalone in an {@link EFragment} or in conjunction with the {@link UiThread}
25-
* or {@link Background} annotations, the annotated method will be wrapped in an 'if attached'
26-
* block such that no code will be executed if the {@link EFragment} is no longer bound to
27-
* its parent activity.
28-
* <p/>
24+
* <p>
25+
* When used standalone in an {@link EFragment} or in conjunction with the
26+
* {@link UiThread} or {@link Background} annotations, the annotated method will
27+
* be wrapped in an 'if attached' block such that no code will be executed if
28+
* the {@link EFragment} is no longer bound to its parent activity.
29+
* </p>
30+
* <p>
2931
* Should be used on method that must meet the following criteria
30-
* <p/>
31-
* 1) Can only be used in conjunction with classes annotated with {@link EFragment}
32-
* <p/>
32+
* </p>
33+
* <p>
34+
* 1) Can only be used in conjunction with classes annotated with
35+
* {@link EFragment}
36+
* </p>
37+
* <p>
3338
* 2) The annotated method MUST return void and MAY contain parameters.
39+
* </p>
40+
*
41+
* <blockquote> <b>Example</b> :
42+
*
43+
* <pre>
44+
* &#064;EFragment
45+
* public class LoaderFragment extends Fragment {
46+
*
47+
* ...
48+
*
49+
* &#064;UiThread
50+
* &#064;IgnoredWhenDetached
51+
* void killActivity() {
52+
* getActivity().finish();
53+
* }
54+
*
55+
*
56+
* &#064;IgnoredWhenDetached
57+
* void updateTitle(String title) {
58+
* getActivity().setTitle(title);
59+
* }
60+
* }
61+
* </pre>
62+
*
63+
* </blockquote>
3464
*
3565
* @see org.androidannotations.annotations.EFragment
3666
* @see org.androidannotations.annotations.UiThread

AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/NonConfigurationInstance.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,25 @@
4242
* This caution doesn't apply to beans annotated with {@link Bean}, because
4343
* AndroidAnnotations automatically takes care of rebinding their context.
4444
* </p>
45+
*
46+
* <blockquote>
47+
*
48+
* Example :
49+
*
50+
* <pre>
51+
* &#064;EActivity(R.layout.main)
52+
* public class MyActivity extends Activity {
53+
*
54+
* &#064;NonConfigurationInstance
55+
* Bitmap someBitmap;
56+
*
57+
* &#064;NonConfigurationInstance
58+
* &#064;Bean
59+
* MyBackgroundTask myBackgroundTask;
60+
* }
61+
* </pre>
62+
*
63+
* </blockquote>
4564
*/
4665
@Retention(RetentionPolicy.CLASS)
4766
@Target(ElementType.FIELD)

AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/OrmLiteDao.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
Class<?> helper();
6464

65-
Class<?> model();
65+
@Deprecated
66+
Class<?> model() default Void.class;
6667

6768
}

AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/Receiver.java

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,45 @@
1515
*/
1616
package org.androidannotations.annotations;
1717

18-
1918
import java.lang.annotation.ElementType;
2019
import java.lang.annotation.Retention;
2120
import java.lang.annotation.RetentionPolicy;
2221
import java.lang.annotation.Target;
2322

2423
/**
2524
* <p>
26-
* This annotation is intended to be used on methods of an {@link EActivity}, {@link EFragment} or {@link EService}.
27-
* When this annotation is used, a {@link android.content.BroadcastReceiver}
28-
* will be created to receive the Intent corresponding to the given actions
29-
* and it will call the annotated method.
25+
* This annotation is intended to be used on methods of an {@link EActivity},
26+
* {@link EFragment} or {@link EService}. When this annotation is used, a
27+
* {@link android.content.BroadcastReceiver} will be created to receive the
28+
* Intent corresponding to the given actions and it will call the annotated
29+
* method.
3030
* </p>
3131
* <p>
3232
* The annotated method MUST return void and MAY have one parameter:
3333
* </p>
3434
* <ul>
35-
* <li>An {@link android.content.Intent}</li>
35+
* <li>An {@link android.content.Intent}</li>
3636
* </ul>
3737
* <p>
38-
* The annotation has three parameters:
38+
* The annotation has four parameters:
3939
* </p>
4040
* <ul>
41-
* <li>
42-
* {@link #actions()}: One or several {@link java.lang.String} indicating the actions which will spark the method.
43-
* This parameter is MANDATORY
44-
* </li>
45-
* <li>
46-
* {@link #registerAt()}: The moment when the {@link android.content.BroadcastReceiver}
47-
* will be registered and unregistered. By default : OnCreate/OnDestroy.
48-
* The available values depend on the enclosing enhanced component.
49-
*
50-
* </li>
51-
* <li>
52-
* {@link #local()}: Specify whether android.support.v4.content.LocalBroadcastManager should be used.
53-
* To use android.support.v4.content.LocalBroadcastManager, you MUST have android support-v4 in your classpath.
54-
* Default value is false.
55-
* </li>
41+
* <li>
42+
* {@link #actions()}: One or several {@link java.lang.String} indicating the
43+
* actions which will spark the method. This parameter is MANDATORY</li>
44+
* <li>
45+
* {@link #dataSchemes()}: One or several {@link java.lang.String} indicating
46+
* the data schemes which should be handled.</li>
47+
* <li>
48+
* {@link #registerAt()}: The moment when the
49+
* {@link android.content.BroadcastReceiver} will be registered and
50+
* unregistered. By default : OnCreate/OnDestroy. The available values depend on
51+
* the enclosing enhanced component.</li>
52+
* <li>
53+
* {@link #local()}: Specify whether
54+
* android.support.v4.content.LocalBroadcastManager should be used. To use
55+
* android.support.v4.content.LocalBroadcastManager, you MUST have android
56+
* support-v4 in your classpath. Default value is false.</li>
5657
* </ul>
5758
*
5859
* <blockquote>
@@ -62,13 +63,19 @@
6263
* <pre>
6364
* &#064;EActivity
6465
* public class MyActivity {
65-
*
66-
* &#064;Receiver(actions={{@link android.net.wifi.WifiManager#WIFI_STATE_CHANGED_ACTION}})
66+
*
67+
* &#064;Receiver(actions = {@link android.net.wifi.WifiManager#WIFI_STATE_CHANGED_ACTION})
6768
* public void onWifiStateChanged(Intent intent);
68-
*
69-
* &#064;Receiver(actions={{@link android.net.wifi.WifiManager#WIFI_STATE_CHANGED_ACTION}}, registerAt=RegisterAt.OnResumeOnPause}
69+
*
70+
* &#064;Receiver(actions = {@link android.net.wifi.WifiManager#WIFI_STATE_CHANGED_ACTION}, registerAt = RegisterAt.OnResumeOnPause)
7071
* public void onWifiStateChangedWithoutIntent();
71-
*
72+
*
73+
* &#064;Receiver(actions = {@link android.content.Intent#ACTION_VIEW}, dataSchemes = "http")
74+
* public void onHttpUrlOpened(Intent intent);
75+
*
76+
* &#064;Receiver(actions = {@link android.content.Intent#ACTION_VIEW}, dataSchemes = {"http", "https"})
77+
* public void onHttpOrHttpsUrlOpened(Intent intent);
78+
*
7279
* }
7380
* </pre>
7481
*
@@ -81,14 +88,13 @@
8188

8289
String[] actions();
8390

91+
String[] dataSchemes() default {};
92+
8493
RegisterAt registerAt() default RegisterAt.OnCreateOnDestroy;
8594

8695
boolean local() default false;
8796

8897
public enum RegisterAt {
89-
OnCreateOnDestroy,
90-
OnStartOnStop,
91-
OnResumeOnPause,
92-
OnAttachOnDetach
98+
OnCreateOnDestroy, OnStartOnStop, OnResumeOnPause, OnAttachOnDetach
9399
}
94100
}

0 commit comments

Comments
 (0)