136545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley/* 236545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * Copyright (C) 2017 The Android Open Source Project 336545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * 436545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * Licensed under the Apache License, Version 2.0 (the "License"); 536545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * you may not use this file except in compliance with the License. 636545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * You may obtain a copy of the License at 736545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * 836545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * http://www.apache.org/licenses/LICENSE-2.0 936545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * 1036545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * Unless required by applicable law or agreed to in writing, software 1136545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * distributed under the License is distributed on an "AS IS" BASIS, 1236545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1336545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * See the License for the specific language governing permissions and 1436545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * limitations under the License. 1536545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley */ 1636545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley 1736545bb3f2b12af352e550c278cff9026a18ca54Sean Kelleypackage android.support.wear.widget.drawer; 1836545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley 1936545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley/** 2036545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * Provides the ability to manipulate a {@link WearableDrawerView WearableDrawerView's} position 2136545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * within a {@link WearableDrawerLayout}. 2236545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley */ 2336545bb3f2b12af352e550c278cff9026a18ca54Sean Kelleypublic class WearableDrawerController { 2436545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley 2536545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley private final WearableDrawerLayout mDrawerLayout; 2636545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley private final WearableDrawerView mDrawerView; 2736545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley 2836545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley WearableDrawerController(WearableDrawerLayout drawerLayout, WearableDrawerView drawerView) { 2936545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley mDrawerLayout = drawerLayout; 3036545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley mDrawerView = drawerView; 3136545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley } 3236545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley 3336545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley /** 3436545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * Requests that the {@link WearableDrawerView} be opened. 3536545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley */ 3636545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley public void openDrawer() { 3736545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley mDrawerLayout.openDrawer(mDrawerView); 3836545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley } 3936545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley 4036545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley /** 4136545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * Requests that the {@link WearableDrawerView} be closed. 4236545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley */ 4336545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley public void closeDrawer() { 4436545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley mDrawerLayout.closeDrawer(mDrawerView); 4536545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley } 4636545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley 4736545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley /** 4836545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley * Requests that the {@link WearableDrawerView} be peeked. 4936545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley */ 5036545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley public void peekDrawer() { 5136545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley mDrawerLayout.peekDrawer(mDrawerView); 5236545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley } 5336545bb3f2b12af352e550c278cff9026a18ca54Sean Kelley} 54