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
Show all changes
40 commits
Select commit Hold shift + click to select a range
dce66fb
add InjectHelper
dodgex Sep 20, 2015
077e8d5
add compile time test for InjectHelper
dodgex Oct 11, 2015
9772deb
allow to inject @EBean's into an @Bean annotated method
dodgex Sep 20, 2015
3068d53
add test for method injected beans
dodgex Sep 20, 2015
5169a33
allow to inject system services into @SystemServices annotated methods
dodgex Dec 16, 2015
d22b612
add test for method injected system services
dodgex Sep 20, 2015
dc0a2ca
allow to inject resources into @*Res annotated method
dodgex Sep 24, 2015
fca69f6
add test for method injected resources
dodgex Sep 24, 2015
0dd6534
allow to inject shared preferences into @Pref annotated method
dodgex Sep 24, 2015
d91e71d
add test for method injected shared preferences
dodgex Sep 24, 2015
2137099
allow to inject application class into @App annotated method
dodgex Sep 25, 2015
81e5da4
add test for method injected application class
dodgex Sep 25, 2015
a97b8ad
allow to inject https client into @HttpsClient annotated method
dodgex Sep 25, 2015
73b994d
add test for method injected https clients
dodgex Sep 25, 2015
4801b0d
allow to inject extras into @Extra annotated method
dodgex Sep 26, 2015
4d9d2fc
add test for method injected extras
dodgex Sep 26, 2015
804bff7
allow to inject fragment arguments into @FragmentArg annotated method
dodgex Sep 26, 2015
bd8f4c1
add test for method injected fragment args
dodgex Sep 26, 2015
dc0c5f7
allow to inject context into @RootContext annotated method
dodgex Sep 26, 2015
dfec37e
add test for method injected context
dodgex Sep 26, 2015
6c2765d
allow to inject menu into @InjectMenu annotated method
dodgex Sep 26, 2015
a7affe7
add test for method injected menus
dodgex Sep 26, 2015
85197fd
allow to inject menu items into @OptionsMenuItem annotated method
dodgex Sep 26, 2015
8813c6b
add test for method injected menu items
dodgex Sep 26, 2015
63343c7
allow to inject fragments into @FragmentById or @FragmentByTag annota…
dodgex Sep 26, 2015
9d796cd
add test for method injected fragments
dodgex Sep 26, 2015
cade871
allow to inject views into @ViewById annotated methods
dodgex Oct 11, 2015
bbda8a1
add test for method injected views
dodgex Oct 11, 2015
161f128
allow to inject lists of views into @ViewsById annotated methods
dodgex Oct 11, 2015
4e1ba9d
add test for method injected lists of views
dodgex Oct 11, 2015
27ea853
allow to inject preferences into @PreferenceByKey annotated methods
dodgex Oct 11, 2015
9121bfc
add test for method injected preferences
dodgex Oct 11, 2015
7d0c59e
allow to inject ormlite daos into @OrmLiteDao annotated methods
dodgex Oct 11, 2015
a3256f4
add test for method injected ormlite daos
dodgex Dec 18, 2015
40b6f7d
allow to inject rest service into @RestService annotated methods
dodgex Oct 11, 2015
4396b44
add test for method injected rest services
dodgex Dec 18, 2015
c7d182d
update javadocs for method injection
dodgex Dec 14, 2015
a2f3bfd
generate only one method in Fragment-/IntentBuilder for methods with …
dodgex Dec 20, 2015
1c2575c
use the view field for FoundViewHolder
dodgex Dec 20, 2015
03bf6bb
use the preference field for FoundPreferenceHolder
dodgex Dec 20, 2015
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
Expand Up @@ -42,6 +42,12 @@
*
* @App
* MyApplication myApp;
*
* @App
* void methodInjection(MyApplication app) {
* // do stuff
* }
*
* }
* </pre>
*
Expand All @@ -50,6 +56,6 @@
* @see EApplication
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface App {
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@
* &#064;Bean(MyBean2.class)
* MyBean myBean2;
*
* &#064;Bean
* void singleInjection(MyBean bean) {
* // do stuff
* }
*
* &#064;Bean(MyBean2.class)
* void singleInjection2(MyBean bean) {
* // do stuff
* }
*
* void multiInjection(&#064;Bean MyBean bean1, &#064;Bean MyBean bean2) {
* // do stuff
* }
*
* void multiInjection2(&#064;Bean(MyBean2.class) MyBean bean1, &#064;Bean(MyBean2.class) MyBean bean2) {
* // do stuff
* }
*
* }
*
* &#064;EBean
Expand All @@ -58,7 +76,7 @@
* @see EBean
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface Bean {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
* <p>
* Use on any native, {@link android.os.Parcelable Parcelable} or
* {@link java.io.Serializable Serializable} field in an {@link EActivity}
* annotated class to bind it with Android's arguments.
* If <a href="http://parceler.org">Parceler</a> is on the classpath, extras
* annotated class to bind it with Android's arguments. If
* <a href="http://parceler.org">Parceler</a> is on the classpath, extras
* annotated with &#064;Parcel, or collections supported by Parceler will be
* automatically marshaled using a {@link android.os.Parcelable Parcelable}
* through the Parcels utility class.
* </p>
* <p>
* The annotation value is the key used for extra. If not set, the field name
* will be used as the key.
* The annotation value is the key used for extra. If not set, the field or
* method name will be used as the key.
* </p>
* <p>
* When {@link Extra} is used, the intent builder will hold dedicated methods
Expand Down Expand Up @@ -68,6 +68,15 @@
* &#064;Extra
* String myMessage;
*
* &#064;Extra
* void singleInjection(String myMessage) {
* // do stuff
* }
*
* void multiInjection(&#064;Extra String myMessage, &#064;Extra String myMessage2) {
* // do stuff
* }
*
* &#064;AfterInject
* void init() {
* Log.d(&quot;AA&quot;, &quot;extra myMessage = &quot; + myMessage);
Expand All @@ -81,7 +90,7 @@
* @see EActivity
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface Extra {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
* <p>
* Use on any native, {@link android.os.Parcelable Parcelable} or
* {@link java.io.Serializable Serializable} field in an {@link EFragment}
* annotated class to bind it with Android's arguments.
* If <a href="http://parceler.org">Parceler</a> is on the classpath, extras
* annotated class to bind it with Android's arguments. If
* <a href="http://parceler.org">Parceler</a> is on the classpath, extras
* annotated with &#064;Parcel, or collections supported by Parceler will be
* automatically marshaled using a {@link android.os.Parcelable Parcelable}
* through the Parcels utility class.
* </p>
* <p>
* The annotation value is the key used for argument. If not set, the field name
* will be used as the key.
* The annotation value is the key used for argument. If not set, the field or
* method name will be used as the key.
* </p>
* <p>
* When {@link FragmentArg} is used, the intent builder will hold dedicated
Expand All @@ -52,6 +52,15 @@
*
* &#064;FragmentArg
* String myMessage;
*
* &#064;FragmentArg
* void singleInjection(String myMessage) {
* // do stuff
* }
*
* void multiInjection(&#064;FragmentArg String myMessage, &#064;FragmentArg String myMessage2) {
* // do stuff
* }
* }
*
* &#064;EActivity
Expand All @@ -73,7 +82,7 @@
* @see FragmentByTag
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface FragmentArg {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@

/**
* <p>
* Use it on android.app.Fragment or android.support.v4.app.Fragment fields in
* activity classes to retrieve and inject a fragment.
* Use it on android.app.Fragment or android.support.v4.app.Fragment fields or
* methods with applicable parameters in activity classes to retrieve and inject
* a fragment.
* </p>
* <p>
* The annotation value should be one of R.id.* fields. If not set, the field
* name will be used as the R.id.* field name.
* The annotation value should be one of R.id.* fields. If not set, the field or
* method name will be used as the R.id.* field name.
* </p>
* <p>
* <b>Note:</b> This can only inject an existing fragment, not create them.
Expand Down Expand Up @@ -59,6 +60,15 @@
*
* &#064;FragmentById(R.id.<b>myFragment</b>)
* public MyFragment myFragment2;
*
* &#064;FragmentById
* void singleInjection(MyFragment myFragment) {
* // do stuff
* }
*
* void multiInjection(&#064;FragmentById MyFragment myFragment, &#064;FragmentById(R.id.<b>myFragment</b>) MyFragment myFragment2) {
* // do stuff
* }
* }
* </pre>
*
Expand Down Expand Up @@ -106,7 +116,7 @@
* @see FragmentByTag
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface FragmentById {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@

/**
* <p>
* Use it on android.app.Fragment or android.support.v4.app.Fragment fields in
* activity classes to retrieve and inject a fragment.
* Use it on android.app.Fragment or android.support.v4.app.Fragment fields or
* methods with applicable parameters in activity classes to retrieve and inject
* a fragment.
* </p>
* <p>
* The annotation value should be one of fragment tag. If not set, the field
* name will be used as the tag name.
* The annotation value should be one of fragment tag. If not set, the field or
* method name will be used as the tag name.
* </p>
* <p>
* <b>Note:</b> This can only inject an existing fragment, not create them.
Expand Down Expand Up @@ -60,6 +61,15 @@
*
* &#064;FragmentByTag(<b>"myFragmentTag"</b>)
* public MyFragment myFragmentTag2;
*
* &#064;FragmentByTag
* void singleInjection(MyFragment myFragmentTag) {
* // do stuff
* }
*
* void multiInjection(&#064;FragmentByTag MyFragment myFragmentTag, &#064;FragmentById("myFragmentTag") MyFragment myFragment2) {
* // do stuff
* }
* }
* </pre>
*
Expand Down Expand Up @@ -108,7 +118,7 @@
* @see FragmentById
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface FragmentByTag {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
* </blockquote>
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface HttpsClient {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* inject the menu.
* </p>
* <p>
* The field MUST be of type {@link android.view.Menu}.
* The field or method parameter MUST be of type {@link android.view.Menu}.
* </p>
*
* <blockquote>
Expand All @@ -39,13 +39,18 @@
*
* &#064;InjectMenu
* Menu menu;
*
* &#064;InjectMenu
* void methodInjection(Menu menu) {
* // do stuff
* }
*
* }
* </pre>
*
* </blockquote>
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface InjectMenu {
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* activity classes to inject a menu item.
* </p>
* <p>
* The field MUST be of type {@link android.view.MenuItem}
* The field or method parameter MUST be of type {@link android.view.MenuItem}
* </p>
* <p>
* The annotation value should be one or several of R.id.* fields. If not set,
Expand All @@ -47,13 +47,22 @@
*
* &#064;OptionsMenuItem(R.id.menu_search)
* MenuItem menuItemSearch;
*
* &#064;OptionsMenuItem
* void singleInjection(MenuItem menuRefresh) {
* // do stuff
* }
*
* void multiInjection(&#064;OptionsMenuItem MenuItem menuRefresh, &#064;OptionsMenuItem(R.id.menu_search) MenuItem menuItemSearch) {
* // do stuff
* }
* }
* </pre>
*
* </blockquote>
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface OptionsMenuItem {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Use it on a {@link android.preference.Preference Preference} or
* {@link android.preference.Preference Preference} subtype or
* <code>android.support.v7.preference.Preference</code> or
* <code>android.support.v7.preference.Preference</code> subtype fields in a
* <code>android.support.v7.preference.Preference</code> subtype fields or methods with applicable parameters in a
* {@link org.androidannotations.annotations.EActivity EActivity} or
* {@link org.androidannotations.annotations.EFragment EFragment} annotated
* class, which is a subclass of {@link android.preference.PreferenceActivity
Expand Down Expand Up @@ -53,6 +53,15 @@
* &#064;PreferenceByKey(R.string.checkBoxPref)
* CheckBoxPreference checkBoxPref;
*
* &#064;PreferenceByKey
* void singleInjection(Preference myPreference1) {
* // do stuff
* }
*
* void multiInjection(&#064;PreferenceByKey Preference myPreference1, &#064;PreferenceByKey(R.string.checkBoxPref) CheckBoxPreference checkBoxPref) {
* // do stuff
* }
*
* &#064;AfterPreferences
* void initPrefs() {
* checkBoxPref.setChecked(false);
Expand All @@ -65,7 +74,7 @@
* @see org.androidannotations.annotations.AfterPreferences AfterPreferences
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface PreferenceByKey {

int value() default ResId.DEFAULT_VALUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,21 @@
* // Only injected if the root context is an instance of MyActivity
* &#064;RootContext
* MyActivity myActivity;
*
* &#064;RootContext
* void singleInjection(Context context) {
* // do stuff
* }
*
* void multiInjection(&#064;RootContext Context context, &#064;RootContext Activity activity) {
* // do stuff
* }
* }
* </pre>
*
* </blockquote>
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface RootContext {
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,25 @@
*
* &#064;SystemService
* AlarmManager alarmManager;
*
* &#064;SystemService
* void singleInjection(NotificationManager notificationManager) {
* // do stuff
* }
*
* void multiInjection(&#064;SystemService NotificationManager notificationManager, &#064;SystemService AlarmManager alarmManager) {
* // do stuff
* }
* }
* </pre>
*
* </blockquote>
*
* @see <a
* href="https://developer.android.com/reference/android/content/Context.html#getSystemService%28java.lang.String%29"
* @see <a href=
* "https://developer.android.com/reference/android/content/Context.html#getSystemService%28java.lang.String%29"
* >List of SystemService managers</a>
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD)
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
public @interface SystemService {
}
Loading