WindowManagerImpl.java revision fcd7e80b21cc9db6be00e37371401ea1d0938796
1/*
2 * Copyright (C) 2012 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 */
16package com.android.layoutlib.bridge.android.view;
17
18import android.util.DisplayMetrics;
19import android.view.Display;
20import android.view.DisplayAdjustments;
21import android.view.DisplayInfo;
22import android.view.View;
23import android.view.WindowManager;
24
25public class WindowManagerImpl implements WindowManager {
26
27    private final DisplayMetrics mMetrics;
28    private final Display mDisplay;
29
30    public WindowManagerImpl(DisplayMetrics metrics) {
31        mMetrics = metrics;
32
33        DisplayInfo info = new DisplayInfo();
34        info.logicalHeight = mMetrics.heightPixels;
35        info.logicalWidth = mMetrics.widthPixels;
36        mDisplay = new Display(null, Display.DEFAULT_DISPLAY, info,
37                DisplayAdjustments.DEFAULT_DISPLAY_ADJUSTMENTS);
38    }
39
40    @Override
41    public Display getDefaultDisplay() {
42        return mDisplay;
43    }
44
45
46    @Override
47    public void addView(View arg0, android.view.ViewGroup.LayoutParams arg1) {
48        // pass
49    }
50
51    @Override
52    public void removeView(View arg0) {
53        // pass
54    }
55
56    @Override
57    public void updateViewLayout(View arg0, android.view.ViewGroup.LayoutParams arg1) {
58        // pass
59    }
60
61
62    @Override
63    public void removeViewImmediate(View arg0) {
64        // pass
65    }
66
67    @Override
68    public void requestAppKeyboardShortcuts(
69            KeyboardShortcutsReceiver receiver, int deviceId) {
70    }
71}
72