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