// Path: Components/googleglass-1.6/lib/android/16/content/google-gdk/samples/ApiDemo/src/com/google/android/glass/sample/apidemo/card/CardsActivity.java
// public final class CardsActivity extends Activity {
// 
//     private CardScrollView mCardScroller;
// 
//     @Override
//     protected void onCreate(Bundle bundle) {
//         super.onCreate(bundle);
// 
//         mCardScroller = new CardScrollView(this);
//         mCardScroller.setAdapter(new CardAdapter(createCards(this)));
//         setContentView(mCardScroller);
//     }
// 
//     /**
//      * Create list of cards that showcase different type of {@link Card} API.
//      */
//     private List<Card> createCards(Context context) {
//         ArrayList<Card> cards = new ArrayList<Card>();
//         cards.add(getImagesCard(context)
//                 .setImageLayout(ImageLayout.LEFT)
//                 .setText(R.string.text_left_images_layout_card));
//         cards.add(getImagesCard(context)
//                 .setImageLayout(ImageLayout.FULL)
//                 .setText(R.string.text_full_images_layout_card));
//         return cards;
//     }
// 
//     private Card getImagesCard(Context context) {
//         Card card = new Card(context);
//         card.addImage(R.drawable.codemonkey1);
//         card.addImage(R.drawable.codemonkey2);
//         card.addImage(R.drawable.codemonkey3);
//         card.addImage(R.drawable.codemonkey4);
//         card.addImage(R.drawable.codemonkey5);
//         return card;
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         mCardScroller.activate();
//     }
// 
//     @Override
//     protected void onPause() {
//         mCardScroller.deactivate();
//         super.onPause();
//     }
// }
// 
// Path: Components/googleglass-1.6/lib/android/16/content/google-gdk/samples/ApiDemo/src/com/google/android/glass/sample/apidemo/theming/ThemingActivity.java
// public final class ThemingActivity extends Activity {
// 
//     private CardScrollView mCardScroller;
// 
//     @Override
//     protected void onCreate(Bundle bundle) {
//         super.onCreate(bundle);
//         mCardScroller = new CardScrollView(this);
//         mCardScroller.setAdapter(new LayoutAdapter(this));
//         setContentView(mCardScroller);
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         mCardScroller.activate();
//     }
// 
//     @Override
//     protected void onPause() {
//         mCardScroller.deactivate();
//         super.onPause();
//     }
// }


import com.google.android.glass.sample.apidemo.card.CardsActivity;
import com.google.android.glass.sample.apidemo.theming.ThemingActivity;
import com.google.android.glass.sample.apidemo.touchpad.SelectGestureDemoActivity;
import android.app.Activity;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;
        super.setUp();
        mCardsActivityMonitor = new Instrumentation.ActivityMonitor(
            CardsActivity.class.getName(), null, false);
        mDetectorActivityMonitor = new Instrumentation.ActivityMonitor(
            SelectGestureDemoActivity.class.getName(), null, false);
        mThemingActivityMonitor = new Instrumentation.ActivityMonitor(
            ThemingActivity.class.getName(), null, false);
        getInstrumentation().addMonitor(mCardsActivityMonitor);
        getInstrumentation().addMonitor(mDetectorActivityMonitor);
        getInstrumentation().addMonitor(mThemingActivityMonitor);
    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
    }

    /**
     * Tests if the "Cards" API demo can be started when the card was tapped.
     */
    public void testTapFirstCard() throws Exception {
         final ApiDemoActivity activity = getActivity();
         assertNotNull(activity);
         activity.runOnUiThread(new Runnable() {

              @Override
              public void run() {
                  activity.getScroller().performItemClick(null /* not used */,
                          ApiDemoActivity.CARDS, -1 /* not used */);
              }
// Path: Components/googleglass-1.6/lib/android/16/content/google-gdk/samples/ApiDemo/src/com/google/android/glass/sample/apidemo/card/CardsActivity.java
// public final class CardsActivity extends Activity {
// 
//     private CardScrollView mCardScroller;
// 
//     @Override
//     protected void onCreate(Bundle bundle) {
//         super.onCreate(bundle);
// 
//         mCardScroller = new CardScrollView(this);
//         mCardScroller.setAdapter(new CardAdapter(createCards(this)));
//         setContentView(mCardScroller);
//     }
// 
//     /**
//      * Create list of cards that showcase different type of {@link Card} API.
//      */
//     private List<Card> createCards(Context context) {
//         ArrayList<Card> cards = new ArrayList<Card>();
//         cards.add(getImagesCard(context)
//                 .setImageLayout(ImageLayout.LEFT)
//                 .setText(R.string.text_left_images_layout_card));
//         cards.add(getImagesCard(context)
//                 .setImageLayout(ImageLayout.FULL)
//                 .setText(R.string.text_full_images_layout_card));
//         return cards;
//     }
// 
//     private Card getImagesCard(Context context) {
//         Card card = new Card(context);
//         card.addImage(R.drawable.codemonkey1);
//         card.addImage(R.drawable.codemonkey2);
//         card.addImage(R.drawable.codemonkey3);
//         card.addImage(R.drawable.codemonkey4);
//         card.addImage(R.drawable.codemonkey5);
//         return card;
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         mCardScroller.activate();
//     }
// 
//     @Override
//     protected void onPause() {
//         mCardScroller.deactivate();
//         super.onPause();
//     }
// }
// 
// Path: Components/googleglass-1.6/lib/android/16/content/google-gdk/samples/ApiDemo/src/com/google/android/glass/sample/apidemo/theming/ThemingActivity.java
// public final class ThemingActivity extends Activity {
// 
//     private CardScrollView mCardScroller;
// 
//     @Override
//     protected void onCreate(Bundle bundle) {
//         super.onCreate(bundle);
//         mCardScroller = new CardScrollView(this);
//         mCardScroller.setAdapter(new LayoutAdapter(this));
//         setContentView(mCardScroller);
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         mCardScroller.activate();
//     }
// 
//     @Override
//     protected void onPause() {
//         mCardScroller.deactivate();
//         super.onPause();
//     }
// }


// Path: Components/googleglass-1.6/lib/android/16/content/google-gdk/samples/ApiDemo/tests/src/com/google/android/glass/sample/apidemo/ApiDemoActivityTest.java
import com.google.android.glass.sample.apidemo.card.CardsActivity;
import com.google.android.glass.sample.apidemo.theming.ThemingActivity;
import com.google.android.glass.sample.apidemo.touchpad.SelectGestureDemoActivity;
import android.app.Activity;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;

        super.setUp();
        mCardsActivityMonitor = new Instrumentation.ActivityMonitor(
            CardsActivity.class.getName(), null, false);
        mDetectorActivityMonitor = new Instrumentation.ActivityMonitor(
            SelectGestureDemoActivity.class.getName(), null, false);
        mThemingActivityMonitor = new Instrumentation.ActivityMonitor(
            ThemingActivity.class.getName(), null, false);
        getInstrumentation().addMonitor(mCardsActivityMonitor);
        getInstrumentation().addMonitor(mDetectorActivityMonitor);
        getInstrumentation().addMonitor(mThemingActivityMonitor);
    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
    }

    /**
     * Tests if the "Cards" API demo can be started when the card was tapped.
     */
    public void testTapFirstCard() throws Exception {
         final ApiDemoActivity activity = getActivity();
         assertNotNull(activity);
         activity.runOnUiThread(new Runnable() {

              @Override
              public void run() {
                  activity.getScroller().performItemClick(null /* not used */,
                          ApiDemoActivity.CARDS, -1 /* not used */);
              }
         });