public virtual void handleShow() { if (mView != mNextView) { // remove the old view if necessary handleHide(); mView = mNextView; mWM = android.view.WindowManagerImpl.getDefault(); int gravity = mGravity; mParams.gravity = gravity; if ((gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK) == android.view.Gravity .FILL_HORIZONTAL) { mParams.horizontalWeight = 1.0f; } if ((gravity & android.view.Gravity.VERTICAL_GRAVITY_MASK) == android.view.Gravity .FILL_VERTICAL) { mParams.verticalWeight = 1.0f; } mParams.x = mX; mParams.y = mY; mParams.verticalMargin = mVerticalMargin; mParams.horizontalMargin = mHorizontalMargin; if (mView.getParent() != null) { mWM.removeView(mView); } mWM.addView(mView, mParams); trySendAccessibilityEvent(); } }
internal CompatModeWrapper(android.view.WindowManager wm, android.view.CompatibilityInfoHolder ci) { mWindowManager = wm is android.view.WindowManagerImpl.CompatModeWrapper ? ((android.view.WindowManagerImpl .CompatModeWrapper)wm).mWindowManager : (android.view.WindowManagerImpl)wm; // Use the original display if there is no compatibility mode // to apply, or the underlying window manager is already a // compatibility mode wrapper. (We assume that if it is a // wrapper, it is applying the same compatibility mode.) if (ci == null) { mDefaultDisplay = mWindowManager.getDefaultDisplay(); } else { //mDefaultDisplay = mWindowManager.getDefaultDisplay(); mDefaultDisplay = android.view.Display.createCompatibleDisplay(mWindowManager.getDefaultDisplay ().getDisplayId(), ci); } mCompatibilityInfo = ci; }