10bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta/* 20bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * Copyright (C) 2014 The Android Open Source Project 30bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * 40bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * Licensed under the Apache License, Version 2.0 (the "License"); 50bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * you may not use this file except in compliance with the License. 60bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * You may obtain a copy of the License at 70bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * 80bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * http://www.apache.org/licenses/LICENSE-2.0 90bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * 100bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * Unless required by applicable law or agreed to in writing, software 110bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * distributed under the License is distributed on an "AS IS" BASIS, 120bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * See the License for the specific language governing permissions and 140bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * limitations under the License. 150bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta */ 160bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 170bffc736e1f260724764d31f7499cbc09471a535Deepanshu Guptapackage android.view; 180bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 19b2d135694f5a2979e7acef48255a6ea10f749dd2Wale Ogunwaleimport android.annotation.Nullable; 200bffc736e1f260724764d31f7499cbc09471a535Deepanshu Guptaimport android.view.ActionMode.Callback; 210bffc736e1f260724764d31f7499cbc09471a535Deepanshu Guptaimport android.view.WindowManager.LayoutParams; 220bffc736e1f260724764d31f7499cbc09471a535Deepanshu Guptaimport android.view.accessibility.AccessibilityEvent; 230bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 24b2d135694f5a2979e7acef48255a6ea10f749dd2Wale Ogunwaleimport java.util.List; 25b2d135694f5a2979e7acef48255a6ea10f749dd2Wale Ogunwale 260bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta/** 270bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta * An empty implementation of {@link Window.Callback} that always returns null/false. 280bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta */ 290bffc736e1f260724764d31f7499cbc09471a535Deepanshu Guptapublic class WindowCallback implements Window.Callback { 300bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 310bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean dispatchKeyEvent(KeyEvent event) { 320bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 330bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 340bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 350bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 360bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean dispatchKeyShortcutEvent(KeyEvent event) { 370bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 380bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 390bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 400bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 410bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean dispatchTouchEvent(MotionEvent event) { 420bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 430bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 440bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 450bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 460bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean dispatchTrackballEvent(MotionEvent event) { 470bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 480bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 490bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 500bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 510bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean dispatchGenericMotionEvent(MotionEvent event) { 520bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 530bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 540bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 550bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 560bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { 570bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 580bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 590bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 600bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 610bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public View onCreatePanelView(int featureId) { 620bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return null; 630bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 640bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 650bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 660bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean onCreatePanelMenu(int featureId, Menu menu) { 670bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 680bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 690bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 700bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 710bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean onPreparePanel(int featureId, View view, Menu menu) { 720bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 730bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 740bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 750bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 760bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean onMenuOpened(int featureId, Menu menu) { 770bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 780bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 790bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 800bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 810bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean onMenuItemSelected(int featureId, MenuItem item) { 820bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 830bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 840bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 850bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 860bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public void onWindowAttributesChanged(LayoutParams attrs) { 870bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 880bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 890bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 900bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 910bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public void onContentChanged() { 920bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 930bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 940bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 950bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 960bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public void onWindowFocusChanged(boolean hasFocus) { 970bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 980bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 990bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1000bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 1010bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public void onAttachedToWindow() { 1020bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1030bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 1040bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1050bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 1060bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public void onDetachedFromWindow() { 1070bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1080bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 1090bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1100bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 1110bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public void onPanelClosed(int featureId, Menu menu) { 1120bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1130bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 1140bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1150bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 1166a975b3c3597a4ad9202432f3c3d867a03d43fa4Tim Kilbourn public boolean onSearchRequested(SearchEvent searchEvent) { 1176a975b3c3597a4ad9202432f3c3d867a03d43fa4Tim Kilbourn return onSearchRequested(); 1186a975b3c3597a4ad9202432f3c3d867a03d43fa4Tim Kilbourn } 1196a975b3c3597a4ad9202432f3c3d867a03d43fa4Tim Kilbourn 1206a975b3c3597a4ad9202432f3c3d867a03d43fa4Tim Kilbourn @Override 1210bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public boolean onSearchRequested() { 1220bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return false; 1230bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 1240bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1250bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 1260bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public ActionMode onWindowStartingActionMode(Callback callback) { 1270bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta return null; 1280bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 1290bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1300bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 1314423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri public ActionMode onWindowStartingActionMode(Callback callback, int type) { 1324423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri return null; 1334423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri } 1344423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri 1354423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri @Override 1360bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public void onActionModeStarted(ActionMode mode) { 1370bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1380bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 1390bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1400bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta @Override 1410bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta public void onActionModeFinished(ActionMode mode) { 1420bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta 1430bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta } 1440bffc736e1f260724764d31f7499cbc09471a535Deepanshu Gupta} 145