class FiamWindowManager {

  public void show(@NonNull final BindingWrapper bindingWrapper, @NonNull Activity activity) {
    if (isFiamDisplayed()) {
      Logging.loge("Fiam already active. Cannot show new Fiam.");
      return;
    }

    InAppMessageLayoutConfig config = bindingWrapper.getConfig();
    final WindowManager.LayoutParams layoutParams = getLayoutParams(config, activity);

    final WindowManager windowManager = getWindowManager(activity);
    final View rootView = bindingWrapper.getRootView();
    windowManager.addView(rootView, layoutParams);

    // Set 'window' left and right padding from the inset, this prevents
    // anything from touching the navigation bar when in landscape.
    Rect insetDimensions = getInsetDimensions(activity);
    Logging.logdPair("Inset (top, bottom)", insetDimensions.top, insetDimensions.bottom);
    Logging.logdPair("Inset (left, right)", insetDimensions.left, insetDimensions.right);

    // TODO: Should use WindowInsetCompat to make sure we don't overlap with the status bar
    //       action bar or anything else. This will become more pressing as notches
    //       become more common on Android phones.

    if (bindingWrapper.canSwipeToDismiss()) {
      SwipeDismissTouchListener listener =
          getSwipeListener(config, bindingWrapper, windowManager, layoutParams);
      bindingWrapper.getDialogView().setOnTouchListener(listener);
    }

    this.bindingWrapper = bindingWrapper;
  }

  @Inject  FiamWindowManager();

}