Skip to content

Commit

Permalink
add readme, lisence
Browse files Browse the repository at this point in the history
  • Loading branch information
danikula committed Nov 2, 2011
1 parent e177b1f commit cf03bdf
Show file tree
Hide file tree
Showing 49 changed files with 824 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/com.danikula.aibolit-sample/bin/*
/com.danikula.aibolit-sample/gen/*
/com.danikula.aibolit-sample/.settings

/com.danikula.aibolit/.settings
110 changes: 110 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
Aibolit
=======

Simple lightweight dependency injection implementation for Android




Scope
=====
Injecting view by id
Injecing application resource: array adapter, drawable, string, animation, boolean, integer, dimension, array, color
Inflating layout
Injecting system services
Injecting custom application services




Usage
=====
Just put aibolit-*.jar in classpath




Example
=======
public class AibolitChatActivity extends Activity {

// annotate fields to be injected...

@InjectView(R.id.messageEditText)
private EditText messageEditText;

@InjectView(R.id.historyListView)
private ListView historyListView;

@InjectResource(R.string.symbols_count)
private String symbolsCountPattern;

@InjectSystemService(Context.NOTIFICATION_SERVICE)
private NotificationManager notificationManager;

@InjectService
private HttpManager httpManager;

@InjectResource(R.layout.content)
private View content;

...

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.chat_activity);
// initialize annotated fields and methods
Aibolit.doInjections(this);

// or just Aibolit.setInjectedContentView(this);

...
}

// annotate event handlers...

@InjectOnClickListener(R.id.sendButton)
private void onSendButtonClick(View v) {
// handle onClick event
}

@InjectOnClickListener(R.id.clearHistoryButton)
private void onClearHistoryButtonClick(View v) {
// handle onClick event
}

@InjectOnTextChangedListener(R.id.messageEditText)
public void onMessageTextChanged(CharSequence s, int start, int before, int count) {
// handle text changed event
}

...

}




Developed By
===========
Alexey Danilov - danikula@gmail.com



License
=======
Copyright (C) 2011 Alexey Danilov

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.
22 changes: 21 additions & 1 deletion com.danikula.aibolit/src/com/danikula/aibolit/Aibolit.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/

package com.danikula.aibolit;

import java.lang.annotation.Annotation;
Expand Down Expand Up @@ -40,7 +56,8 @@
* Class can inject:
* <ul>
* <li>Views annotated by {@link InjectView}</li>
* <li>Application resources (drawable, string, anim, layout, bool, dimen, integer, array, color) annotated by
* <li>Inflated layout annotated by {@link InjectResource}</li>
* <li>Application resources (drawable, string, animation, boolean, dimension, integer, array, color) annotated by
* {@link InjectResource}.</li>
* <li>ArrayAdapter annotated by {@link InjectArrayAdapter}</li>
* <li>System services annotated by {@link InjectSystemService}</li>
Expand Down Expand Up @@ -85,6 +102,9 @@
* &#064;InjectService
* private HttpManager httpManager;
*
* &#064;InjectResource(R.layout.content)
* private View content;
*
* ...
*
* &#064;Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit;

import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit;

import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit;

import java.lang.reflect.InvocationHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit;

/**
Expand Down
15 changes: 15 additions & 0 deletions com.danikula.aibolit/src/com/danikula/aibolit/Validate.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit;

import android.app.Activity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit.annotation;

import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit.annotation;

import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit.annotation;

import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit.annotation;

import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2011 Alexey Danilov
*
* 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.
*/
package com.danikula.aibolit.annotation;

import java.lang.annotation.ElementType;
Expand Down
Loading

0 comments on commit cf03bdf

Please sign in to comment.