Skip to content

Commit dff7a68

Browse files
committed
Update EditorAction's doc
1 parent 935929c commit dff7a68

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

  • AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,53 @@
3232
* name will be used as the R.id.* field name.
3333
*
3434
*/
35+
36+
/**
37+
* This annotation is intended to be used on methods to receive events defined
38+
* by
39+
* {@link android.widget.TextView.OnEditorActionListener#onEditorAction(android.widget.TextView, int, android.view.KeyEvent)}
40+
* when an action is performed on the editor.
41+
* <p/>
42+
* The annotation value should be one or several R.id.* fields that refers to
43+
* TextView or subclasses of TextView. If not set, the method name will be used
44+
* as the R.id.* field name.
45+
* <p/>
46+
* The method MAY have multiple parameter :
47+
* <ul>
48+
* <li>A {@link android.widget.TextView} parameter to know which view has
49+
* targeted this event
50+
* <li>An int parameter to get the actionId
51+
* <li>A {@link android.view.KeyEvent} parameter
52+
* </ul>
53+
* <p/>
54+
* <blockquote>
55+
*
56+
* Examples :
57+
*
58+
* <pre>
59+
* &#064;EditorAction(<b>R.id.helloTextView</b>)
60+
* void onEditorActionsOnHelloTextView(TextView hello, int actionId, KeyEvent keyEvent) {
61+
* // Something Here
62+
* }
63+
*
64+
* &#064;EditorAction
65+
* void <b>helloTextView</b>EditorAction(TextView hello) {
66+
* // Something Here
67+
* }
68+
*
69+
* &#064;EditorAction(<b>{R.id.editText, R.id.helloTextView}</b>)
70+
* void onEditorActionsOnSomeTextViews(TextView tv, int actionId) {
71+
* // Something Here
72+
* }
73+
*
74+
* &#064;EditorAction(<b>R.id.helloTextView</b>)
75+
* void onEditorActionsOnHelloTextView() {
76+
* // Something Here
77+
* }
78+
* </pre>
79+
*
80+
* </blockquote>
81+
*/
3582
@Retention(RetentionPolicy.CLASS)
3683
@Target(ElementType.METHOD)
3784
public @interface EditorAction {

0 commit comments

Comments
 (0)