File tree Expand file tree Collapse file tree
HelloWorldEclipse/src/com/googlecode/androidannotations/helloworldeclipse
RoboGuiceExample/res/layout
src/main/java/com/googlecode/androidannotations/gradle/activity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,16 +19,16 @@ public class ActivityWithExtra extends Activity {
1919
2020 @ ViewById
2121 TextView extraTextView ;
22-
22+
2323 @ Extra (MY_STRING_EXTRA )
2424 String myMessage ;
25-
25+
2626 @ Extra (MY_DATE_EXTRA )
2727 Date myDate ;
28-
28+
2929 @ Extra ("unboundExtra" )
3030 String unboundExtra = "unboundExtraDefaultValue" ;
31-
31+
3232 /**
3333 * The logs will output a classcast exception, but the program flow won't be interrupted
3434 */
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<LinearLayout xmlns : android =" http://schemas.android.com/apk/res/android"
3- android : orientation =" vertical"
43 android : layout_width =" fill_parent"
54 android : layout_height =" fill_parent"
6- >
7- <EditText
8- android : id =" @+id/edit"
9- android : layout_width =" fill_parent"
10- android : layout_height =" wrap_content"
11- android : hint =" Enter your name"
12- />
13- <Button
14- android : id =" @+id/button"
15- android : layout_width =" fill_parent"
16- android : layout_height =" wrap_content"
17- android : text =" Greet me!"
18- />
19- </LinearLayout >
5+ android : orientation =" vertical" >
6+
7+ <EditText
8+ android : id =" @+id/edit"
9+ android : layout_width =" fill_parent"
10+ android : layout_height =" wrap_content"
11+ android : hint =" Enter your name" />
12+
13+ <Button
14+ android : id =" @+id/button"
15+ android : layout_width =" fill_parent"
16+ android : layout_height =" wrap_content"
17+ android : text =" Greet me!" />
18+
19+ </LinearLayout >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<LinearLayout xmlns : android =" http://schemas.android.com/apk/res/android"
3- android : orientation =" vertical"
4- android : layout_width =" fill_parent"
5- android : layout_height =" fill_parent" >
6- <TextView android : id =" @+id/helloTextView"
7- android : layout_width =" fill_parent"
8- android : layout_height =" wrap_content" />
9- </LinearLayout >
3+ android : layout_width =" fill_parent"
4+ android : layout_height =" fill_parent"
5+ android : orientation =" vertical" >
6+
7+ <TextView
8+ android : id =" @+id/helloTextView"
9+ android : layout_width =" fill_parent"
10+ android : layout_height =" wrap_content" />
11+
12+ </LinearLayout >
Original file line number Diff line number Diff line change 22
33import java .util .Date ;
44
5+ import org .androidannotations .annotations .AfterViews ;
6+ import org .androidannotations .annotations .EActivity ;
7+ import org .androidannotations .annotations .ViewById ;
8+ import org .androidannotations .annotations .res .StringRes ;
9+
510import android .app .Activity ;
611import android .widget .TextView ;
712
813import com .googlecode .androidannotations .gradle .R ;
914
1015@ EActivity (R .layout .main )
1116public class HelloAndroidActivity extends Activity {
12- @ StringRes
13- String hello ;
17+ @ StringRes
18+ String hello ;
1419
15- @ ViewById
16- TextView helloTextView ;
20+ @ ViewById
21+ TextView helloTextView ;
1722
18- @ AfterViews
19- void afterViews () {
20- Date now = new Date ();
21- String helloMessage = String .format (hello , now .toString ());
22- helloTextView .setText (helloMessage );
23- }
23+ @ AfterViews
24+ void afterViews () {
25+ Date now = new Date ();
26+ String helloMessage = String .format (hello , now .toString ());
27+ helloTextView .setText (helloMessage );
28+ }
2429}
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<LinearLayout xmlns : android =" http://schemas.android.com/apk/res/android"
3- android : orientation =" vertical"
43 android : layout_width =" fill_parent"
54 android : layout_height =" fill_parent"
6- >
7- <TextView
8- android:id=" @+id/helloTextView"
9- android : layout_width =" fill_parent"
10- android : layout_height =" wrap_content"
11- />
12- </LinearLayout >
5+ android : orientation =" vertical" >
6+
7+ <TextView
8+ android : id =" @+id/helloTextView"
9+ android : layout_width =" fill_parent"
10+ android : layout_height =" wrap_content" />
11+
12+ </LinearLayout >
You can’t perform that action at this time.
0 commit comments