赞
踩
窗口缩放方法
// frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java final WindowHashMap mWindowMap = new WindowHashMap(); public void performAnimationByHome(boolean enterScale) { Log.i("scale_wms", enterScale ? "performAnimationByHome enter scale mode" : "exit scale mode"); Animation[] anims = enterScale ? mPolicy.createHomeScaleAnimation() : mPolicy.createHomeScaleExitAnimation(); for (Animation anim : anims) { anim.setFillAfter(true); anim.setFillBefore(false); } Animation homeAnimation = anims[0]; Collection<WindowState> windowStates = mWindowMap.values(); Log.i("scale_wms" + TAG, "performAnimationByHome windowStates size:" + windowStates.size()); for (WindowState windowState : windowStates) { WindowToken windowToken = windowState.mToken; if (windowToken.windowType == TYPE_NAVIGATION_BAR) { mNavBarWindow = windowToken; } else if(windowToken.windowType == TYPE_STATUS_BAR){ mStatusBarWindow = windowToken; } else if(windowToken.windowType == TYPE_WALLPAPER){ mWallpaperWindowToken = (WallpaperWindowToken) windowToken; } else if (windowToken.windowType == TYPE_APPLICATION) { if (windowToken instanceof AppWindowToken) { AppWindowToken appWindowToken = (AppWindowToken) windowToken; String pkgName = appWindowToken.mActivityRecord.appInfo.packageName; if (appWindowToken.isActivityTypeHome()) { mHomeAppWindowToken = appWindowToken; } else if (appWindowToken.getTask().isFloating()) { Log.i("scale_wms" + TAG, "Task is floating: pkgName:" + pkgName); } else if(appWindowToken.getTask().isVisible() && appWindowToken.getTask().hasContentToDisplay()){ Log.i("scale_wms", "other app startAnimation()"); for (int ndx = appWindowToken.mChildren.size() - 1; ndx >= 0; ndx--) { final WindowState childWindowState = appWindowToken.mChildren.get(ndx); childWindowState.startAnimation(homeAnimation);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。