aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CustomActions.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-06-14 15:05:47 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-06-17 18:52:19 +0200
commit6f47c78981efd8e135e3e3cf2b5818bfd17970d4 (patch)
tree5e7af6ab5dd4f13f0da4a454e011250ce059093e /OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CustomActions.java
parent442aed8a2d2c26b45e294fdaf8b4a5b6b72cdf14 (diff)
downloadopen-keychain-6f47c78981efd8e135e3e3cf2b5818bfd17970d4.tar.gz
open-keychain-6f47c78981efd8e135e3e3cf2b5818bfd17970d4.tar.bz2
open-keychain-6f47c78981efd8e135e3e3cf2b5818bfd17970d4.zip
stash away stuff
Diffstat (limited to 'OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CustomActions.java')
-rw-r--r--OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CustomActions.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CustomActions.java b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CustomActions.java
new file mode 100644
index 000000000..13c092b85
--- /dev/null
+++ b/OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/actions/CustomActions.java
@@ -0,0 +1,54 @@
+package org.sufficientlysecure.keychain.actions;
+
+
+import android.support.test.espresso.UiController;
+import android.support.test.espresso.ViewAction;
+import android.support.test.espresso.matcher.ViewMatchers;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.view.View;
+
+import org.hamcrest.Matcher;
+
+
+public abstract class CustomActions {
+
+ public static ViewAction actionOpenDrawer() {
+ return new ViewAction() {
+ @Override
+ public Matcher<View> getConstraints() {
+ return ViewMatchers.isAssignableFrom(DrawerLayout.class);
+ }
+
+ @Override
+ public String getDescription() {
+ return "open drawer";
+ }
+
+ @Override
+ public void perform(UiController uiController, View view) {
+ ((DrawerLayout) view).openDrawer(GravityCompat.START);
+ }
+ };
+ }
+
+ public static ViewAction actionCloseDrawer() {
+ return new ViewAction() {
+ @Override
+ public Matcher<View> getConstraints() {
+ return ViewMatchers.isAssignableFrom(DrawerLayout.class);
+ }
+
+ @Override
+ public String getDescription() {
+ return "close drawer";
+ }
+
+ @Override
+ public void perform(UiController uiController, View view) {
+ ((DrawerLayout) view).closeDrawer(GravityCompat.START);
+ }
+ };
+ }
+
+} \ No newline at end of file