Code example for WindowManager.LayoutParams

0
 
    /** 
     * Sets up the window parameters for the drag container 
     */ 
    protected void setUpDragContainer() { 
        mWindowParams = new WindowManager.LayoutParams();
        mWindowParams.gravity = Gravity.TOP | Gravity.LEFT;
 
        mWindowParams.height = LayoutParams.MATCH_PARENT;
        mWindowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
        mWindowParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
 
        mWindowParams.format = PixelFormat.TRANSLUCENT;
        mWindowParams.windowAnimations = 0;
 
        mWindowManager = (WindowManager) mContext.getSystemService("window");
 
        mDragContainer = new FrameLayout(mContext);
        mDragContainer.setForegroundGravity(Gravity.TOP | Gravity.LEFT);