最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android WindowManger的層級(jí)分析詳解

 更新時(shí)間:2021年09月09日 14:12:26   作者:原來(lái)是圖哥  
這篇文章主要介紹了Android WindowManger的層級(jí)分析詳解,本篇文章通過(guò)簡(jiǎn)要的案例,講解了該項(xiàng)技術(shù)的了解與使用,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下

一. Window 分類

  • 應(yīng)用 WindowApplicationWindow: 對(duì)應(yīng)一個(gè) Acitivity
  • 子 Window    SubWindow:不能單獨(dú)存在,需要依附在特定的父 Window 中,比如常見(jiàn)的一些 Dialog 就是一個(gè)子 Window
  • 系統(tǒng) Window SystemWindow:需要聲明權(quán)限才能創(chuàng)建的 Window,比如 Toast 和系統(tǒng)狀態(tài)欄都是系統(tǒng) Window

二. Window層級(jí)

Window 是分層的,每個(gè) Window 都有對(duì)應(yīng)的 z-ordered,層級(jí)大的會(huì)覆蓋在層級(jí)小的 Window 上面,這和 HTML 中的 z-index 概念是完全一致的。

在三種 Window 中,每一種Window的層級(jí)范圍也是不同的,如下:

應(yīng)用Window    1~99

子Window        1000~1999

系統(tǒng)Window    2000~2999

這些層級(jí)范圍對(duì)應(yīng)著 WindowManager.LayoutParams type 參數(shù),如果想要 Window 位于所有 Window 的最頂層,那么采用較大的層級(jí)即可,很顯然系統(tǒng) Window 的層級(jí)是最大的,當(dāng)我們采用系統(tǒng)層級(jí)時(shí),需要聲明權(quán)限。

(1)應(yīng)用程序窗口:

package android.view;
public interface WindowManager
        /**
         * Start of window types that represent normal application windows.
         */
        public static final int FIRST_APPLICATION_WINDOW = 1;
 
        /**
         * Window type: an application window that serves as the "base" window
         * of the overall application; all other application windows will
         * appear on top of it.
         * In multiuser systems shows only on the owning user's window.
         */
        public static final int TYPE_BASE_APPLICATION   = 1;
 
        /**
         * Window type: a normal application window.  The {@link #token} must be
         * an Activity token identifying who the window belongs to.
         * In multiuser systems shows only on the owning user's window.
         */
        public static final int TYPE_APPLICATION        = 2;
 
        /**
         * Window type: special application window that is displayed while the
         * application is starting.  Not for use by applications themselves;
         * this is used by the system to display something until the
         * application can show its own windows.
         * In multiuser systems shows on all users' windows.
         */
        public static final int TYPE_APPLICATION_STARTING = 3;
 
        /**
         * Window type: a variation on TYPE_APPLICATION that ensures the window
         * manager will wait for this window to be drawn before the app is shown.
         * In multiuser systems shows only on the owning user's window.
         */
        public static final int TYPE_DRAWN_APPLICATION = 4;
 
        /**
         * End of types of application windows.
         */
        public static final int LAST_APPLICATION_WINDOW = 99;

(2)子窗口:

