当前位置:   article > 正文

framework 窗口动画缩放修改(Android 10)_安卓10默认动画缩放

安卓10默认动画缩放

framework 窗口动画缩放修改(Android 10)

窗口缩放方法

// 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);
                    
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/812810
推荐阅读
相关标签
  

闽ICP备14008679号