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