package android.view;
public interface WindowManager
        /**
         * Start of types of sub-windows.  The {@link #token} of these windows
         * must be set to the window they are attached to.  These types of
         * windows are kept next to their attached window in Z-order, and their
         * coordinate space is relative to their attached window.
         */
        public static final int FIRST_SUB_WINDOW = 1000;
 
        /**
         * Window type: a panel on top of an application window.  These windows
         * appear on top of their attached window.
         */
        public static final int TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW;
 
        /**
         * Window type: window for showing media (such as video).  These windows
         * are displayed behind their attached window.
         */
        public static final int TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW + 1;
 
        /**
         * Window type: a sub-panel on top of an application window.  These
         * windows are displayed on top their attached window and any
         * {@link #TYPE_APPLICATION_PANEL} panels.
         */
        public static final int TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW + 2;
 
        /** Window type: like {@link #TYPE_APPLICATION_PANEL}, but layout
         * of the window happens as that of a top-level window, <em>not</em>
         * as a child of its container.
         */
        public static final int TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW + 3;
 
        /**
         * Window type: window for showing overlays on top of media windows.
         * These windows are displayed between TYPE_APPLICATION_MEDIA and the
         * application window.  They should be translucent to be useful.  This
         * is a big ugly hack so:
         * @hide
         */
        @UnsupportedAppUsage
        public static final int TYPE_APPLICATION_MEDIA_OVERLAY  = FIRST_SUB_WINDOW + 4;
 
        /**
         * Window type: a above sub-panel on top of an application window and it's
         * sub-panel windows. These windows are displayed on top of their attached window
         * and any {@link #TYPE_APPLICATION_SUB_PANEL} panels.
         * @hide
         */
        public static final int TYPE_APPLICATION_ABOVE_SUB_PANEL = FIRST_SUB_WINDOW + 5;
 
        /**
         * End of types of sub-windows.
         */
        public static final int LAST_SUB_WINDOW = 1999;

(3)系統(tǒng)窗口:

