• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 
17 package android.platform.helpers;
18 
19 import android.support.test.uiautomator.Direction;
20 
21 public interface ICalendarHelper extends IAppHelper {
22     // Enumeration of the available Calendar pages.
23     public enum Page { DAY, MONTH, SCHEDULE, THREE_DAY, WEEK }
24 
25     /**
26      * Setup expectations: Calendar is open with all menus closed.
27      * <p>
28      * Opens the navigation drawer.
29      */
openNavigationDrawer()30     public void openNavigationDrawer();
31 
32     /**
33      * Setup expectations: Calendar is open and the navigation drawer is open.
34      * <p>
35      * Closes the navigation drawer.
36      */
closeNavigationDrawer()37     public void closeNavigationDrawer();
38 
39     /**
40      * Setup expectations: Calendar is open on a page other than {@link Page.MONTH} with all menus
41      * closed.
42      * <p>
43      * Opens the month dropdown.
44      */
openMonthDropdown()45     public void openMonthDropdown();
46 
47     /**
48      * Setup expectations: Calendar is open on a page other than {@link Page.MONTH} and the month
49      * dropdown is open.
50      * <p>
51      * Closes the month dropdown.
52      */
closeMonthDropdown()53     public void closeMonthDropdown();
54 
55     /**
56      * Setup expectations: Calendar is open with all menus closed.
57      * <p>
58      * Opens the {@link FloatingActionButton} menu.
59      */
openActionMenu()60     public void openActionMenu();
61 
62     /**
63      * Setup expectations: Calendar is open and the action menu is open.
64      * <p>
65      * Closes the {@link FloatingActionButton} menu.
66      */
closeActionMenu()67     public void closeActionMenu();
68 
69     /**
70      * Setup expectations: Calendar is open and the navigation drawer is open.
71      * <p>
72      * Flings the navigation drawer in the supplied {@link Direction}.
73      * <p>
74      * @param dir the {@link Direction} to fling the drawer.
75      */
flingNavigationDrawer(Direction dir)76     public void flingNavigationDrawer(Direction dir);
77 
78     /**
79      * Setup expectations: Calendar is open and the navigation drawer is open.
80      * <p>
81      * Selects the supplied {@link Page} from the navigation drawer.
82      * <p>
83      * @param page the {@link Page} or layout to select.
84      */
selectPage(Page page)85     public void selectPage(Page page);
86 
87     /**
88      * Setup expectations: Calendar is open on the supplied {@link Page} with all menus closed.
89      * <p>
90      * Flings the supplied {@link Page} in the supplied {@link Direction}.
91      * <p>
92      * @param page the {@link Page} or layout to select.
93      * @param dir the {@link Direction} to fling in.
94      */
flingPage(Page page, Direction dir)95     public void flingPage(Page page, Direction dir);
96 }
97