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.Display.Mode; 21import android.view.DisplayAdjustments; 22import android.view.DisplayInfo; 23import android.view.View; 24import android.view.WindowManager; 25 26public class WindowManagerImpl implements WindowManager { 27 28 private final DisplayMetrics mMetrics; 29 private final Display mDisplay; 30 31 public WindowManagerImpl(DisplayMetrics metrics) { 32 mMetrics = metrics; 33 34 DisplayInfo info = new DisplayInfo(); 35 info.logicalHeight = mMetrics.heightPixels; 36 info.logicalWidth = mMetrics.widthPixels; 37 info.supportedModes = new Mode[] { 38 new Mode(0, mMetrics.widthPixels, mMetrics.heightPixels, 60f) 39 }; 40 mDisplay = new Display(null, Display.DEFAULT_DISPLAY, info, 41 DisplayAdjustments.DEFAULT_DISPLAY_ADJUSTMENTS); 42 } 43 44 @Override 45 public Display getDefaultDisplay() { 46 return mDisplay; 47 } 48 49 50 @Override 51 public void addView(View arg0, android.view.ViewGroup.LayoutParams arg1) { 52 // pass 53 } 54 55 @Override 56 public void removeView(View arg0) { 57 // pass 58 } 59 60 @Override 61 public void updateViewLayout(View arg0, android.view.ViewGroup.LayoutParams arg1) { 62 // pass 63 } 64 65 66 @Override 67 public void removeViewImmediate(View arg0) { 68 // pass 69 } 70 71 @Override 72 public void requestAppKeyboardShortcuts( 73 KeyboardShortcutsReceiver receiver, int deviceId) { 74 } 75} 76