package android.view;
public interface WindowManager
        /**
         * Start of system-specific window types.  These are not normally
         * created by applications.
         */
        public static final int FIRST_SYSTEM_WINDOW     = 2000;
 
        /**
         * Window type: the status bar.  There can be only one status bar
         * window; it is placed at the top of the screen, and all other
         * windows are shifted down so they are below it.
         * In multiuser systems shows on all users' windows.
         */
        public static final int TYPE_STATUS_BAR         = FIRST_SYSTEM_WINDOW;
 
        /**
         * Window type: the search bar.  There can be only one search bar
         * window; it is placed at the top of the screen.
         * In multiuser systems shows on all users' windows.
         */
        public static final int TYPE_SEARCH_BAR         = FIRST_SYSTEM_WINDOW+1;
 
        /**
         * Window type: phone.  These are non-application windows providing
         * user interaction with the phone (in particular incoming calls).
         * These windows are normally placed above all applications, but behind
         * the status bar.
         * In multiuser systems shows on all users' windows.
         * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead.
         */
        @Deprecated
        public static final int TYPE_PHONE              = FIRST_SYSTEM_WINDOW+2;
 
        /**
         * Window type: system window, such as low power alert. These windows
         * are always on top of application windows.
         * In multiuser systems shows only on the owning user's window.
         * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead.
         */
        @Deprecated
        public static final int TYPE_SYSTEM_ALERT       = FIRST_SYSTEM_WINDOW+3;
 
        /**
         * Window type: keyguard window.
         * In multiuser systems shows on all users' windows.
         * @removed
         */
        public static final int TYPE_KEYGUARD           = FIRST_SYSTEM_WINDOW+4;
 
        /**
         * Window type: transient notifications.
         * In multiuser systems shows only on the owning user's window.
         * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead.
         */
        @Deprecated
        public static final int TYPE_TOAST              = FIRST_SYSTEM_WINDOW+5;
 
        /**
         * Window type: system overlay windows, which need to be displayed
         * on top of everything else.  These windows must not take input
         * focus, or they will interfere with the keyguard.
         * In multiuser systems shows only on the owning user's window.
         * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead.
         */
        @Deprecated
        public static final int TYPE_SYSTEM_OVERLAY     = FIRST_SYSTEM_WINDOW+6;
 
        /**
         * Window type: priority phone UI, which needs to be displayed even if
         * the keyguard is active.  These windows must not take input
         * focus, or they will interfere with the keyguard.
         * In multiuser systems shows on all users' windows.
         * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead.
         */
        @Deprecated
        public static final int TYPE_PRIORITY_PHONE     = FIRST_SYSTEM_WINDOW+7;
 
        /**
         * Window type: panel that slides out from the status bar
         * In multiuser systems shows on all users' windows.
         */
        public static final int TYPE_SYSTEM_DIALOG      = FIRST_SYSTEM_WINDOW+8;
 
        /**
         * Window type: dialogs that the keyguard shows
         * In multiuser systems shows on all users' windows.
         */
        public static final int TYPE_KEYGUARD_DIALOG    = FIRST_SYSTEM_WINDOW+9;
 
        /**
         * Window type: internal system error windows, appear on top of
         * everything they can.
         * In multiuser systems shows only on the owning user's window.
         * @deprecated for non-system apps. Use {@link #TYPE_APPLICATION_OVERLAY} instead.
         */
        @Deprecated
        public static final int TYPE_SYSTEM_ERROR       = FIRST_SYSTEM_WINDOW+10;
 
        /**
         * Window type: internal input methods windows, which appear above
         * the normal UI.  Application windows may be resized or panned to keep
         * the input focus visible while this window is displayed.
         * In multiuser systems shows only on the owning user's window.
         */
        public static final int TYPE_INPUT_METHOD       = FIRST_SYSTEM_WINDOW+11;
 
        /**
         * Window type: internal input methods dialog windows, which appear above
         * the current input method window.
         * In multiuser systems shows only on the owning user's window.
         */
        public static final int TYPE_INPUT_METHOD_DIALOG= FIRST_SYSTEM_WINDOW+12;
 
        /**
         * Window type: wallpaper window, placed behind any window that wants
         * to sit on top of the wallpaper.
         * In multiuser systems shows only on the owning user's window.
         */
        public static final int TYPE_WALLPAPER          = FIRST_SYSTEM_WINDOW+13;
 
        /**
         * Window type: panel that slides out from over the status bar
         * In multiuser systems shows on all users' windows.
         */
        public static final int TYPE_STATUS_BAR_PANEL   = FIRST_SYSTEM_WINDOW+14;
 
        /**
         * Window type: secure system overlay windows, which need to be displayed
         * on top of everything else.  These windows must not take input
         * focus, or they will interfere with the keyguard.
         *
         * This is exactly like {@link #TYPE_SYSTEM_OVERLAY} except that only the
         * system itself is allowed to create these overlays.  Applications cannot
         * obtain permission to create secure system overlays.
         *
         * In multiuser systems shows only on the owning user's window.
         * @hide
         */
        @UnsupportedAppUsage
        public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15;
 
        /**
         * Window type: the drag-and-drop pseudowindow.  There is only one
         * drag layer (at most), and it is placed on top of all other windows.
         * In multiuser systems shows only on the owning user's window.
         * @hide
         */
        public static final int TYPE_DRAG               = FIRST_SYSTEM_WINDOW+16;
 
        /**
         * Window type: panel that slides out from over the status bar
         * In multiuser systems shows on all users' windows. These windows
         * are displayed on top of the stauts bar and any {@link #TYPE_STATUS_BAR_PANEL}
         * windows.
         * @hide
         */
        public static final int TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17;
 
        /**
         * Window type: (mouse) pointer
         * In multiuser systems shows on all users' windows.
         * @hide
         */
        public static final int TYPE_POINTER = FIRST_SYSTEM_WINDOW+18;
 
        /**
         * Window type: Navigation bar (when distinct from status bar)
         * In multiuser systems shows on all users' windows.
         * @hide
         */
        public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19;
 
        /**
         * Window type: The volume level overlay/dialog shown when the user
         * changes the system volume.
         * In multiuser systems shows on all users' windows.
         * @hide
         */
        public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20;
 
        /**
         * Window type: The boot progress dialog, goes on top of everything
         * in the world.
         * In multiuser systems shows on all users' windows.
         * @hide
         */
        public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21;
 
        /**
         * Window type to consume input events when the systemUI bars are hidden.
         * In multiuser systems shows on all users' windows.
         * @hide
         */
        public static final int TYPE_INPUT_CONSUMER = FIRST_SYSTEM_WINDOW+22;
 
        /**
         * Window type: Dreams (screen saver) window, just above keyguard.
         * In multiuser systems shows only on the owning user's window.
         * @hide
         */
        public static final int TYPE_DREAM = FIRST_SYSTEM_WINDOW+23;
 
        /**
         * Window type: Navigation bar panel (when navigation bar is distinct from status bar)
         * In multiuser systems shows on all users' windows.
         * @hide
         */
        public static final int TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW+24;
 
        /**
         * Window type: Display overlay window.  Used to simulate secondary display devices.
         * In multiuser systems shows on all users' windows.
         * @hide
         */
        @UnsupportedAppUsage
        public static final int TYPE_DISPLAY_OVERLAY = FIRST_SYSTEM_WINDOW+26;
 
        /**
         * Window type: Magnification overlay window. Used to highlight the magnified
         * portion of a display when accessibility magnification is enabled.
         * In multiuser systems shows on all users' windows.
         * @hide
         */
        public static final int TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW+27;
 
        /**
         * Window type: Window for Presentation on top of private
         * virtual display.
         */
        public static final int TYPE_PRIVATE_PRESENTATION = FIRST_SYSTEM_WINDOW+30;
 
        /**
         * Window type: Windows in the voice interaction layer.
         * @hide
         */
        public static final int TYPE_VOICE_INTERACTION = FIRST_SYSTEM_WINDOW+31;
 
        /**
         * Window type: Windows that are overlaid <em>only</em> by a connected {@link
         * android.accessibilityservice.AccessibilityService} for interception of
         * user interactions without changing the windows an accessibility service
         * can introspect. In particular, an accessibility service can introspect
         * only windows that a sighted user can interact with which is they can touch
         * these windows or can type into these windows. For example, if there
         * is a full screen accessibility overlay that is touchable, the windows
         * below it will be introspectable by an accessibility service even though
         * they are covered by a touchable window.
         */
        public static final int TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW+32;
 
        /**
         * Window type: Starting window for voice interaction layer.
         * @hide
         */
        public static final int TYPE_VOICE_INTERACTION_STARTING = FIRST_SYSTEM_WINDOW+33;
 
        /**
         * Window for displaying a handle used for resizing docked stacks. This window is owned
         * by the system process.
         * @hide
         */
        public static final int TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW+34;
 
        /**
         * Window type: like {@link #TYPE_APPLICATION_ATTACHED_DIALOG}, but used
         * by Quick Settings Tiles.
         * @hide
         */
        public static final int TYPE_QS_DIALOG = FIRST_SYSTEM_WINDOW+35;
 
        /**
         * Window type: shares similar characteristics with {@link #TYPE_DREAM}. The layer is
         * reserved for screenshot region selection. These windows must not take input focus.
         * @hide
         */
        public static final int TYPE_SCREENSHOT = FIRST_SYSTEM_WINDOW + 36;
 
        /**
         * Window type: Window for Presentation on an external display.
         * @see android.app.Presentation
         * @hide
         */
        public static final int TYPE_PRESENTATION = FIRST_SYSTEM_WINDOW + 37;
 
        /**
         * Window type: Application overlay windows are displayed above all activity windows
         * (types between {@link #FIRST_APPLICATION_WINDOW} and {@link #LAST_APPLICATION_WINDOW})
         * but below critical system windows like the status bar or IME.
         * <p>
         * The system may change the position, size, or visibility of these windows at anytime
         * to reduce visual clutter to the user and also manage resources.
         * <p>
         * Requires {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission.
         * <p>
         * The system will adjust the importance of processes with this window type to reduce the
         * chance of the low-memory-killer killing them.
         * <p>
         * In multi-user systems shows only on the owning user's screen.
         */
        public static final int TYPE_APPLICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 38;
 
        /**
         * End of types of system windows.
         */
        public static final int LAST_SYSTEM_WINDOW      = 2999;

 窗口顯示順序:
