docs: @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
      public static ViewTreeObserver.OnGlobalLayoutListener attach(final Activity activity,
                                                                   IPanelHeightTarget target,
                                                                   /* Nullable */
                                                                   OnKeyboardShowingListener lis) {
          final ViewGroup contentView = activity.findViewById(android.R.id.content);
          final boolean isFullScreen = ViewUtil.isFullScreen(activity);
          final boolean isTranslucentStatus = ViewUtil.isTranslucentStatus(activity);
          final boolean isFitSystemWindows = ViewUtil.isFitsSystemWindows(activity);
  
          // get the screen height.
          final Display display = activity.getWindowManager().getDefaultDisplay();
          final int screenHeight;
          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
              final Point screenSize = new Point();
              display.getSize(screenSize);
              screenHeight = screenSize.y;
          } else {
              //noinspection deprecation
              screenHeight = display.getHeight();
          }
  
          ViewTreeObserver.OnGlobalLayoutListener globalLayoutListener = new KeyboardStatusListener(
                  isFullScreen,
                  isTranslucentStatus,
                  isFitSystemWindows,
                  contentView,
                  target,
                  lis,
                  screenHeight);
  
          contentView.getViewTreeObserver().addOnGlobalLayoutListener(globalLayoutListener);
          return globalLayoutListener;
      }