code: private void initializePopupWindow() {
          if (null == mPopupWindow) {
              mPopupWindow = new PopupWindow(mContentView, ViewGroup.LayoutParams.MATCH_PARENT,
                      fullScreen ? ViewGroup.LayoutParams.MATCH_PARENT : ViewGroup.LayoutParams.WRAP_CONTENT);
              ColorDrawable cd = new ColorDrawable(mBackgroundColor);
              mPopupWindow.setBackgroundDrawable(cd);
              mPopupWindow.setAnimationStyle(R.style.PopupWindowAnimation);
              // 产生背景变暗效果
              // Window window = ((Activity) mTrigger.getContext()).getWindow();
              // WindowManager.LayoutParams lp = window.getAttributes();
              // lp.alpha = 0.4f;
              // window.setAttributes(lp);
  
              mPopupWindow.setFocusable(true);
              mPopupWindow.setTouchable(true);
              mPopupWindow.setOutsideTouchable(outsideTouchable);
              mPopupWindow.setOnDismissListener(mOnDismissListener);
          }
          initializeContentView();
      }
docs: 初始化弹出窗口