Type 值越大層級(jí)越高,Type 值大的覆蓋 Type 值小的,這只是一般規(guī)律。

(三)如何真正查看 Window 的優(yōu)先級(jí)

/frameworks/base/services/core/java/com/android/server/policy/WindowManagerPolicy.java
    default int getWindowLayerFromTypeLw(int type, boolean canAddInternalSystemWindow) {
        if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
            return APPLICATION_LAYER;
        }
        switch (type) {
            case TYPE_WALLPAPER:
                // wallpaper is at the bottom, though the window manager may move it.
                return  1;
            case TYPE_PRESENTATION:
            case TYPE_PRIVATE_PRESENTATION:
                return  APPLICATION_LAYER;
            case TYPE_DOCK_DIVIDER:
                return  APPLICATION_LAYER;
            case TYPE_QS_DIALOG:
                return  APPLICATION_LAYER;
            case TYPE_PHONE:
                return  3;
            case TYPE_SEARCH_BAR:
            case TYPE_VOICE_INTERACTION_STARTING:
                return  4;
            case TYPE_VOICE_INTERACTION:
                // voice interaction layer is almost immediately above apps.
                return  5;
            case TYPE_INPUT_CONSUMER:
                return  6;
            case TYPE_SYSTEM_DIALOG:
                return  7;
            case TYPE_TOAST:
                // toasts and the plugged-in battery thing
                return  8;
            case TYPE_PRIORITY_PHONE:
                // SIM errors and unlock.  Not sure if this really should be in a high layer.
                return  9;
            case TYPE_SYSTEM_ALERT:
                // like the ANR / app crashed dialogs
                return  canAddInternalSystemWindow ? 11 : 10;
            case TYPE_APPLICATION_OVERLAY:
                return  12;
            case TYPE_DREAM:
                // used for Dreams (screensavers with TYPE_DREAM windows)
                return  13;
            case TYPE_INPUT_METHOD:
                // on-screen keyboards and other such input method user interfaces go here.
                return  14;
            case TYPE_INPUT_METHOD_DIALOG:
                // on-screen keyboards and other such input method user interfaces go here.
                return  15;
            case TYPE_STATUS_BAR:
                return  17;
            case TYPE_STATUS_BAR_PANEL:
                return  18;
            case TYPE_STATUS_BAR_SUB_PANEL:
                return  19;
            case TYPE_KEYGUARD_DIALOG:
                return  20;
            case TYPE_VOLUME_OVERLAY:
                // the on-screen volume indicator and controller shown when the user
                // changes the device volume
                return  21;
            case TYPE_SYSTEM_OVERLAY:
                // the on-screen volume indicator and controller shown when the user
                // changes the device volume
                return  canAddInternalSystemWindow ? 22 : 11;
            case TYPE_NAVIGATION_BAR:
                // the navigation bar, if available, shows atop most things
                return  23;
            case TYPE_NAVIGATION_BAR_PANEL:
                // some panels (e.g. search) need to show on top of the navigation bar
                return  24;
            case TYPE_SCREENSHOT:
                // screenshot selection layer shouldn't go above system error, but it should cover
                // navigation bars at the very least.
                return  25;
            case TYPE_SYSTEM_ERROR:
                // system-level error dialogs
                return  canAddInternalSystemWindow ? 26 : 10;
            case TYPE_MAGNIFICATION_OVERLAY:
                // used to highlight the magnified portion of a display
                return  27;
            case TYPE_DISPLAY_OVERLAY:
                // used to simulate secondary display devices
                return  28;
            case TYPE_DRAG:
                // the drag layer: input for drag-and-drop is associated with this window,
                // which sits above all other focusable windows
                return  29;
            case TYPE_ACCESSIBILITY_OVERLAY:
                // overlay put by accessibility services to intercept user interaction
                return  30;
            case TYPE_SECURE_SYSTEM_OVERLAY:
                return  31;
            case TYPE_BOOT_PROGRESS:
                return  32;
            case TYPE_POINTER:
                // the (mouse) pointer layer
                return  33;
            default:
                Slog.e("WindowManager", "Unknown window type: " + type);
                return APPLICATION_LAYER;
        }
    }

 以上返回的是除 Application 外的 Window 的層級(jí),在開(kāi)發(fā)系統(tǒng)應(yīng)用時(shí)可以選擇一種開(kāi)發(fā)自己的 Window.

