diff options
Diffstat (limited to 'espresso/espresso-sample/src')
89 files changed, 0 insertions, 4316 deletions
diff --git a/espresso/espresso-sample/src/Android.mk b/espresso/espresso-sample/src/Android.mk deleted file mode 100644 index a58b123..0000000 --- a/espresso/espresso-sample/src/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (C) 2014 The Android Open Source Project -# -# 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. -# - -include $(call all-subdir-makefiles) diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/ActionBarTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/ActionBarTest.java deleted file mode 100644 index 10485c9..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/ActionBarTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.openActionBarOverflowOrOptionsMenu; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.openContextualActionModeOverflowMenu; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; - -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -/** - * Demonstrates Espresso with action bar and contextual action mode. - * {@link openActionBarOverflowOrOptionsMenu()} opens the overflow menu from an action bar. - * {@link openContextualActionModeOverflowMenu()} opens the overflow menu from an contextual action - * mode. - */ -@LargeTest -public class ActionBarTest extends ActivityInstrumentationTestCase2<ActionBarTestActivity> { - @SuppressWarnings("deprecation") - public ActionBarTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", ActionBarTestActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - // Espresso will not launch our activity for us, we must launch it via getActivity(). - getActivity(); - } - - @SuppressWarnings("unchecked") - public void testClickActionBarItem() { - onView(withId(R.id.hide_contextual_action_bar)) - .perform(click()); - - onView(withId(R.id.action_save)) - .perform(click()); - - onView(withId(R.id.text_action_bar_result)) - .check(matches(withText("Save"))); - } - - @SuppressWarnings("unchecked") - public void testClickActionModeItem() { - onView(withId(R.id.show_contextual_action_bar)) - .perform(click()); - - onView((withId(R.id.action_lock))) - .perform(click()); - - onView(withId(R.id.text_action_bar_result)) - .check(matches(withText("Lock"))); - } - - - @SuppressWarnings("unchecked") - public void testActionBarOverflow() { - onView(withId(R.id.hide_contextual_action_bar)) - .perform(click()); - - // Open the overflow menu from action bar - openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext()); - - onView(withText("World")) - .perform(click()); - - onView(withId(R.id.text_action_bar_result)) - .check(matches(withText("World"))); - } - - @SuppressWarnings("unchecked") - public void testActionModeOverflow() { - onView(withId(R.id.show_contextual_action_bar)) - .perform(click()); - - // Open the overflow menu from contextual action mode. - openContextualActionModeOverflowMenu(); - - onView(withText("Key")) - .perform(click()); - - onView(withId(R.id.text_action_bar_result)) - .check(matches(withText("Key"))); - } -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/AdapterViewTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/AdapterViewTest.java deleted file mode 100644 index fd531ec..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/AdapterViewTest.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onData; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; -import static com.google.android.apps.common.testing.ui.testapp.LongListMatchers.isFooter; -import static com.google.android.apps.common.testing.ui.testapp.LongListMatchers.withItemContent; -import static com.google.android.apps.common.testing.ui.testapp.LongListMatchers.withItemSize; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; - -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; -import android.view.View; -import android.widget.Adapter; -import android.widget.AdapterView; - -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; - -/** - * Demonstrates the usage of - * {@link com.google.android.apps.common.testing.ui.espresso.Espresso#onData(org.hamcrest.Matcher)} - * to match data within list views. - */ -@LargeTest -public class AdapterViewTest extends ActivityInstrumentationTestCase2<LongListActivity> { - - @SuppressWarnings("deprecation") - public AdapterViewTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", LongListActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - getActivity(); - } - - public void testClickOnItem50() { - // The text view "item: 50" may not exist if we haven't scrolled to it. - // By using onData api we tell Espresso to look into the Adapter for an item matching - // the matcher we provide it. Espresso will then bring that item into the view hierarchy - // and we can click on it. - - onData(withItemContent("item: 50")) - .perform(click()); - - onView(withId(R.id.selection_row_value)) - .check(matches(withText("50"))); - } - - public void testClickOnSpecificChildOfRow60() { - onData(withItemContent("item: 60")) - .onChildView(withId(R.id.item_size)) // resource id of second column from xml layout - .perform(click()); - - onView(withId(R.id.selection_row_value)) - .check(matches(withText("60"))); - - onView(withId(R.id.selection_column_value)) - .check(matches(withText("2"))); - } - - public void testClickOnFirstAndFifthItemOfLength8() { - onData(is(withItemSize(8))) - .atPosition(0) - .perform(click()); - - onView(withId(R.id.selection_row_value)) - .check(matches(withText("10"))); - - onData(is(withItemSize(8))) - .atPosition(4) - .perform(click()); - - onView(withId(R.id.selection_row_value)) - .check(matches(withText("14"))); - } - - @SuppressWarnings("unchecked") - public void testClickFooter() { - onData(isFooter()) - .perform(click()); - - onView(withId(R.id.selection_row_value)) - .check(matches(withText("100"))); - } - - @SuppressWarnings("unchecked") - public void testDataItemNotInAdapter(){ - onView(withId(R.id.list)) - .check(matches(not(withAdaptedData(withItemContent("item: 168"))))); - } - - private static Matcher<View> withAdaptedData(final Matcher<Object> dataMatcher) { - return new TypeSafeMatcher<View>() { - - @Override - public void describeTo(Description description) { - description.appendText("with class name: "); - dataMatcher.describeTo(description); - } - - @Override - public boolean matchesSafely(View view) { - if (!(view instanceof AdapterView)) { - return false; - } - @SuppressWarnings("rawtypes") - Adapter adapter = ((AdapterView) view).getAdapter(); - for (int i = 0; i < adapter.getCount(); i++) { - if (dataMatcher.matches(adapter.getItem(i))) { - return true; - } - } - return false; - } - }; - } -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/AdvancedSynchronizationTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/AdvancedSynchronizationTest.java deleted file mode 100644 index d19fb69..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/AdvancedSynchronizationTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.registerIdlingResources; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.android.apps.common.testing.ui.espresso.contrib.CountingIdlingResource; -import com.google.android.apps.common.testing.ui.testapp.SyncActivity.HelloWorldServer; - -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -/** - * Example for {@link CountingIdlingResource}. Demonstrates how to wait on a delayed response from - * request before continuing with a test. - */ -@LargeTest -public class AdvancedSynchronizationTest extends ActivityInstrumentationTestCase2<SyncActivity> { - - private class DecoratedHelloWorldServer implements HelloWorldServer { - private final HelloWorldServer realHelloWorldServer; - private final CountingIdlingResource helloWorldServerIdlingResource; - - private DecoratedHelloWorldServer(HelloWorldServer realHelloWorldServer, - CountingIdlingResource helloWorldServerIdlingResource) { - this.realHelloWorldServer = checkNotNull(realHelloWorldServer); - this.helloWorldServerIdlingResource = checkNotNull(helloWorldServerIdlingResource); - } - - @Override - public String getHelloWorld() { - // Use CountingIdlingResource to track in-flight calls to getHelloWorld (a simulation of a - // network call). Whenever the count goes to zero, Espresso will be notified that this - // resource is idle and the test will be able to proceed. - helloWorldServerIdlingResource.increment(); - try { - return realHelloWorldServer.getHelloWorld(); - } finally { - helloWorldServerIdlingResource.decrement(); - } - } - } - - @SuppressWarnings("deprecation") - public AdvancedSynchronizationTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", SyncActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - SyncActivity activity = getActivity(); - HelloWorldServer realServer = activity.getHelloWorldServer(); - // Here, we use CountingIdlingResource - a common convenience class - to track the idle state of - // the server. You could also do this yourself, by implementing the IdlingResource interface. - CountingIdlingResource countingResource = new CountingIdlingResource("HelloWorldServerCalls"); - activity.setHelloWorldServer(new DecoratedHelloWorldServer(realServer, countingResource)); - registerIdlingResources(countingResource); - } - - public void testCountingIdlingResource() { - // Request the "hello world!" text by clicking on the request button. - onView(withId(R.id.request_button)).perform(click()); - - // Espresso waits for the resource to go idle and then continues. - - // The check if the text is visible can pass now. - onView(withId(R.id.status_text)).check(matches(withText(R.string.hello_world))); - } -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/BasicTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/BasicTest.java deleted file mode 100644 index ba2b282..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/BasicTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onData; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.pressBack; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.typeText; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; - -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -/** - * Highlights basic - * {@link com.google.android.apps.common.testing.ui.espresso.Espresso#onView(org.hamcrest.Matcher)} - * functionality. - */ -@LargeTest -public class BasicTest extends ActivityInstrumentationTestCase2<SimpleActivity> { - - @SuppressWarnings("deprecation") - public BasicTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", SimpleActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - // Espresso will not launch our activity for us, we must launch it via getActivity(). - getActivity(); - } - - public void testSimpleClickAndCheckText() { - onView(withId(R.id.button_simple)) - .perform(click()); - - onView(withId(R.id.text_simple)) - .check(matches(withText("Hello Espresso!"))); - } - - public void testTypingAndPressBack() { - onView(withId(R.id.sendtext_simple)) - .perform(typeText("Have a cup of Espresso.")); - - onView(withId(R.id.send_simple)) - .perform(click()); - - // Clicking launches a new activity that shows the text entered above. You don't need to do - // anything special to handle the activity transitions. Espresso takes care of waiting for the - // new activity to be resumed and its view hierarchy to be laid out. - onView(withId(R.id.display_data)) - .check(matches(withText(("Have a cup of Espresso.")))); - - // Going back to the previous activity - lets make sure our text was perserved. - pressBack(); - - onView(withId(R.id.sendtext_simple)) - .check(matches(withText(containsString("Espresso")))); - } - - @SuppressWarnings("unchecked") - public void testClickOnSpinnerItemAmericano(){ - // Open the spinner. - onView(withId(R.id.spinner_simple)) - .perform(click()); - // Spinner creates a List View with its contents - this can be very long and the element not - // contributed to the ViewHierarchy - by using onData we force our desired element into the - // view hierarchy. - onData(allOf(is(instanceOf(String.class)), is("Americano"))) - .perform(click()); - - onView(withId(R.id.spinnertext_simple)) - .check(matches(withText(containsString("Americano")))); - } -} - - diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/CustomFailureHandlerTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/CustomFailureHandlerTest.java deleted file mode 100644 index 14a3baf..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/CustomFailureHandlerTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.setFailureHandler; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; - -import com.google.android.apps.common.testing.ui.espresso.FailureHandler; -import com.google.android.apps.common.testing.ui.espresso.NoMatchingViewException; -import com.google.android.apps.common.testing.ui.espresso.base.DefaultFailureHandler; - -import android.content.Context; -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; -import android.util.Log; -import android.view.View; - -import org.hamcrest.Matcher; - -/** - * A sample of how to set a non-default {@link FailureHandler}. - */ -@LargeTest -public class CustomFailureHandlerTest extends ActivityInstrumentationTestCase2<MainActivity> { - - private static final String TAG = "CustomFailureHandlerTest"; - - @SuppressWarnings("deprecation") - public CustomFailureHandlerTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", MainActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - getActivity(); - setFailureHandler(new CustomFailureHandler(getInstrumentation().getTargetContext())); - } - - public void testWithCustomFailureHandler() { - try { - onView(withText("does not exist")).perform(click()); - } catch (MySpecialException expected) { - Log.e(TAG, "Special exception is special and expected: ", expected); - } - } - - /** - * A {@link FailureHandler} that re-throws {@link NoMatchingViewException} as - * {@link MySpecialException}. All other functionality is delegated to - * {@link DefaultFailureHandler}. - */ - private static class CustomFailureHandler implements FailureHandler { - private final FailureHandler delegate; - - public CustomFailureHandler(Context targetContext) { - delegate = new DefaultFailureHandler(targetContext); - } - - @Override - public void handle(Throwable error, Matcher<View> viewMatcher) { - try { - delegate.handle(error, viewMatcher); - } catch (NoMatchingViewException e) { - throw new MySpecialException(e); - } - } - } - - private static class MySpecialException extends RuntimeException { - MySpecialException(Throwable cause) { - super(cause); - } - } -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/DrawerActionsTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/DrawerActionsTest.java deleted file mode 100644 index b7c1337..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/DrawerActionsTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onData; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.contrib.DrawerActions.closeDrawer; -import static com.google.android.apps.common.testing.ui.espresso.contrib.DrawerActions.openDrawer; -import static com.google.android.apps.common.testing.ui.espresso.contrib.DrawerMatchers.isClosed; -import static com.google.android.apps.common.testing.ui.espresso.contrib.DrawerMatchers.isOpen; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; - -import com.google.android.apps.common.testing.ui.espresso.contrib.DrawerActions; - -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -/** - * Demonstrates use of {@link DrawerActions}. - */ -@LargeTest -public class DrawerActionsTest extends ActivityInstrumentationTestCase2<DrawerActivity> { - - public DrawerActionsTest() { - super(DrawerActivity.class); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - getActivity(); - } - - public void testOpenAndCloseDrawer() { - // Drawer should not be open to start. - onView(withId(R.id.drawer_layout)).check(matches(isClosed())); - - openDrawer(R.id.drawer_layout); - - // The drawer should now be open. - onView(withId(R.id.drawer_layout)).check(matches(isOpen())); - - closeDrawer(R.id.drawer_layout); - - // Drawer should be closed again. - onView(withId(R.id.drawer_layout)).check(matches(isClosed())); - } - - @SuppressWarnings("unchecked") - public void testDrawerOpenAndClick() { - openDrawer(R.id.drawer_layout); - - onView(withId(R.id.drawer_layout)).check(matches(isOpen())); - - // Click an item in the drawer. We use onData because the drawer is backed by a ListView, and - // the item may not necessarily be visible in the view hierarchy. - int rowIndex = 2; - String rowContents = DrawerActivity.DRAWER_CONTENTS[rowIndex]; - onData(allOf(is(instanceOf(String.class)), is(rowContents))).perform(click()); - - // clicking the item should close the drawer. - onView(withId(R.id.drawer_layout)).check(matches(isClosed())); - - // The text view will now display "You picked: Pickle" - onView(withId(R.id.drawer_text_view)).check(matches(withText("You picked: " + rowContents))); - } -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/LongListMatchers.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/LongListMatchers.java deleted file mode 100644 index 1518697..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/LongListMatchers.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasEntry; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; - -import com.google.android.apps.common.testing.ui.espresso.matcher.BoundedMatcher; - -import org.hamcrest.Description; -import org.hamcrest.Matcher; - -import java.util.Map; - -/** - * Static utility methods to create {@link Matcher} instances that can be applied to the data - * objects created by {@link com.google.android.apps.common.testing.ui.testapp.LongListActivity}. - * <p> - * These matchers are used by the - * {@link com.google.android.apps.common.testing.ui.espresso.Espresso#onData(Matcher)} API and are - * applied against the data exposed by @{link android.widget.ListView#getAdapter()}. - * </p> - * <p> - * In LongListActivity's case - each row is a Map containing 2 key value pairs. The key "STR" is - * mapped to a String which will be rendered into a TextView with the R.id.item_content. The other - * key "LEN" is an Integer which is the length of the string "STR" refers to. This length is - * rendered into a TextView with the id R.id.item_size. - * </p> - */ -public final class LongListMatchers { - - private LongListMatchers() { } - - - /** - * Creates a matcher against the text stored in R.id.item_content. This text is roughly - * "item: $row_number". - */ - public static Matcher<Object> withItemContent(String expectedText) { - // use preconditions to fail fast when a test is creating an invalid matcher. - checkNotNull(expectedText); - return withItemContent(equalTo(expectedText)); - } - - /** - * Creates a matcher against the text stored in R.id.item_content. This text is roughly - * "item: $row_number". - */ - @SuppressWarnings("rawtypes") - public static Matcher<Object> withItemContent(final Matcher<String> itemTextMatcher) { - // use preconditions to fail fast when a test is creating an invalid matcher. - checkNotNull(itemTextMatcher); - return new BoundedMatcher<Object, Map>(Map.class) { - @Override - public boolean matchesSafely(Map map) { - return hasEntry(equalTo("STR"), itemTextMatcher).matches(map); - } - - @Override - public void describeTo(Description description) { - description.appendText("with item content: "); - itemTextMatcher.describeTo(description); - } - }; - } - - /** - * Creates a matcher against the text stored in R.id.item_size. This text is the size of the text - * printed in R.id.item_content. - */ - public static Matcher<Object> withItemSize(int itemSize) { - // use preconditions to fail fast when a test is creating an invalid matcher. - checkArgument(itemSize > -1); - return withItemSize(equalTo(itemSize)); - } - - /** - * Creates a matcher against the text stored in R.id.item_size. This text is the size of the text - * printed in R.id.item_content. - */ - @SuppressWarnings("rawtypes") - public static Matcher<Object> withItemSize(final Matcher<Integer> itemSizeMatcher) { - // use preconditions to fail fast when a test is creating an invalid matcher. - checkNotNull(itemSizeMatcher); - return new BoundedMatcher<Object, Map>(Map.class) { - @Override - public boolean matchesSafely(Map map) { - return hasEntry(equalTo("LEN"), itemSizeMatcher).matches(map); - } - - @Override - public void describeTo(Description description) { - description.appendText("with item size: "); - itemSizeMatcher.describeTo(description); - } - }; - } - - /** - * Creates a matcher against the footer of this list view. - */ - @SuppressWarnings("unchecked") - public static Matcher<Object> isFooter() { - // This depends on LongListActivity.FOOTER being passed as data in the addFooterView method. - return allOf(is(instanceOf(String.class)), is(LongListActivity.FOOTER)); - } - -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/LongListMatchersTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/LongListMatchersTest.java deleted file mode 100644 index 3b80757..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/LongListMatchersTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.assertThat; -import static com.google.android.apps.common.testing.ui.testapp.LongListMatchers.withItemContent; -import static com.google.android.apps.common.testing.ui.testapp.LongListMatchers.withItemSize; -import static org.hamcrest.Matchers.anyOf; -import static org.hamcrest.Matchers.endsWith; -import static org.hamcrest.Matchers.equalTo; - -import android.content.Intent; -import android.test.ActivityUnitTestCase; - -/** - * UnitTests for LongListMatchers matcher factory. - */ -public final class LongListMatchersTest extends ActivityUnitTestCase<LongListActivity> { - - public LongListMatchersTest() { - super(LongListActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - startActivity(new Intent(getInstrumentation().getTargetContext(), LongListActivity.class), - null, null); - } - - public void testWithContent() { - assertThat(getActivity().makeItem(54), withItemContent("item: 54")); - assertThat(getActivity().makeItem(54), withItemContent(endsWith("54"))); - assertFalse(withItemContent("hello world").matches(getActivity().makeItem(54))); - } - - @SuppressWarnings("unchecked") - public void testWithItemSize() { - assertThat(getActivity().makeItem(54), withItemSize(8)); - assertThat(getActivity().makeItem(54), withItemSize(anyOf(equalTo(8), equalTo(7)))); - assertFalse(withItemSize(7).matches(getActivity().makeItem(54))); - } -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/MenuTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/MenuTest.java deleted file mode 100644 index 9ea8898..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/MenuTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.longClick; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.pressMenuKey; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.doesNotExist; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.isDisplayed; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.isRoot; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; - -import android.os.Build; -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -/** - * Ensures view root ordering works properly. - */ -@LargeTest -public class MenuTest extends ActivityInstrumentationTestCase2<MenuActivity> { - @SuppressWarnings("deprecation") - public MenuTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", MenuActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - getActivity(); - } - - public void testPopupMenu() { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { - // popup menus are post honeycomb. - return; - } - onView(withText(R.string.popup_item_1_text)).check(doesNotExist()); - onView(withId(R.id.popup_button)).perform(click()); - onView(withText(R.string.popup_item_1_text)).check(matches(isDisplayed())).perform(click()); - - onView(withId(R.id.text_menu_result)).check(matches(withText(R.string.popup_item_1_text))); - } - - public void testContextMenu() { - onView(withText(R.string.context_item_2_text)).check(doesNotExist()); - onView(withId(R.id.text_context_menu)).perform(longClick()); - onView(withText(R.string.context_item_2_text)).check(matches(isDisplayed())).perform(click()); - - onView(withId(R.id.text_menu_result)).check(matches(withText(R.string.context_item_2_text))); - } - - public void testOptionMenu() { - onView(withText(R.string.options_item_3_text)).check(doesNotExist()); - onView(isRoot()).perform(pressMenuKey()); - onView(withText(R.string.options_item_3_text)).check(matches(isDisplayed())).perform(click()); - - onView(withId(R.id.text_menu_result)).check(matches(withText(R.string.options_item_3_text))); - } -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/MultipleWindowTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/MultipleWindowTest.java deleted file mode 100644 index 23c3ea3..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/MultipleWindowTest.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onData; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.clearText; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.scrollTo; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.typeText; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.typeTextIntoFocusedView; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.matcher.RootMatchers.withDecorView; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; - -import android.os.Build; -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -/** - * Demonstrates dealing with multiple windows. - * - * Espresso provides the ability to switch the default window matcher used in both onView and onData - * interactions. - * - * @see com.google.android.apps.common.testing.ui.espresso.Espresso#onView - * @see com.google.android.apps.common.testing.ui.espresso.Espresso#onData - */ -@LargeTest -public class MultipleWindowTest extends ActivityInstrumentationTestCase2<SendActivity> { - - @SuppressWarnings("deprecation") - public MultipleWindowTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", SendActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - // Espresso will not launch our activity for us, we must launch it via getActivity(). - getActivity(); - } - - public void testInteractionsWithAutoCompletePopup() { - if (Build.VERSION.SDK_INT < 10) { - // Froyo's AutoCompleteTextBox is broken - do not bother testing with it. - return; - } - // Android's Window system allows multiple view hierarchies to layer on top of each other. - // - // A real world analogy would be an overhead projector with multiple transparencies placed - // on top of each other. Each Window is a transparency, and what is drawn on top of this - // transparency is the view hierarchy. - // - // By default Espresso uses a heuristic to guess which Window you intend to interact with. - // This heuristic is normally 'good enough' however if you want to interact with a Window - // that it does not select then you'll have to swap in your own root window matcher. - - - // Initially we only have 1 window, but by typing into the auto complete text view another - // window will be layered on top of the screen. Espresso ignore's this layer because it is - // not connected to the keyboard/ime. - onView(withId(R.id.auto_complete_text_view)) - .perform(scrollTo()) - .perform(typeText("So")); - - // As you can see, we continue typing oblivious to the new window on the screen. - // At the moment there should be 2 completions (South China Sea and Southern Ocean) - // Lets narrow that down to 1 completion. - onView(withId(R.id.auto_complete_text_view)) - .perform(typeTextIntoFocusedView("uth ")); - - // Now we may want to explicitly tap on a completion. We must override Espresso's - // default window selection heuristic with our own. - onView(withText("South China Sea")) - .inRoot(withDecorView(not(is(getActivity().getWindow().getDecorView())))) - .perform(click()); - - // And by clicking on the auto complete term, the text should be filled in. - onView(withId(R.id.auto_complete_text_view)) - .check(matches(withText("South China Sea"))); - - - // NB: The autocompletion box is implemented with a ListView, so the preferred way - // to interact with it is onData(). We can use inRoot here too! - onView(withId(R.id.auto_complete_text_view)) - .perform(clearText()) - .perform(typeText("S")); - - // Which is useful because some of the completions may not be part of the View Hierarchy - // unless you scroll around the list. - onData(allOf(instanceOf(String.class), is("Baltic Sea"))) - .inRoot(withDecorView(not(is(getActivity().getWindow().getDecorView())))) - .perform(click()); - - onView(withId(R.id.auto_complete_text_view)) - .check(matches(withText("Baltic Sea"))); - } - -} - - diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/ScrollToTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/ScrollToTest.java deleted file mode 100644 index 6cf7836..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/ScrollToTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.scrollTo; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static org.hamcrest.Matchers.is; - -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - - -/** - * Demonstrates the usage of - * {@link com.google.android.apps.common.testing.ui.espresso.action.ViewActions#scrollTo()}. - */ -@LargeTest -public class ScrollToTest extends ActivityInstrumentationTestCase2<ScrollActivity> { - - @SuppressWarnings("deprecation") - public ScrollToTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", ScrollActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - // Espresso will not launch our activity for us, we must launch it via getActivity(). - getActivity(); - } - - // You can pass more than one action to perform. This is useful if you are performing two actions - // back-to-back on the same view. - // Note - scrollTo is a no-op if the view is already displayed on the screen. - public void testScrollToInScrollView() { - onView(withId(is(R.id.bottom_left))) - .perform(scrollTo(), click()); - } -} diff --git a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/SwipeTest.java b/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/SwipeTest.java deleted file mode 100644 index 46704ec..0000000 --- a/espresso/espresso-sample/src/androidTest/java/com/google/android/apps/common/testing/ui/testapp/SwipeTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.swipeLeft; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.swipeRight; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.isDisplayed; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; - -import com.google.android.apps.common.testing.ui.espresso.action.ViewActions; - -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -/** - * Demonstrates use of {@link ViewActions#swipeLeft()} and {@link ViewActions#swipeRight()}. - */ -@LargeTest -public class SwipeTest extends ActivityInstrumentationTestCase2<ViewPagerActivity> { - - @SuppressWarnings("deprecation") - public SwipeTest() { - // This constructor was deprecated - but we want to support lower API levels. - super("com.google.android.apps.common.testing.ui.testapp", ViewPagerActivity.class); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - getActivity(); - } - - public void testSwipingThroughViews() { - // Should be on position 0 to start with. - onView(withText("Position #0")).check(matches(isDisplayed())); - - // Swipe left once. - onView(withId(R.id.pager_layout)).perform(swipeLeft()); - - // Now position 1 should be visible. - onView(withText("Position #1")).check(matches(isDisplayed())); - - // Swipe left again. - onView(withId(R.id.pager_layout)).perform(swipeLeft()); - - // Now position 2 should be visible. - onView(withText("Position #2")).check(matches(isDisplayed())); - - // Swipe left again. - onView(withId(R.id.pager_layout)).perform(swipeLeft()); - - // Position 2 should still be visible as this is the last view in the pager. - onView(withText("Position #2")).check(matches(isDisplayed())); - } - - public void testSwipingBackAndForward() { - // Should be on position 0 to start with. - onView(withText("Position #0")).check(matches(isDisplayed())); - - // Swipe left once. - onView(withId(R.id.pager_layout)).perform(swipeLeft()); - - // Now position 1 should be visible. - onView(withText("Position #1")).check(matches(isDisplayed())); - - // Swipe back to the right. - onView(withId(R.id.pager_layout)).perform(swipeRight()); - - // Now position 0 should be visible again. - onView(withText("Position #0")).check(matches(isDisplayed())); - - // Swipe right again. - onView(withId(R.id.pager_layout)).perform(swipeRight()); - - // Position 0 should still be visible as this is the first view in the pager. - onView(withText("Position #0")).check(matches(isDisplayed())); - } - -} diff --git a/espresso/espresso-sample/src/main/Android.mk b/espresso/espresso-sample/src/main/Android.mk deleted file mode 100644 index cbd6837..0000000 --- a/espresso/espresso-sample/src/main/Android.mk +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright (C) 2014 The Android Open Source Project -# -# 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. -# - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_PACKAGE_NAME := espresso-sample -LOCAL_MODULE_TAGS := tests # used to avoid lint errors for string errors -LOCAL_PROGUARD_ENABLED := disabled - -LOCAL_SDK_VERSION := current - -LOCAL_SRC_FILES := $(call all-java-files-under, java) - -LOCAL_RESOURCE_DIR := \ - $(LOCAL_PATH)/res \ - prebuilts/sdk/current/support/v7/appcompat/res - -LOCAL_STATIC_JAVA_LIBRARIES := \ - android-support-v4 \ - android-support-v7-appcompat \ - espresso-guava \ - jsr305 - -LOCAL_AAPT_FLAGS := \ - --auto-add-overlay \ - --extra-packages android.support.v7.appcompat - -include $(BUILD_PACKAGE) diff --git a/espresso/espresso-sample/src/main/AndroidManifest.xml b/espresso/espresso-sample/src/main/AndroidManifest.xml deleted file mode 100644 index cf8e548..0000000 --- a/espresso/espresso-sample/src/main/AndroidManifest.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.google.android.apps.common.testing.ui.testapp"> - - <uses-sdk android:minSdkVersion = "7" android:targetSdkVersion= "16"/> - - <application android:label="UI Test App" android:icon="@drawable/ic_launcher" > - <activity android:name="MainActivity" android:label="UI Test App"> - <intent-filter> - <action android:name="android.intent.action.MAIN"/> - <category android:name="android.intent.category.LAUNCHER"/> - </intent-filter> - </activity> - <activity android:name="ActionBarTestActivity" android:label="actionbar test activity" android:theme="@style/Theme.AppCompat.Light.DarkActionBar"/> - <activity android:name="SimpleActivity" android:label="simple activity"/> - <activity android:name="SendActivity" android:label="send activity"/> - <activity android:name="DisplayActivity" android:label="display activity"/> - <activity android:name="DrawerActivity" android:label="drawer activity" android:theme="@style/Theme.AppCompat.Light"/> - <activity android:name="GestureActivity" android:label="gesture activity" android:exported="true"/> - <activity android:name="ScrollActivity" android:label="scroll activity" android:exported="true"/> - <activity android:name="LongListActivity" android:label="list activity" android:exported="true"/> - <activity android:name="MenuActivity" android:label="menu activity"/> - <activity android:name="FragmentStack" android:label="fragment stack activity"/> - <activity android:name="SyncActivity" android:label="sync activity"/> - <activity android:name="SimpleWebViewActivity" android:label="web view"/> - <activity android:name="SwipeActivity" android:label="swipe activity"/> - <activity android:name="ViewPagerActivity" android:label="view pager activity"/> - </application> - - <uses-permission android:name="android.permission.CALL_PHONE"></uses-permission> -</manifest> diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ActionBarTestActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ActionBarTestActivity.java deleted file mode 100644 index 5c1ac60..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ActionBarTestActivity.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.os.Bundle; -import android.support.v7.app.ActionBarActivity; -import android.support.v7.view.ActionMode; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.widget.Button; -import android.widget.TextView; - -/** - * Shows ActionBar with a lot of items to get Action overflow on large displays. Click on item - * changes text of R.id.textActionBarResult. - */ -public class ActionBarTestActivity extends ActionBarActivity { - private ActionMode mode; - private MenuInflater inflater; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.actionbar_activity); - inflater = getMenuInflater(); - mode = startSupportActionMode(new TestActionMode()); - - ((Button) findViewById(R.id.show_contextual_action_bar)).setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - mode = startSupportActionMode(new TestActionMode()); - } - }); - ((Button) findViewById(R.id.hide_contextual_action_bar)).setOnClickListener( - new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mode != null) { - mode.finish(); - } - } - }); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - inflater.inflate(R.menu.actionbar_context_actions, menu); - return super.onCreateOptionsMenu(menu); - } - - @Override - public boolean onOptionsItemSelected(MenuItem menu) { - setResult(menu.getTitle()); - return true; - } - - private void setResult(CharSequence result) { - TextView text = (TextView) findViewById(R.id.text_action_bar_result); - text.setText(result); - } - - private final class TestActionMode implements ActionMode.Callback { - @Override - public boolean onCreateActionMode(ActionMode mode, Menu menu) { - inflater.inflate(R.menu.actionbar_activity_actions, menu); - return true; - } - - @Override - public boolean onPrepareActionMode(ActionMode mode, Menu menu) { - return false; - } - - @Override - public boolean onActionItemClicked(ActionMode mode, MenuItem item) { - setResult(item.getTitle()); - return true; - } - - @Override - public void onDestroyActionMode(ActionMode mode) {} - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DelegatingEditText.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DelegatingEditText.java deleted file mode 100644 index dace49c..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DelegatingEditText.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.KeyEvent; -import android.view.LayoutInflater; -import android.view.View; -import android.view.inputmethod.InputMethodManager; -import android.widget.EditText; -import android.widget.LinearLayout; -import android.widget.TextView; -import android.widget.TextView.OnEditorActionListener; - -/** - * Custom edit text widget. - */ -public class DelegatingEditText extends LinearLayout { - - private final EditText delegateEditText; - private final TextView messageView; - private final Context mContext; - - public DelegatingEditText(Context context) { - this(context, null); - } - - public DelegatingEditText(Context context, AttributeSet attrs) { - super(context, attrs); - setOrientation(VERTICAL); - mContext = context; - LayoutInflater inflater = LayoutInflater.from(context); - inflater.inflate(R.layout.delegating_edit_text, this, /* attachToRoot */ true); - messageView = (TextView) findViewById(R.id.edit_text_message); - delegateEditText = (EditText) findViewById(R.id.delegate_edit_text); - delegateEditText.setOnEditorActionListener(new OnEditorActionListener() { - @Override - public boolean onEditorAction(TextView v, int actionCode, KeyEvent event) { - messageView.setText("typed: " + delegateEditText.getText()); - messageView.setVisibility(View.VISIBLE); - InputMethodManager imm = - (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); - imm.hideSoftInputFromWindow(delegateEditText.getWindowToken(), 0); - return true; - } - }); - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DisplayActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DisplayActivity.java deleted file mode 100644 index d05ee00..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DisplayActivity.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - - -import android.app.Activity; -import android.os.Bundle; -import android.widget.TextView; - -/** - * Simple activity used to display data received from another activity. - */ -public class DisplayActivity extends Activity { - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.display_activity); - TextView textView = (TextView) findViewById(R.id.display_data); - textView.setText(getIntent().getStringExtra(SendActivity.EXTRA_DATA)); - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DrawerActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DrawerActivity.java deleted file mode 100644 index a13f688..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/DrawerActivity.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.content.res.Configuration; -import android.os.Bundle; -import android.support.v4.app.ActionBarDrawerToggle; -import android.support.v4.widget.DrawerLayout; -import android.view.MenuItem; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.ArrayAdapter; -import android.widget.ListAdapter; -import android.widget.ListView; -import android.widget.TextView; - -/** - * Activity to demonstrate actions on a {@link DrawerLayout}. - */ -public class DrawerActivity extends Activity { - - public static final String[] DRAWER_CONTENTS = - new String[] {"Platypus", "Wombat", "Pickle", "Badger"}; - - private ActionBarDrawerToggle drawerToggle; - private CharSequence title; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.drawer_activity); - - ListAdapter listAdapter = new ArrayAdapter<String>( - getApplicationContext(), R.layout.drawer_row, R.id.drawer_row_name, DRAWER_CONTENTS); - final DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); - ListView drawerList = (ListView) findViewById(R.id.drawer_list); - drawerList.setAdapter(listAdapter); - - final TextView textView = (TextView) findViewById(R.id.drawer_text_view); - - drawerList.setOnItemClickListener(new OnItemClickListener() { - @Override - public void onItemClick(AdapterView<?> parent, View view, int position, long id) { - textView.setText("You picked: " + DRAWER_CONTENTS[(int) id]); - drawerLayout.closeDrawers(); - } - }); - - // enable ActionBar app icon to behave as action to toggle nav drawer - // TODO(user): use compat lib for lower API levels - if (android.os.Build.VERSION.SDK_INT >= 11) { - getActionBar().setDisplayHomeAsUpEnabled(true); - getActionBar().setHomeButtonEnabled(true); - } - - title = getTitle(); - - drawerToggle = new ActionBarDrawerToggle( - this, - drawerLayout, - R.drawable.ic_drawer, - R.string.nav_drawer_open, - R.string.nav_drawer_close) { - - /** Called when a drawer has settled in a completely closed state. */ - public void onDrawerClosed(View view) { - if (android.os.Build.VERSION.SDK_INT >= 11) { - getActionBar().setTitle(title); - } - } - - /** Called when a drawer has settled in a completely open state. */ - public void onDrawerOpened(View drawerView) { - if (android.os.Build.VERSION.SDK_INT >= 11) { - getActionBar().setTitle(title); - } - } - }; - drawerLayout.setDrawerListener(drawerToggle); - } - - @Override - public void setTitle(CharSequence title) { - this.title = title; - if (android.os.Build.VERSION.SDK_INT >= 11) { - getActionBar().setTitle(title); - } - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // The action bar home/up action should open or close the drawer. - // ActionBarDrawerToggle will take care of this. - if (drawerToggle.onOptionsItemSelected(item)) { - return true; - } - return super.onOptionsItemSelected(item); - } - - @Override - protected void onPostCreate(Bundle savedInstanceState) { - super.onPostCreate(savedInstanceState); - // Sync the toggle state after onRestoreInstanceState has occurred. - drawerToggle.syncState(); - } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - // Pass any configuration change to the drawer toggls - drawerToggle.onConfigurationChanged(newConfig); - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/FragmentStack.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/FragmentStack.java deleted file mode 100644 index e89ce27..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/FragmentStack.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.app.Fragment; -import android.app.FragmentTransaction; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.TextView; - -/** - * Displays a counter using fragments. - */ -public class FragmentStack extends Activity { - int stackLevel = 1; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.fragment_stack); - - // Watch for button clicks. - Button button = (Button) findViewById(R.id.new_fragment); - button.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - addFragmentToStack(); - } - }); - - if (savedInstanceState == null) { - // Do first time initialization -- add initial fragment. - Fragment newFragment = CountingFragment.newInstance(stackLevel); - FragmentTransaction ft = getFragmentManager().beginTransaction(); - ft.add(R.id.simple_fragment, newFragment).commit(); - } else { - stackLevel = savedInstanceState.getInt("level"); - } - } - - @Override - public void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - outState.putInt("level", stackLevel); - } - - - void addFragmentToStack() { - stackLevel++; - - // Instantiate a new fragment. - Fragment newFragment = CountingFragment.newInstance(stackLevel); - - // Add the fragment to the activity, pushing this transaction - // on to the back stack. - FragmentTransaction ft = getFragmentManager().beginTransaction(); - ft.replace(R.id.simple_fragment, newFragment); - ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); - ft.addToBackStack(null); - ft.commit(); - } - - - - /** - * A fragment that displays a number. - */ - public static class CountingFragment extends Fragment { - int counter; - - /** - * Create a new instance of CountingFragment, providing "num" - * as an argument. - */ - static CountingFragment newInstance(int num) { - CountingFragment f = new CountingFragment(); - - // Supply num input as an argument. - Bundle args = new Bundle(); - args.putInt("num", num); - f.setArguments(args); - - return f; - } - - /** - * When creating, retrieve this instance's number from its arguments. - */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - counter = getArguments() != null ? getArguments().getInt("num") : 1; - } - - /** - * The Fragment's UI is just a simple text view showing its - * instance number. - */ - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - TextView text = new TextView(getActivity()); - text.setText("Fragment #" + counter); - return text; - } - } - -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/GestureActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/GestureActivity.java deleted file mode 100644 index b2cbc32..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/GestureActivity.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import com.google.common.collect.Lists; - -import android.app.Activity; -import android.os.Bundle; -import android.os.SystemClock; -import android.util.Log; -import android.view.GestureDetector; -import android.view.MotionEvent; -import android.view.View; - -import java.util.List; - -/** - * Displays a large touchable area and logs the events it receives. - */ -public class GestureActivity extends Activity { - private static final String TAG = GestureActivity.class.getSimpleName(); - - - private View gestureArea; - private List<MotionEvent> downEvents = Lists.newArrayList(); - private List<MotionEvent> scrollEvents = Lists.newArrayList(); - private List<MotionEvent> longPressEvents = Lists.newArrayList(); - private List<MotionEvent> showPresses = Lists.newArrayList(); - private List<MotionEvent> singleTaps = Lists.newArrayList(); - private List<MotionEvent> confirmedSingleTaps = Lists.newArrayList(); - private List<MotionEvent> doubleTapEvents = Lists.newArrayList(); - private List<MotionEvent> doubleTaps = Lists.newArrayList(); - - public void clearDownEvents() { - downEvents.clear(); - } - - public void clearScrollEvents() { - scrollEvents.clear(); - } - - public void clearLongPressEvents() { - longPressEvents.clear(); - } - - public void clearShowPresses() { - showPresses.clear(); - } - - public void clearSingleTaps() { - singleTaps.clear(); - } - - public void clearConfirmedSingleTaps() { - confirmedSingleTaps.clear(); - } - - public void clearDoubleTapEvents() { - doubleTapEvents.clear(); - } - - public void clearDoubleTaps() { - doubleTaps.clear(); - } - - public List<MotionEvent> getDownEvents() { - return Lists.newArrayList(downEvents); - } - - public List<MotionEvent> getScrollEvents() { - return Lists.newArrayList(scrollEvents); - } - - public List<MotionEvent> getLongPressEvents() { - return Lists.newArrayList(longPressEvents); - } - - public List<MotionEvent> getShowPresses() { - return Lists.newArrayList(showPresses); - } - - public List<MotionEvent> getSingleTaps() { - return Lists.newArrayList(singleTaps); - } - - public List<MotionEvent> getConfirmedSingleTaps() { - return Lists.newArrayList(confirmedSingleTaps); - } - - public List<MotionEvent> getDoubleTapEvents() { - return Lists.newArrayList(doubleTapEvents); - } - - public List<MotionEvent> getDoubleTaps() { - return Lists.newArrayList(doubleTaps); - } - - @Override - public void onCreate(Bundle icicle) { - super.onCreate(icicle); - setContentView(R.layout.gesture_activity); - gestureArea = findViewById(R.id.gesture_area); - final GestureDetector simpleDetector = new GestureDetector(this, new GestureListener()); - simpleDetector.setIsLongpressEnabled(true); - simpleDetector.setOnDoubleTapListener(new DoubleTapListener()); - gestureArea.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(View v, MotionEvent m) { - boolean res = simpleDetector.onTouchEvent(m); - if (-1 != touchDelay) { - Log.i(TAG, "sleeping for: " + touchDelay); - SystemClock.sleep(touchDelay); - - } - return res; - } - }); - } - - private volatile long touchDelay = -1; - - public void setTouchDelay(long touchDelay) { - this.touchDelay = touchDelay; - } - - public void areaClicked(@SuppressWarnings("unused") View v) { - Log.v(TAG, "onClick called!"); - } - - private class DoubleTapListener implements GestureDetector.OnDoubleTapListener { - @Override - public boolean onDoubleTap(MotionEvent e) { - doubleTaps.add(MotionEvent.obtain(e)); - Log.v(TAG, "onDoubleTap: " + e); - setVisible(R.id.text_double_click); - return false; - } - - @Override - public boolean onDoubleTapEvent(MotionEvent e) { - doubleTapEvents.add(MotionEvent.obtain(e)); - Log.v(TAG, "onDoubleTapEvent: " + e); - return false; - } - - @Override - public boolean onSingleTapConfirmed(MotionEvent e) { - confirmedSingleTaps.add(MotionEvent.obtain(e)); - Log.v(TAG, "onSingleTapConfirmed: " + e); - return false; - } - } - - private class GestureListener implements GestureDetector.OnGestureListener { - @Override - public boolean onDown(MotionEvent e) { - downEvents.add(MotionEvent.obtain(e)); - Log.v(TAG, "Down: " + e); - return false; - } - - @Override - public boolean onSingleTapUp(MotionEvent e) { - singleTaps.add(MotionEvent.obtain(e)); - Log.v(TAG, "on single tap: " + e); - setVisible(R.id.text_click); - return false; - } - - @Override - public boolean onScroll(MotionEvent e1, MotionEvent e2, float distX, float distY) { - scrollEvents.add(MotionEvent.obtain(e1)); - scrollEvents.add(MotionEvent.obtain(e2)); - Log.v(TAG, "Scroll: e1: " + e1 + " e2: " + e2 + " distX: " + distX + " distY: " + distY); - setVisible(R.id.text_swipe); - return false; - } - - @Override - public void onShowPress(MotionEvent e) { - showPresses.add(MotionEvent.obtain(e)); - Log.v(TAG, "ShowPress: " + e); - } - - @Override - public void onLongPress(MotionEvent e) { - longPressEvents.add(MotionEvent.obtain(e)); - Log.v(TAG, "LongPress: " + e); - setVisible(R.id.text_long_click); - } - - @Override - public boolean onFling(MotionEvent e1, MotionEvent e2, float veloX, float veloY) { - Log.v(TAG, "Fling: e1: " + e1 + " e2: " + e2 + " veloX: " + veloX + " veloY: " + veloY); - return false; - } - } - - private void setVisible(int id) { - hideAll(); - findViewById(id).setVisibility(View.VISIBLE); - } - - private void hideAll() { - findViewById(R.id.text_click).setVisibility(View.GONE); - findViewById(R.id.text_long_click).setVisibility(View.GONE); - findViewById(R.id.text_swipe).setVisibility(View.GONE); - findViewById(R.id.text_double_click).setVisibility(View.GONE); - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/LongListActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/LongListActivity.java deleted file mode 100644 index 300c0ee..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/LongListActivity.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -import android.app.Activity; -import android.content.Context; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.ListAdapter; -import android.widget.ListView; -import android.widget.SimpleAdapter; -import android.widget.TextView; - -import java.util.List; -import java.util.Map; - -/** - * An activity displaying a long list. - */ -public class LongListActivity extends Activity { - - @VisibleForTesting - public static final String STR = "STR"; - @VisibleForTesting - public static final String LEN = "LEN"; - @VisibleForTesting - public static final String FOOTER = "FOOTER"; - - private List<Map<String, Object>> data = Lists.newArrayList(); - private LayoutInflater layoutInflater; - - @Override - public void onCreate(Bundle bundle) { - super.onCreate(bundle); - populateData(); - setContentView(R.layout.list_activity); - ((TextView) findViewById(R.id.selection_row_value)).setText(""); - ((TextView) findViewById(R.id.selection_column_value)).setText(""); - - ListView listView = (ListView) findViewById(R.id.list); - String[] from = new String[] {STR, LEN}; - int[] to = new int[] {R.id.item_content, R.id.item_size}; - layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - ListAdapter adapter = new SimpleAdapter(this, data, R.layout.list_item, from, to) { - @Override - public View getView(final int position, View convertView, ViewGroup parent) { - if (convertView == null) { - convertView = layoutInflater.inflate(R.layout.list_item, null); - } - - TextView textViewOne = (TextView) convertView.findViewById(R.id.item_content); - if (textViewOne != null) { - textViewOne.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position)); - ((TextView) findViewById(R.id.selection_column_value)).setText("1"); - } - }); - } - - TextView textViewTwo = (TextView) convertView.findViewById(R.id.item_size); - if (textViewTwo != null) { - textViewTwo.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position)); - ((TextView) findViewById(R.id.selection_column_value)).setText("2"); - } - }); - } - return super.getView(position, convertView, parent); - } - }; - - View footerView = layoutInflater.inflate(R.layout.list_item, listView, false); - ((TextView) footerView.findViewById(R.id.item_content)).setText("count:"); - ((TextView) footerView.findViewById(R.id.item_size)).setText(String.valueOf(data.size())); - listView.addFooterView(footerView, FOOTER, true); - - listView.setAdapter(adapter); - listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick( - AdapterView<?> unusedParent, View clickedView, int position, long id) { - ((TextView) findViewById(R.id.selection_column_value)).setText(""); - ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position)); - } - }); - } - - public Map<String, Object> makeItem(int forRow) { - Map<String, Object> dataRow = Maps.newHashMap(); - dataRow.put(STR, "item: " + forRow); - dataRow.put(LEN, ((String) dataRow.get(STR)).length()); - return dataRow; - } - - private void populateData() { - for (int i = 0; i < 100; i++) { - data.add(makeItem(i)); - } - } - -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/MainActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/MainActivity.java deleted file mode 100644 index c5ad762..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/MainActivity.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.ListActivity; -import android.content.Intent; -import android.content.pm.ActivityInfo; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.PackageManager.NameNotFoundException; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.widget.ListView; -import android.widget.SimpleAdapter; - -import java.text.Collator; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Displays a list with all available activities. - */ -public class MainActivity extends ListActivity { - private static final String TAG = MainActivity.class.getSimpleName(); - - private static final Comparator<Map<String, Object>> sDisplayNameComparator = - new Comparator<Map<String, Object>>() { - private final Collator collator = Collator.getInstance(); - - @Override - public int compare(Map<String, Object> map1, Map<String, Object> map2) { - return collator.compare(map1.get("title"), map2.get("title")); - } - }; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setListAdapter(new SimpleAdapter( - this, getData(), android.R.layout.simple_list_item_1, new String[] {"title"}, - new int[] {android.R.id.text1})); - getListView().setTextFilterEnabled(true); - } - - private List<Map<String, Object>> getData() { - List<Map<String, Object>> data = new ArrayList<Map<String, Object>>(); - - PackageInfo info = null; - try { - info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_ACTIVITIES); - } catch (NameNotFoundException e) { - Log.e(TAG, "Packageinfo not found in: " + getPackageName()); - } - - if (null == info) { - return data; - } else { - for (ActivityInfo activityInfo : info.activities) { - - if (!activityInfo.name.equals(getComponentName().getClassName())) { - String[] label = activityInfo.name.split(getPackageName() + "."); - addItem(data, label[1], - createActivityIntent(activityInfo.applicationInfo.packageName, activityInfo.name)); - } - } - } - - Collections.sort(data, sDisplayNameComparator); - return data; - } - - private Intent createActivityIntent(String pkg, String componentName) { - Intent result = new Intent(); - result.setClassName(pkg, componentName); - return result; - } - - private void addItem(List<Map<String, Object>> data, String name, Intent intent) { - Map<String, Object> temp = new HashMap<String, Object>(); - temp.put("title", name); - temp.put("intent", intent); - data.add(temp); - } - - @Override - protected void onListItemClick(ListView listView, View view, int position, long id) { - Map<?, ?> map = (Map<?, ?>) listView.getItemAtPosition(position); - - Intent intent = (Intent) map.get("intent"); - startActivity(intent); - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/MenuActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/MenuActivity.java deleted file mode 100644 index e893cea..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/MenuActivity.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.os.Build; -import android.os.Bundle; -import android.view.ContextMenu; -import android.view.ContextMenu.ContextMenuInfo; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.widget.PopupMenu; -import android.widget.PopupMenu.OnMenuItemClickListener; -import android.widget.TextView; - -/** - * Shows MenuActivity with Options menu, Context menu and Popup menu. Click on a menu item changes - * text of R.id.textMenuResult. - */ -public class MenuActivity extends Activity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.menu_activity); - registerForContextMenu(findViewById(R.id.text_context_menu)); - } - - @Override - public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { - super.onCreateContextMenu(menu, v, menuInfo); - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.contextmenu, menu); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - TextView text = (TextView) findViewById(R.id.text_menu_result); - text.setText(item.getTitle()); - return true; - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.optionsmenu, menu); - return true; - } - - @Override - public boolean onContextItemSelected(MenuItem item) { - TextView text = (TextView) findViewById(R.id.text_menu_result); - text.setText(item.getTitle()); - return true; - } - - public void showPopup(View view) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { - TextView text = (TextView) findViewById(R.id.text_menu_result); - text.setText("Not supported in API " + Build.VERSION.SDK_INT); - } else { - PopupMenu popup = new PopupMenu(this, view); - popup.setOnMenuItemClickListener(new PopupMenuListener()); - popup.getMenuInflater().inflate(R.menu.popupmenu, popup.getMenu()); - popup.show(); - } - } - - @Override - public boolean onMenuItemSelected(int featureId, MenuItem item) { - return super.onMenuItemSelected(featureId, item); - } - - private class PopupMenuListener implements OnMenuItemClickListener { - @Override - public boolean onMenuItemClick(MenuItem item) { - TextView text = (TextView) findViewById(R.id.text_menu_result); - text.setText(item.getTitle()); - return true; - } - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ScrollActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ScrollActivity.java deleted file mode 100644 index 864fb23..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ScrollActivity.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.os.Bundle; - -/** - * An activity displaying various scroll views. - */ -public class ScrollActivity extends Activity { - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.scroll_activity); - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SendActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SendActivity.java deleted file mode 100644 index fe472e7..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SendActivity.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.net.Uri; -import android.os.Build; -import android.os.Bundle; -import android.provider.ContactsContract.CommonDataKinds.Phone; -import android.view.Gravity; -import android.view.KeyEvent; -import android.view.MenuInflater; -import android.view.View; -import android.view.View.OnKeyListener; -import android.view.ViewGroup.LayoutParams; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputMethodManager; -import android.widget.ArrayAdapter; -import android.widget.AutoCompleteTextView; -import android.widget.EditText; -import android.widget.PopupMenu; -import android.widget.PopupWindow; -import android.widget.TextView; - -/** - * Simple activity used for validating intent sending and UI behavior. - */ -public class SendActivity extends Activity { - - private static final int PICK_CONTACT_REQUEST = 1; // The request code - static final String EXTRA_DATA = "com.google.android.apps.common.testing.ui.testapp.DATA"; - static final int PICK_CONTACT = 100; - private PopupWindow popupWindow; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.send_activity); - - EditText editText = (EditText) findViewById(R.id.enter_data_edit_text); - editText.setOnKeyListener(new OnKeyListener() { - - @Override - public boolean onKey(View view, int keyCode, KeyEvent event) { - if ((event.getAction() == KeyEvent.ACTION_DOWN) && - (keyCode == KeyEvent.KEYCODE_ENTER)) { - EditText editText = (EditText) view; - TextView responseText = (TextView) findViewById(R.id.enter_data_response_text); - responseText.setText(editText.getText()); - return true; - } else { - return false; - } - } - }); - - final EditText searchBox = (EditText) findViewById(R.id.search_box); - searchBox.setOnEditorActionListener(new TextView.OnEditorActionListener() { - @Override - public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { - if (actionId == EditorInfo.IME_ACTION_SEARCH) { - TextView result = (TextView) findViewById(R.id.search_result); - result.setText(getString(R.string.searching_for_label) + " " + v.getText()); - result.setVisibility(View.VISIBLE); - InputMethodManager imm = - (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); - imm.hideSoftInputFromWindow(searchBox.getWindowToken(), 0); - return true; - } - return false; - } - }); - AutoCompleteTextView autoComplete = (AutoCompleteTextView) findViewById( - R.id.auto_complete_text_view); - String [] completions = new String[] { - "Pacific Ocean", "Atlantic Ocean", "Indian Ocean", "Southern Ocean", "Artic Ocean", - "Mediterranean Sea", "Caribbean Sea", "South China Sea", "Bering Sea", - "Gulf of Mexico", "Okhotsk Sea", "East China Sea", "Hudson Bay", "Japan Sea", - "Andaman Sea", "North Sea", "Red Sea", "Baltic Sea" }; - ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, - android.R.layout.simple_dropdown_item_1line, - completions); - autoComplete.setAdapter(adapter); - } - - /** Called when user clicks the Send button */ - public void sendData(@SuppressWarnings("unused") View view) { - Intent intent = new Intent(this, DisplayActivity.class); - EditText editText = (EditText) findViewById(R.id.send_data_edit_text); - intent.putExtra(EXTRA_DATA, editText.getText().toString()); - startActivity(intent); - } - - public void sendDataToCall(@SuppressWarnings("unused") View view) { - Intent intentToCall = new Intent(Intent.ACTION_CALL); - EditText editText = (EditText) findViewById(R.id.send_data_to_call_edit_text); - String number = editText.getText().toString(); - intentToCall.setData(Uri.parse("tel:" + number)); - startActivity(intentToCall); - } - - public void sendDataToBrowser(@SuppressWarnings("unused") View view) { - EditText editText = (EditText) findViewById(R.id.send_data_to_browser_edit_text); - String url = editText.getText().toString(); - Intent intentToBrowser = new Intent(Intent.ACTION_VIEW); - intentToBrowser.setData(Uri.parse(url)); - intentToBrowser.addCategory(Intent.CATEGORY_BROWSABLE); - intentToBrowser.putExtra("key1", "value1"); - intentToBrowser.putExtra("key2", "value2"); - startActivity(intentToBrowser); - } - - public void sendMessage(@SuppressWarnings("unused") View view) { - Intent sendIntent = new Intent(); - EditText editText = (EditText) findViewById(R.id.send_data_to_message_edit_text); - sendIntent.setAction(Intent.ACTION_SEND); - sendIntent.putExtra(Intent.EXTRA_TEXT, editText.getText().toString()); - sendIntent.setType("text/plain"); - startActivity(sendIntent); - } - - public void clickToMarket(@SuppressWarnings("unused") View view) { - Intent marketIntent = new Intent(Intent.ACTION_VIEW); - EditText editText = (EditText) findViewById(R.id.send_to_market_data); - marketIntent.setData(Uri.parse( - "market://details?id=" + editText.getText().toString())); - startActivity(marketIntent); - } - - public void clickToGesture(@SuppressWarnings("unused") View view) { - startActivity(new Intent(this, GestureActivity.class)); - } - - public void clickToScroll(@SuppressWarnings("unused") View view) { - startActivity(new Intent(this, ScrollActivity.class)); - } - - public void clickToList(@SuppressWarnings("unused") View view) { - startActivity(new Intent(this, LongListActivity.class)); - } - - public boolean showDialog(@SuppressWarnings("unused") View view) { - new AlertDialog.Builder(this) - .setTitle(R.string.dialog_title) - .setMessage(R.string.dialog_message) - .setNeutralButton("Fine", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int choice) { - dialog.dismiss(); - } - }) - .show(); - return true; - } - - public boolean showPopupView(View view) { - View content = getLayoutInflater().inflate(R.layout.popup_window, null, false); - popupWindow = new PopupWindow(content, LayoutParams.WRAP_CONTENT, - LayoutParams.WRAP_CONTENT, true); - content.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - popupWindow.dismiss(); - } - }); - - popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0); - - return true; - } - - public boolean showPopupMenu(View view) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { - return false; - } - - PopupMenu popup = new PopupMenu(this, view); - MenuInflater inflater = popup.getMenuInflater(); - inflater.inflate(R.menu.popup_menu, popup.getMenu()); - popup.show(); - return true; - } - - public void pickContact(@SuppressWarnings("unused") View view) { - Intent pickContactIntent = new Intent(Intent.ACTION_PICK, Uri.parse("content://contacts")); - pickContactIntent.setType(Phone.CONTENT_TYPE); // Show user only contacts w/ phone numbers - startActivityForResult(pickContactIntent, PICK_CONTACT_REQUEST); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == PICK_CONTACT_REQUEST) { - if (resultCode == RESULT_OK) { - // TODO(user): hook this up for real as shown in this example: - // http://developer.android.com/training/basics/intents/result.html - TextView textView = (TextView) findViewById(R.id.phone_number); - textView.setText(data.getExtras().getString("phone")); - } - } - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimpleActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimpleActivity.java deleted file mode 100644 index 8af2747..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimpleActivity.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemSelectedListener; -import android.widget.ArrayAdapter; -import android.widget.EditText; -import android.widget.Spinner; -import android.widget.TextView; - -/** - * Simple activity used to demonstrate a simple Espresso test. - */ -public class SimpleActivity extends Activity implements OnItemSelectedListener{ - - static final String EXTRA_DATA = "com.google.android.apps.common.testing.ui.testapp.DATA"; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.simple_activity); - - Spinner spinner = (Spinner) findViewById(R.id.spinner_simple); - ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, - R.array.spinner_array, android.R.layout.simple_spinner_item); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - spinner.setAdapter(adapter); - spinner.setOnItemSelectedListener(this); - } - - public void simpleButtonClicked(View view) { - TextView textView = (TextView) findViewById(R.id.text_simple); - String message = "Hello Espresso!"; - textView.setText(message); - } - - /** Called when user clicks the Send button */ - public void sendButtonClicked(@SuppressWarnings("unused") View view) { - Intent intent = new Intent(this, DisplayActivity.class); - EditText editText = (EditText) findViewById(R.id.sendtext_simple); - intent.putExtra(EXTRA_DATA, editText.getText().toString()); - startActivity(intent); - } - - public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { - TextView textView = (TextView) findViewById(R.id.spinnertext_simple); - textView.setText(String.format("One %s a day!", parent.getItemAtPosition(pos))); - } - - public void onNothingSelected(AdapterView<?> parent) { - } -} - diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimplePagerAdapter.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimplePagerAdapter.java deleted file mode 100644 index 42d9cf4..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimplePagerAdapter.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.graphics.Color; -import android.support.v4.view.PagerAdapter; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -class SimplePagerAdapter extends PagerAdapter { - - private static final int[] COLORS = { - Color.BLUE, - Color.RED, - Color.YELLOW, - }; - - private static final int NUM_PAGES = COLORS.length; - - @Override - public int getCount() { - return NUM_PAGES; - } - - @Override - public boolean isViewFromObject(View view, Object object) { - return view == object; - } - - @Override - public int getItemPosition(Object object) { - return ((ViewGroup) ((View) object).getParent()).indexOfChild((View) object); - } - - @Override - public Object instantiateItem(ViewGroup container, int position) { - LayoutInflater inflater = LayoutInflater.from(container.getContext()); - View view = inflater.inflate(R.layout.pager_view, null); - ((TextView) view.findViewById(R.id.pager_content)).setText("Position #" + position); - view.setBackgroundColor(COLORS[position]); - container.addView(view); - return view; - } - - @Override - public void destroyItem(ViewGroup container, int position, Object object) { - container.removeView((View) object); - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimpleWebViewActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimpleWebViewActivity.java deleted file mode 100644 index 9c844af..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SimpleWebViewActivity.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.os.Bundle; -import android.webkit.WebSettings; -import android.webkit.WebView; - -/** - * One big web view to play with. - */ -public class SimpleWebViewActivity extends Activity { - @Override - public void onCreate(Bundle icicle) { - super.onCreate(icicle); - WebView mainWebView = new WebView(this); - setContentView(mainWebView); - mainWebView.loadData( - "<html>" + - "<script>document.was_clicked = false</script>" + - "<body> " + - "<button style='height:1000px;width:1000px;' onclick='document.was_clicked = true'> " + - "I'm a button</button>" + - "</body> " + - "</html>", "text/html", null); - WebSettings settings = mainWebView.getSettings(); - settings.setJavaScriptEnabled(true); - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SwipeActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SwipeActivity.java deleted file mode 100644 index 93d1c18..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SwipeActivity.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.os.Bundle; -import android.support.v4.view.ViewPager; - -/** - * Activity to test swipe interactions. - */ -public class SwipeActivity extends Activity { - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.swipe_activity); - - ((ViewPager) findViewById(R.id.small_pager)).setAdapter(new SimplePagerAdapter()); - ((ViewPager) findViewById(R.id.overlapped_pager)).setAdapter(new SimplePagerAdapter()); - } - -} - diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SyncActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SyncActivity.java deleted file mode 100644 index 6702390..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/SyncActivity.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.annotations.VisibleForTesting; - -import android.app.Activity; -import android.os.Bundle; -import android.os.SystemClock; -import android.view.View; -import android.widget.TextView; - -import java.util.Random; - -/** - * Displays "hello world" with a random delay of 2 to 7s after the user clicks on a button. This is - * used to demonstrate how Espresso can synchronize with any part of your application, which may - * cause the application state to be unstable (e.g. a network call). - */ -public class SyncActivity extends Activity { - - /** - * A server that returns a hello world string - */ - public interface HelloWorldServer { - String getHelloWorld(); - } - - private HelloWorldServer helloWorldServer; - private TextView statusTextView; - - @Override - protected void onCreate(Bundle icicle) { - super.onCreate(icicle); - - setContentView(R.layout.sync_activity); - - statusTextView = checkNotNull(((TextView) findViewById(R.id.status_text))); - - setHelloWorldServer(new HelloWorldServer() { - @Override - public String getHelloWorld() { - Random rand = new Random(); - SystemClock.sleep(rand.nextInt(5000) + 2000); - return getString(R.string.hello_world); - } - }); - } - - public void onRequestButtonClick(@SuppressWarnings("unused") View view) { - Thread t = new Thread() { - @Override - public void run() { - final String helloworld = helloWorldServer.getHelloWorld(); - runOnUiThread(new Runnable() { - @Override - public void run() { - setStatus(helloworld); - } - }); - } - }; - t.start(); - } - - private void setStatus(String text) { - statusTextView.setText(text); - } - - @VisibleForTesting - public HelloWorldServer getHelloWorldServer() { - return helloWorldServer; - } - - @VisibleForTesting - public void setHelloWorldServer(HelloWorldServer helloWorldServer) { - this.helloWorldServer = helloWorldServer; - } -} diff --git a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ViewPagerActivity.java b/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ViewPagerActivity.java deleted file mode 100644 index ec92db8..0000000 --- a/espresso/espresso-sample/src/main/java/com/google/android/apps/common/testing/ui/testapp/ViewPagerActivity.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * 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.google.android.apps.common.testing.ui.testapp; - -import android.app.Activity; -import android.os.Bundle; -import android.support.v4.view.ViewPager; - -/** - * Activity to demonstrate actions on a {@link ViewPager}. - */ -public class ViewPagerActivity extends Activity { - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.pager_activity); - - final ViewPager pager = (ViewPager) findViewById(R.id.pager_layout); - pager.setAdapter(new SimplePagerAdapter()); - } - -} - diff --git a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_calendar.png b/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_calendar.png Binary files differdeleted file mode 100644 index c7bd88b..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_calendar.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_key.png b/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_key.png Binary files differdeleted file mode 100644 index ff876a0..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_key.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_lock.png b/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_lock.png Binary files differdeleted file mode 100644 index 1c80686..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_lock.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_save.png b/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_save.png Binary files differdeleted file mode 100644 index 827355d..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_save.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_search.png b/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_search.png Binary files differdeleted file mode 100644 index b826566..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_search.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_world.png b/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_world.png Binary files differdeleted file mode 100644 index 612a5f2..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_action_world.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_drawer.png b/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_drawer.png Binary files differdeleted file mode 100644 index 9691a6c..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_drawer.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_launcher.png b/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_launcher.png Binary files differdeleted file mode 100644 index c1615e0..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-hdpi/ic_launcher.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_calendar.png b/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_calendar.png Binary files differdeleted file mode 100644 index 37a9d7a..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_calendar.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_key.png b/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_key.png Binary files differdeleted file mode 100644 index 8628a15..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_key.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_lock.png b/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_lock.png Binary files differdeleted file mode 100644 index a29abbb..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_lock.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_save.png b/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_save.png Binary files differdeleted file mode 100644 index a51c100..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_save.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_search.png b/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_search.png Binary files differdeleted file mode 100644 index 1b4aac6..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_search.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_world.png b/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_world.png Binary files differdeleted file mode 100644 index c27143c..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_action_world.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_drawer.png b/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_drawer.png Binary files differdeleted file mode 100644 index 9691a6c..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_drawer.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_launcher.png b/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_launcher.png Binary files differdeleted file mode 100644 index 110987a..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-ldpi/ic_launcher.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_calendar.png b/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_calendar.png Binary files differdeleted file mode 100644 index 7cb5f27..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_calendar.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_key.png b/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_key.png Binary files differdeleted file mode 100644 index 6bb6ff3..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_key.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_lock.png b/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_lock.png Binary files differdeleted file mode 100644 index ee9dea0..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_lock.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_save.png b/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_save.png Binary files differdeleted file mode 100644 index eebcf21..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_save.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_search.png b/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_search.png Binary files differdeleted file mode 100644 index 3516c9e..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_search.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_world.png b/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_world.png Binary files differdeleted file mode 100644 index f7e8dcf..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_action_world.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_drawer.png b/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_drawer.png Binary files differdeleted file mode 100644 index 2190a93..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_drawer.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_launcher.png b/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_launcher.png Binary files differdeleted file mode 100644 index 90f091c..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-mdpi/ic_launcher.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_calendar.png b/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_calendar.png Binary files differdeleted file mode 100644 index d34b110..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_calendar.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_key.png b/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_key.png Binary files differdeleted file mode 100644 index 31c6756..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_key.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_lock.png b/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_lock.png Binary files differdeleted file mode 100644 index 63797e2..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_lock.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_save.png b/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_save.png Binary files differdeleted file mode 100644 index 2e7c579..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_save.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_search.png b/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_search.png Binary files differdeleted file mode 100644 index 3539eab..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_search.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_world.png b/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_world.png Binary files differdeleted file mode 100644 index e1b21d3..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_action_world.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_drawer.png b/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_drawer.png Binary files differdeleted file mode 100644 index e2dd13a..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_drawer.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_launcher.png b/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_launcher.png Binary files differdeleted file mode 100644 index 0f6604b..0000000 --- a/espresso/espresso-sample/src/main/res/drawable-xhdpi/ic_launcher.png +++ /dev/null diff --git a/espresso/espresso-sample/src/main/res/layout/actionbar_activity.xml b/espresso/espresso-sample/src/main/res/layout/actionbar_activity.xml deleted file mode 100644 index 41fa6fa..0000000 --- a/espresso/espresso-sample/src/main/res/layout/actionbar_activity.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="vertical" - android:padding="20dip" > - - <Button - android:id="@+id/show_contextual_action_bar" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:text="@string/text_show" /> - - <Button - android:id="@+id/hide_contextual_action_bar" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:text="@string/text_hide" /> - - <TextView - android:id="@+id/text_action_bar_result" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:layout_marginTop="20dp" - android:text="@string/text_empty" - android:textAppearance="?android:attr/textAppearanceSmall" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/delegating_edit_text.xml b/espresso/espresso-sample/src/main/res/layout/delegating_edit_text.xml deleted file mode 100644 index 8d4cb33..0000000 --- a/espresso/espresso-sample/src/main/res/layout/delegating_edit_text.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<merge xmlns:android="http://schemas.android.com/apk/res/android" > - - <EditText - android:id="@+id/delegate_edit_text" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:inputType="text" - android:singleLine="true" /> - - <TextView - android:id="@+id/edit_text_message" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:singleLine="false" - android:visibility="gone" /> - -</merge> diff --git a/espresso/espresso-sample/src/main/res/layout/display_activity.xml b/espresso/espresso-sample/src/main/res/layout/display_activity.xml deleted file mode 100644 index 5781524..0000000 --- a/espresso/espresso-sample/src/main/res/layout/display_activity.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<!-- XML for screen for displaying data received from another activity. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_alignParentTop="true" - android:orientation="vertical" > - - <TextView - android:id="@+id/display_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/display_title" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <TextView - android:id="@+id/display_data" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/display_data" - android:textAppearance="?android:attr/textAppearanceSmall" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/drawer_activity.xml b/espresso/espresso-sample/src/main/res/layout/drawer_activity.xml deleted file mode 100644 index ea5532d..0000000 --- a/espresso/espresso-sample/src/main/res/layout/drawer_activity.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<android.support.v4.widget.DrawerLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/drawer_layout" - android:layout_width="fill_parent" - android:layout_height="fill_parent" > - - <!-- The main content view --> - <FrameLayout - android:layout_width="match_parent" - android:layout_height="match_parent" > - <TextView - android:id="@+id/drawer_text_view" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - </FrameLayout> - - <ListView - android:id="@+id/drawer_list" - android:layout_width="240dp" - android:layout_height="match_parent" - android:layout_gravity="start" - android:choiceMode="singleChoice" - android:divider="@android:color/transparent" - android:dividerHeight="0dp" - android:background="#111" /> - -</android.support.v4.widget.DrawerLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/drawer_row.xml b/espresso/espresso-sample/src/main/res/layout/drawer_row.xml deleted file mode 100644 index f56a688..0000000 --- a/espresso/espresso-sample/src/main/res/layout/drawer_row.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="fill_horizontal|center_vertical" - android:gravity="fill_horizontal" - android:minHeight="70dip" - android:orientation="horizontal" > - - <TextView android:id="@+id/drawer_row_name" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_alignParentLeft="true" - android:gravity="left|center_vertical"/> -</RelativeLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/fragment_stack.xml b/espresso/espresso-sample/src/main/res/layout/fragment_stack.xml deleted file mode 100644 index 0861f87..0000000 --- a/espresso/espresso-sample/src/main/res/layout/fragment_stack.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="center_horizontal" - android:orientation="vertical" - android:padding="4dip" > - - <FrameLayout - android:id="@+id/simple_fragment" - android:layout_width="match_parent" - android:layout_height="0px" - android:layout_weight="1" > - </FrameLayout> - - <Button - android:id="@+id/new_fragment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="0" - android:text="Create New Fragment" > - - <requestFocus /> - </Button> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/gesture_activity.xml b/espresso/espresso-sample/src/main/res/layout/gesture_activity.xml deleted file mode 100644 index d2bf3f7..0000000 --- a/espresso/espresso-sample/src/main/res/layout/gesture_activity.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<!-- XML for screen providing ability to test different clicks and gestures. --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:fillViewport="true" - android:orientation="vertical" > - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" > - - <TextView - android:id="@+id/text_click" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:text="@string/text_click" - android:textAppearance="?android:attr/textAppearanceMedium" - android:visibility="gone" /> - - <TextView - android:id="@+id/text_long_click" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:text="@string/text_long_click" - android:textAppearance="?android:attr/textAppearanceMedium" - android:visibility="gone" /> - - <TextView - android:id="@+id/text_swipe" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:text="@string/text_swipe" - android:textAppearance="?android:attr/textAppearanceMedium" - android:visibility="gone" /> - - <TextView - android:id="@+id/text_double_click" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:text="@string/text_double_click" - android:textAppearance="?android:attr/textAppearanceMedium" - android:visibility="gone" /> - </LinearLayout> - - <View - android:id="@+id/gesture_area" - android:layout_width="fill_parent" - android:layout_height="0dp" - android:layout_weight="1" - android:clickable="true" - android:gravity="top" - android:onClick="areaClicked" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/list_activity.xml b/espresso/espresso-sample/src/main/res/layout/list_activity.xml deleted file mode 100644 index 20dfc5c..0000000 --- a/espresso/espresso-sample/src/main/res/layout/list_activity.xml +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<!-- XML for a screen with a list view. --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" - android:paddingBottom="48dp" - android:paddingTop="48dp" > - - <LinearLayout - android:layout_width="fill_parent" - android:layout_height="24dp" > - - <TextView - android:id="@+id/selection_row" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/row_label" /> - - <TextView - android:id="@+id/selection_row_value" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="12dp" /> - </LinearLayout> - - <LinearLayout - android:layout_width="fill_parent" - android:layout_height="24dp" > - - <TextView - android:id="@+id/selection_column" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/column_label" /> - - <TextView - android:id="@+id/selection_column_value" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="12dp" /> - </LinearLayout> - - <ListView - android:id="@+id/list" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/list_item.xml b/espresso/espresso-sample/src/main/res/layout/list_item.xml deleted file mode 100644 index d1cf1d9..0000000 --- a/espresso/espresso-sample/src/main/res/layout/list_item.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" > - - <TextView - android:id="@+id/item_content" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - - <TextView - android:id="@+id/item_size" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="50dp" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/menu_activity.xml b/espresso/espresso-sample/src/main/res/layout/menu_activity.xml deleted file mode 100644 index f47e76b..0000000 --- a/espresso/espresso-sample/src/main/res/layout/menu_activity.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="vertical" - android:padding="20dip" > - - <LinearLayout - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:gravity="center_horizontal" - android:orientation="horizontal" > - - <Button - android:id="@+id/popup_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginRight="10dp" - android:onClick="showPopup" - android:text="Click here for popup menu!" /> - </LinearLayout> - - <LinearLayout - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:gravity="center_horizontal" - android:orientation="horizontal" > - - <TextView - android:id="@+id/text_context_menu" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="long-click here for context menu!" - android:textAppearance="?android:attr/textAppearanceMedium" /> - </LinearLayout> - - <TextView - android:id="@+id/text_menu_result" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="20dp" - android:gravity="center" - android:text="@string/text_empty" - android:textAppearance="?android:attr/textAppearanceSmall" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/pager_activity.xml b/espresso/espresso-sample/src/main/res/layout/pager_activity.xml deleted file mode 100644 index 015b2fb..0000000 --- a/espresso/espresso-sample/src/main/res/layout/pager_activity.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/pager_layout" - android:layout_width="fill_parent" - android:layout_height="fill_parent" > - -</android.support.v4.view.ViewPager> diff --git a/espresso/espresso-sample/src/main/res/layout/pager_view.xml b/espresso/espresso-sample/src/main/res/layout/pager_view.xml deleted file mode 100644 index 0e8a802..0000000 --- a/espresso/espresso-sample/src/main/res/layout/pager_view.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" > - - <TextView - android:id="@+id/pager_content" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:gravity="center" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/popup_window.xml b/espresso/espresso-sample/src/main/res/layout/popup_window.xml deleted file mode 100644 index f596ecb..0000000 --- a/espresso/espresso-sample/src/main/res/layout/popup_window.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<!-- XML for screen providing ability to enter text and send some intents. --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="vertical" > - - <TextView - android:id="@+id/popup_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/popup_title" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/popup_window_text" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/scroll_activity.xml b/espresso/espresso-sample/src/main/res/layout/scroll_activity.xml deleted file mode 100644 index ecfee52..0000000 --- a/espresso/espresso-sample/src/main/res/layout/scroll_activity.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<!-- XML for screen that holds various scroll views. --> - -<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:fillViewport="true" - android:orientation="vertical" > - - <LinearLayout - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:orientation="vertical" > - - <TextView - android:id="@+id/top_left" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="top_left" /> - - <ScrollView - android:layout_width="fill_parent" - android:layout_height="50dp" - android:layout_marginTop="10dp" - android:background="#FFDDDDDD" - android:fillViewport="true" - android:orientation="vertical" > - - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="vertical" > - - <TextView - android:id="@+id/double_scroll" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="200dp" - android:text="double_scroll" - android:textColor="#000000" /> - </LinearLayout> - </ScrollView> - - <!-- Keep this on bottom to test scrolling to views that are not showing. --> - <!-- Huge top margin to guarantee this being out of view on large screen layout. --> - - <HorizontalScrollView - android:layout_width="fill_parent" - android:layout_height="50dp" - android:layout_marginTop="3000dp" - android:background="#FFDDDDDD" > - - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="horizontal" > - - <TextView - android:id="@+id/bottom_left" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="bottom_left" - android:textColor="#000000" /> - - <TextView - android:id="@+id/bottom_right" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="3000dp" - android:text="bottom_right" - android:textColor="#000000" /> - </LinearLayout> - </HorizontalScrollView> - </LinearLayout> - -</ScrollView> diff --git a/espresso/espresso-sample/src/main/res/layout/send_activity.xml b/espresso/espresso-sample/src/main/res/layout/send_activity.xml deleted file mode 100644 index 2e67143..0000000 --- a/espresso/espresso-sample/src/main/res/layout/send_activity.xml +++ /dev/null @@ -1,313 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<!-- - XML for screen providing ability to enter text, send some intents, - switch to gesture activity and test scroll down action. ---> - -<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:fillViewport="true" - android:orientation="vertical" > - - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="vertical" > - - <TextView - android:id="@+id/send_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:clickable="true" - android:onClick="sendData" - android:text="@string/send_title" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <EditText - android:id="@+id/send_data_edit_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:ems="10" - android:hint="@string/send_hint" /> - - <Button - android:id="@+id/send_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="sendData" - android:text="@string/button_send" /> - - <EditText - android:id="@+id/enter_data_edit_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:ems="10" - android:hint="@string/enter_hint" /> - - <TextView - android:id="@+id/enter_data_response_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <TextView - android:id="@+id/call" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/send_intent_to_call" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <EditText - android:id="@+id/send_data_to_call_edit_text" - android:layout_width="229dp" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:ems="10" - android:hint="@string/send_hint_for_call" /> - - <Button - android:id="@+id/send_to_call_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="sendDataToCall" - android:text="@string/button_call" /> - - <TextView - android:id="@+id/send_data_message" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/send_message" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <EditText - android:id="@+id/send_data_to_message_edit_text" - android:layout_width="290dp" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:ems="10" - android:hint="@string/send_hint" - android:text="@string/send_data_to_message_edit_text" /> - - <Button - android:id="@+id/send_message_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="sendMessage" - android:text="@string/button_to_message" /> - - <TextView - android:id="@+id/goto_browser" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/send_intent_to_browser" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <EditText - android:id="@+id/send_data_to_browser_edit_text" - android:layout_width="290dp" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:ems="10" - android:hint="@string/send_hint" /> - - <Button - android:id="@+id/send_to_browser_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="sendDataToBrowser" - android:text="@string/button_to_browser" /> - - <TextView - android:id="@+id/pick_contact_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/pick_title" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <Button - android:id="@+id/pick_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="pickContact" - android:text="@string/button_pick" /> - - <TextView - android:id="@+id/phone_number" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" /> - - <TextView - android:id="@+id/market" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/send_intent_to_market" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <EditText - android:id="@+id/send_to_market_data" - android:layout_width="229dp" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:ems="10" - android:hint="@string/send_hint_to_market" /> - - <Button - android:id="@+id/send_to_market_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="clickToMarket" - android:text="@string/button_market" /> - - <EditText - android:id="@+id/search_box" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:ems="10" - android:hint="search box" - android:imeOptions="actionSearch" - android:inputType="text" /> - - <TextView - android:id="@+id/search_result" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:visibility="invisible" /> - - <TextView - android:id="@+id/weird_text_title" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="Delegating Edit Text" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <com.google.android.apps.common.testing.ui.testapp.DelegatingEditText - android:id="@+id/delegating_edit_text" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" /> - - <TextView - android:id="@+id/gesture_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:text="@string/gesture_title" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <Button - android:id="@+id/go_to_gesture_activity" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="clickToGesture" - android:text="@string/button_gesture" /> - - <Button - android:id="@+id/scroll_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="clickToScroll" - android:text="@string/launch_scroll_activity" /> - - <Button - android:id="@+id/list_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="clickToList" - android:text="@string/launch_list_activity" /> - - <Button - android:id="@+id/make_alert_dialog" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="showDialog" - android:text="@string/make_alert_dialog_button" /> - - <Button - android:id="@+id/make_popup_menu_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="showPopupMenu" - android:text="@string/make_popup_menu_button" /> - - <Button - android:id="@+id/make_popup_view_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:onClick="showPopupView" - android:text="@string/make_popup_view_button" /> - - <AutoCompleteTextView - android:id="@+id/auto_complete_text_view" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:completionThreshold="1" - android:hint="@string/pick_water" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - - <!-- Keep this on bottom to test scrolling to views that are not showing. --> - <!-- Huge top margin to guarantee this being out of view on large screen layout. --> - - <Button - android:id="@+id/bottom_send_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="1000dp" - android:onClick="sendData" - android:text="@string/button_send_bottom" /> - - <TextView - android:id="@+id/bottom_send_text_view" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="1000dp" - android:clickable="true" - android:onClick="sendData" - android:text="@string/send_title" /> - </LinearLayout> - -</ScrollView> diff --git a/espresso/espresso-sample/src/main/res/layout/simple_activity.xml b/espresso/espresso-sample/src/main/res/layout/simple_activity.xml deleted file mode 100644 index 31aa760..0000000 --- a/espresso/espresso-sample/src/main/res/layout/simple_activity.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" > - - <Spinner - android:id="@+id/spinner_simple" - android:layout_width="fill_parent" - android:layout_height="wrap_content" /> - - <TextView - android:id="@+id/spinnertext_simple" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:text="" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <View - android:layout_width="1dp" - android:layout_height="30dp" /> - - <Button - android:id="@+id/button_simple" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:onClick="simpleButtonClicked" - android:text="@string/button_simple" /> - - <TextView - android:id="@+id/text_simple" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:text="@string/text_simple" - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <View - android:layout_width="1dp" - android:layout_height="30dp" /> - - <EditText - android:id="@+id/sendtext_simple" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:ems="10" - android:hint="@string/send_hint" /> - - <Button - android:id="@+id/send_simple" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:onClick="sendButtonClicked" - android:text="@string/button_send" /> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/swipe_activity.xml b/espresso/espresso-sample/src/main/res/layout/swipe_activity.xml deleted file mode 100644 index e7bfa76..0000000 --- a/espresso/espresso-sample/src/main/res/layout/swipe_activity.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" > - - <!-- With update to rev 19, swipe does not consistently work on small pagers - b/12113054 opened to investigate why this regressed .--> - <android.support.v4.view.ViewPager - android:id="@+id/small_pager" - android:layout_width="120dp" - android:layout_height="48dp" /> - - <RelativeLayout - android:layout_width="fill_parent" - android:layout_height="200dp"> - <android.support.v4.view.ViewPager - android:id="@+id/overlapped_pager" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:layout_alignParentTop="true" - android:layout_alignParentLeft="true"/> - <TextView - android:layout_width="50dp" - android:layout_height="fill_parent" - android:background="#CCCCCC" - android:layout_alignParentTop="true" - android:layout_alignParentLeft="true"/> - </RelativeLayout> - - <TextView - android:id="@+id/text_simple" - android:text="@string/text_simple" - android:layout_width="fill_parent" - android:layout_height="wrap_content"/> - -</LinearLayout> diff --git a/espresso/espresso-sample/src/main/res/layout/sync_activity.xml b/espresso/espresso-sample/src/main/res/layout/sync_activity.xml deleted file mode 100644 index 5642eee..0000000 --- a/espresso/espresso-sample/src/main/res/layout/sync_activity.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" > - - <Button - android:id="@+id/request_button" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:onClick="onRequestButtonClick" - android:text="@string/request_hello_world" /> - - <TextView - android:id="@+id/status_text" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:gravity="center" - android:textAppearance="?android:attr/textAppearanceMedium" /> - -</LinearLayout> - diff --git a/espresso/espresso-sample/src/main/res/menu/actionbar_activity_actions.xml b/espresso/espresso-sample/src/main/res/menu/actionbar_activity_actions.xml deleted file mode 100644 index 0358ffe..0000000 --- a/espresso/espresso-sample/src/main/res/menu/actionbar_activity_actions.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:yourapp="http://schemas.android.com/apk/res-auto" > - - <item - android:id="@+id/action_lock" - android:icon="@drawable/ic_action_lock" - android:title="Lock" - yourapp:showAsAction="ifRoom|withText"/> - <item - android:id="@+id/action_key" - android:icon="@drawable/ic_action_key" - android:title="Key" - yourapp:showAsAction="never"/> - <item - android:id="@+id/action_calendar" - android:icon="@drawable/ic_action_calendar" - android:title="Calendar" - yourapp:showAsAction="never"/> - -</menu> diff --git a/espresso/espresso-sample/src/main/res/menu/actionbar_context_actions.xml b/espresso/espresso-sample/src/main/res/menu/actionbar_context_actions.xml deleted file mode 100644 index 59233bb..0000000 --- a/espresso/espresso-sample/src/main/res/menu/actionbar_context_actions.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:yourapp="http://schemas.android.com/apk/res-auto" > - - <item - android:id="@+id/action_save" - android:icon="@drawable/ic_action_save" - android:title="Save" - yourapp:showAsAction="ifRoom|withText"/> - <item - android:id="@+id/action_search" - android:icon="@drawable/ic_action_search" - android:title="Search" - yourapp:showAsAction="never"/> - <item - android:id="@+id/action_world" - android:icon="@drawable/ic_action_world" - android:title="World" - yourapp:showAsAction="never"/> - -</menu> diff --git a/espresso/espresso-sample/src/main/res/menu/contextmenu.xml b/espresso/espresso-sample/src/main/res/menu/contextmenu.xml deleted file mode 100644 index 5d4137d..0000000 --- a/espresso/espresso-sample/src/main/res/menu/contextmenu.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<menu xmlns:android="http://schemas.android.com/apk/res/android" > - - <item - android:id="@+id/context_item1" - android:title="@string/context_item_1_text"> - </item> - <item - android:id="@+id/context_item2" - android:title="@string/context_item_2_text"> - </item> - <item - android:id="@+id/context_item3" - android:title="@string/context_item_3_text"> - </item> - -</menu> diff --git a/espresso/espresso-sample/src/main/res/menu/optionsmenu.xml b/espresso/espresso-sample/src/main/res/menu/optionsmenu.xml deleted file mode 100644 index 66ed1b2..0000000 --- a/espresso/espresso-sample/src/main/res/menu/optionsmenu.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<menu xmlns:android="http://schemas.android.com/apk/res/android" > - - <item - android:id="@+id/option_item1" - android:title="@string/options_item_1_text"> - </item> - <item - android:id="@+id/option_item2" - android:title="@string/options_item_2_text"> - </item> - <item - android:id="@+id/option_item3" - android:title="@string/options_item_3_text"> - </item> - -</menu> diff --git a/espresso/espresso-sample/src/main/res/menu/popup_menu.xml b/espresso/espresso-sample/src/main/res/menu/popup_menu.xml deleted file mode 100644 index 9bfb67f..0000000 --- a/espresso/espresso-sample/src/main/res/menu/popup_menu.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<menu xmlns:android="http://schemas.android.com/apk/res/android" > - - <item - android:id="@+id/menu_item_1" - android:title="@string/item_1_text"/> - <item - android:id="@+id/menu_item_2" - android:title="@string/item_2_text"/> - -</menu> diff --git a/espresso/espresso-sample/src/main/res/menu/popupmenu.xml b/espresso/espresso-sample/src/main/res/menu/popupmenu.xml deleted file mode 100644 index 0dae632..0000000 --- a/espresso/espresso-sample/src/main/res/menu/popupmenu.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<menu xmlns:android="http://schemas.android.com/apk/res/android" > - - <item - android:id="@+id/popup_item1" - android:title="@string/popup_item_1_text"> - </item> - <item - android:id="@+id/popup_item2" - android:title="@string/popup_item_2_text"> - </item> - <item - android:id="@+id/popup_item3" - android:title="@string/popup_item_3_text"> - </item> - -</menu> diff --git a/espresso/espresso-sample/src/main/res/values/strings.xml b/espresso/espresso-sample/src/main/res/values/strings.xml deleted file mode 100644 index e9d9ec5..0000000 --- a/espresso/espresso-sample/src/main/res/values/strings.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2014 The Android Open Source Project - ~ - ~ 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. - --> - -<resources> - - <string name="button_send">Send</string> - <string name="button_send_bottom">Send Bottom</string> - <string name="button_call">Call</string> - <string name="button_to_message">SMS</string> - <string name="button_to_browser">Go To Browser</string> - <string name="button_pick">Pick</string> - <string name="button_market">Goto Market</string> - <string name="button_gesture">Go To Gesture Activity</string> - <string name="button_simple">Click Me!</string> - <string name="display_data" /> - <string name="display_title">Data from sender</string> - <string name="dialog_title">An emergency alert</string> - <string name="dialog_message">A really important message</string> - <string name="enter_hint">Type text and press Enter</string> - <string name="launch_list_activity">Launch list_activity</string> - <string name="launch_scroll_activity">Launch scroll_activity</string> - <string name="send_data_to_message_edit_text">send_data_to_message_edit_text</string> - <string name="send_hint">Enter text here</string> - <string name="send_hint_for_call">Enter number here</string> - <string name="send_title">Send internal intent with data</string> - <string name="send_intent_to_call">Enter Number To Call</string> - <string name="send_intent_to_market">Enter App Id From Market</string> - <string name="send_intent_to_browser">Enter URL you wanted to go.</string> - <string name="send_hint_to_market">Enter App id</string> - <string name="send_message">Enter Message</string> - <string name="pick_title">Pick a Contact</string> - <string name="item_1_text">Menu Item 1</string> - <string name="item_2_text">Goodbye</string> - <string name="make_alert_dialog_button">Make an alert dialog</string> - <string name="make_popup_menu_button">Make a Popup Window</string> - <string name="make_popup_view_button">Make a Popup Window</string> - <string name="popup_window_text">I am in a popup window</string> - <string name="popup_title">A popup window</string> - <string name="gesture_title">Show Gesture Activity</string> - <string name="text_click">Click</string> - <string name="text_long_click">Long Click</string> - <string name="text_swipe">Swipe</string> - <string name="text_double_click">Double Click</string> - <string name="text_empty"></string> - <string name="text_show">Show context actionbar</string> - <string name="text_hide">Hide context actionbar</string> - <string name="text_simple">Message</string> - <string name="popup_item_1_text">Popup Item 1</string> - <string name="popup_item_2_text">Popup Item 2</string> - <string name="popup_item_3_text">Popup Item 3</string> - <string name="context_item_1_text">Context Item 1</string> - <string name="context_item_2_text">Context Item 2</string> - <string name="context_item_3_text">Context Item 3</string> - <string name="options_item_1_text">Options Item 1</string> - <string name="options_item_2_text">Options Item 2</string> - <string name="options_item_3_text">Options Item 3</string> - <string name="searching_for_label">Searching for:</string> - <string name="row_label">clicked on row:</string> - <string name="column_label">clicked on column:</string> - <string name="hello_world">hello world!</string> - <string name="request_hello_world">Request hello world</string> - <string name="nav_drawer_open">Open navigation drawer</string> - <string name="pick_water">Pick a body of water</string> - <string name="nav_drawer_close">Close navigation drawer</string> - - <string-array name="spinner_array"> - <item>Espresso</item> - <item>Doppio</item> - <item>Macchiato</item> - <item>Cappuccino</item> - <item>Americano</item> - <item>Mocha</item> - <item>Late</item> - </string-array> - -</resources> |