1 /* 2 * Copyright (C) 2014 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.view; 18 19 import android.view.ActionMode.Callback; 20 import android.view.WindowManager.LayoutParams; 21 import android.view.accessibility.AccessibilityEvent; 22 23 /** 24 * An empty implementation of {@link Window.Callback} that always returns null/false. 25 */ 26 public class WindowCallback implements Window.Callback { 27 @Override 28 public boolean dispatchKeyEvent(KeyEvent event) { 29 return false; 30 } 31 32 @Override 33 public boolean dispatchKeyShortcutEvent(KeyEvent event) { 34 return false; 35 } 36 37 @Override 38 public boolean dispatchTouchEvent(MotionEvent event) { 39 return false; 40 } 41 42 @Override 43 public boolean dispatchTrackballEvent(MotionEvent event) { 44 return false; 45 } 46 47 @Override 48 public boolean dispatchGenericMotionEvent(MotionEvent event) { 49 return false; 50 } 51 52 @Override 53 public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { 54 return false; 55 } 56 57 @Override 58 public View onCreatePanelView(int featureId) { 59 return null; 60 } 61 62 @Override 63 public boolean onCreatePanelMenu(int featureId, Menu menu) { 64 return false; 65 } 66 67 @Override 68 public boolean onPreparePanel(int featureId, View view, Menu menu) { 69 return false; 70 } 71 72 @Override 73 public boolean onMenuOpened(int featureId, Menu menu) { 74 return false; 75 } 76 77 @Override 78 public boolean onMenuItemSelected(int featureId, MenuItem item) { 79 return false; 80 } 81 82 @Override 83 public void onWindowAttributesChanged(LayoutParams attrs) { 84 85 } 86 87 @Override 88 public void onContentChanged() { 89 90 } 91 92 @Override 93 public void onWindowFocusChanged(boolean hasFocus) { 94 95 } 96 97 @Override 98 public void onAttachedToWindow() { 99 100 } 101 102 @Override 103 public void onDetachedFromWindow() { 104 105 } 106 107 @Override 108 public void onPanelClosed(int featureId, Menu menu) { 109 110 } 111 112 @Override 113 public boolean onSearchRequested() { 114 return false; 115 } 116 117 @Override 118 public ActionMode onWindowStartingActionMode(Callback callback) { 119 return null; 120 } 121 122 @Override 123 public void onActionModeStarted(ActionMode mode) { 124 125 } 126 127 @Override 128 public void onActionModeFinished(ActionMode mode) { 129 130 } 131 } 132