(四) 層級(jí)高低具體分析(對(duì)比Toast以及軟鍵盤)

低于toast--->蓋不住toast
低于軟鍵盤--->蓋不住軟鍵盤
依附Activity使用--->is your activity running?
 public static int getWindowType(int num) {
        switch (num) {
            case 1:
                return WindowManager.LayoutParams.TYPE_PHONE;//低于toast  低于軟鍵盤
            case 2:
                return WindowManager.LayoutParams.TYPE_SEARCH_BAR;//低于toast  低于軟鍵盤
            case 3:
                return WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG;//低于toast  低于軟鍵盤
            case 4:
                return WindowManager.LayoutParams.TYPE_PRIORITY_PHONE;//高于toast  低于軟鍵盤
            case 5:
                return WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;//高于toast  低于軟鍵盤
            case 6:
                return WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;//高于toast  蓋住鍵盤
            case 7:
                return WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;//高于toast    低于軟鍵盤
            case 8:
                return WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG;//高于toast  低于軟鍵盤
            case 9:
                return WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;//高于toast  高于軟鍵盤
            case 10:
                return WindowManager.LayoutParams.TYPE_STATUS_BAR;//高于toast  高于軟鍵盤(鍵盤會(huì)把透明view頂起)
            case 11:
                return WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL;//高于toast  高于軟鍵盤(鍵盤會(huì)把透明view頂起)
            case 12:
                return WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;//低于下級(jí)頁(yè)面
            case 13:
                return WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY;//is your activity running?
            case 14:
                return WindowManager.LayoutParams.TYPE_BASE_APPLICATION;// is your activity running?
            case 15:
                return WindowManager.LayoutParams.TYPE_APPLICATION;// is your activity running?
            case 16:
                return WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;// is your activity running?
            case 17:
                return WindowManager.LayoutParams.TYPE_DRAWN_APPLICATION;// is your activity running?
            case 18:
                return WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;// is your activity running?
            case 19:
                return WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;// is your activity running?
            case 20:
                return WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL;// is your activity running?
            case 21:
                return WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;// is your activity running?
            case 22:
                return WindowManager.LayoutParams.TYPE_WALLPAPER;// is your activity running?
            case 23:
                return WindowManager.LayoutParams.TYPE_TOAST;// is your activity running?
            case 24:
                return WindowManager.LayoutParams.TYPE_INPUT_METHOD;//is your activity running?
            case 25:
                return WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION;//permission denied for window type 2030
            default:
                return 0;
        }
    }

