1. Spencer Herzberg
  2. android-maven-helloworld

Commits

Spencer Herzberg  committed 31166db

refactoring and adding a new test button

  • Participants
  • Parent commits 2cd5327
  • Branches master

Comments (0)

Files changed (2)

File src/main/android/res/layout/main.xml

View file
             android:text="Toast"
             />
 
+    <Button
+            android:id="@+id/addition"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="4+4="
+            />
+
 </LinearLayout>
 

File src/main/java/com/example/HomeActivity.java

View file
     @InjectView(R.id.toast)
     private Button toaster;
 
+    @InjectView(R.id.addition)
+    private Button addition;
+
     @Inject
     private Context appContext;
 
             }
         });
 
-        toaster.setOnLongClickListener(new View.OnLongClickListener() {
+        addition.setOnClickListener(new View.OnClickListener() {
             @Override
-            public boolean onLongClick(View view) {
+            public void onClick(View view) {
                 Toast.makeText(appContext, "4+4=" + simpleCalculator.add(4, 4), Toast.LENGTH_LONG).show();
-                return false;
             }
         });
     }