(五)如何定制系統(tǒng)層級(jí)

改變層級(jí)關(guān)系需要改寫 getWindowLayerFromTypeLw 的 switch 順序結(jié)構(gòu)和返回值
如果需要更改一些 Window 的行為,需要修改
/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java

到此這篇關(guān)于Android WindowManger的層級(jí)分析詳解的文章就介紹到這了,更多相關(guān)Android WindowManger的層級(jí)分析內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Android實(shí)現(xiàn)的RecyclerView適配器

    Android實(shí)現(xiàn)的RecyclerView適配器

    這篇文章主要介紹了Android實(shí)現(xiàn)的RecyclerView適配器的相關(guān)資料,幫助大家更好的理解和學(xué)習(xí)使用Android,感興趣的朋友可以了解下
    2021-03-03
  • Android實(shí)現(xiàn)啟動(dòng)引導(dǎo)圖

    Android實(shí)現(xiàn)啟動(dòng)引導(dǎo)圖

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)啟動(dòng)引導(dǎo)圖,文中示例代碼介紹的非常詳細(xì),具有為大家詳細(xì)一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-06-06
  • AndroidStudio接入U(xiǎn)nity工程并實(shí)現(xiàn)相互跳轉(zhuǎn)的示例代碼

    AndroidStudio接入U(xiǎn)nity工程并實(shí)現(xiàn)相互跳轉(zhuǎn)的示例代碼

    這篇文章主要介紹了AndroidStudio接入U(xiǎn)nity工程并實(shí)現(xiàn)相互跳轉(zhuǎn),本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-12-12
  • Android圖片緩存原理、特性對(duì)比

    Android圖片緩存原理、特性對(duì)比

    這篇文章主要為大家詳細(xì)介紹了Android圖片緩存原理、特性對(duì)比 ,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-09-09
  • Android開(kāi)發(fā)實(shí)現(xiàn)的ViewPager引導(dǎo)頁(yè)功能(動(dòng)態(tài)加載指示器)詳解

    Android開(kāi)發(fā)實(shí)現(xiàn)的ViewPager引導(dǎo)頁(yè)功能(動(dòng)態(tài)加載指示器)詳解

    這篇文章主要介紹了Android開(kāi)發(fā)實(shí)現(xiàn)的ViewPager引導(dǎo)頁(yè)功能(動(dòng)態(tài)加載指示器),結(jié)合實(shí)例形式詳細(xì)分析了Android使用ViewPager引導(dǎo)頁(yè)的具體步驟,相關(guān)布局、功能使用技巧,需要的朋友可以參考下
    2017-11-11
  • Android客戶端與服務(wù)端交互

    Android客戶端與服務(wù)端交互

    這篇文章主要為大家詳細(xì)介紹了Android客戶端與服務(wù)端交互之登陸示例,感興趣的小伙伴們可以參考一下
    2016-02-02
  • Android Volley圖片加載功能詳解

    Android Volley圖片加載功能詳解

    這篇文章主要為大家詳細(xì)介紹了Android Volley圖片加載功能,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-09-09
  • 在ubuntu下編譯ijkplayer-android的方法

    在ubuntu下編譯ijkplayer-android的方法

    下面小編就為大家分享一篇在ubuntu下編譯ijkplayer-android的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-01-01
  • Android Studio查看Android 5.x源碼的步驟詳解

    Android Studio查看Android 5.x源碼的步驟詳解

    Google為Android開(kāi)發(fā)者帶來(lái)Android Studio,用來(lái)取代Eclipse。從Android Studio出現(xiàn)起,整機(jī)開(kāi)發(fā)和Android源碼閱讀和編輯一定能用上它。這篇文章小編就帶大家學(xué)習(xí)下如何使用Android Studio查看Android 5.x源碼,有需要的可以參考借鑒。
    2016-09-09
  • 詳解Android應(yīng)用中preference首選項(xiàng)的編寫方法

    詳解Android應(yīng)用中preference首選項(xiàng)的編寫方法

    這篇文章主要介紹了Android應(yīng)用中preference首選項(xiàng)的編寫方法,或許Apple將其翻譯為'偏好設(shè)置'更直觀些,即用戶對(duì)應(yīng)用的一些個(gè)性化調(diào)整菜單,需要的朋友可以參考下
    2016-04-04

最新評(píng)論

齐齐哈尔市| 剑川县| 涡阳县| 涞源县| 花莲市| 福贡县| 孟连| 吉林市| 大安市| 丰台区| 高清| 井研县| 黎川县| 尤溪县| 车险| 竹山县| 集安市| 玉溪市| 广汉市| 汶上县| 榆中县| 田东县| 融水| 孟津县| 格尔木市| 娱乐| 彭州市| 固原市| 韶山市| 日土县| 桐柏县| 梁河县| 景宁| 阳曲县| 松原市| 湖州市| 始兴县| 青神县| 石泉县| 尼玛县| 芦山县|