code: @Override
      protected View onCreateView(@NonNull Context context, LayoutInflater layoutInflater,
                                  @Style.Type int type) {
  
          if(!(context instanceof Activity)) {
              throw new IllegalArgumentException("SuperActivityToast Context must be an Activity.");
          }
  
          // Inflate the appropriate View for the type, do not return for each case since mView must be set
          switch (type) {
              case Style.TYPE_STANDARD:
                  this.mView = layoutInflater.inflate(R.layout.supertoast, (ViewGroup)
                          ((Activity) context)
                          .findViewById(android.R.id.content), false);
                  break;
  
              case Style.TYPE_BUTTON:
                  this.mView = layoutInflater.inflate(R.layout.supertoast_button, (ViewGroup)
                          ((Activity) context)
                          .findViewById(android.R.id.content), false);
                  break;
  
              case Style.TYPE_PROGRESS_CIRCLE:
                  this.mView = layoutInflater.inflate(R.layout.supertoast_progress_circle,
                          (ViewGroup) ((Activity) context)
                          .findViewById(android.R.id.content), false);
                  this.mProgressBar = (ProgressBar) this.mView.findViewById(R.id.progress_bar);
                  break;
  
              case Style.TYPE_PROGRESS_BAR:
                  this.mView = layoutInflater.inflate(R.layout.supertoast_progress_bar,
                          (ViewGroup) ((Activity) context)
                          .findViewById(android.R.id.content), false);
                  this.mProgressBar = (ProgressBar) this.mView.findViewById(R.id.progress_bar);
                  break;
  
              default:
                  // Type received was erroneous so inflate the standard SuperToast layout
                  this.mView = layoutInflater.inflate(R.layout.supertoast,
                          (ViewGroup) ((Activity) context)
                          .findViewById(android.R.id.content), false);
                  break;
          }
  
          return this.mView;
      }
docs: Handle the inflation of the appropriate View according to the desired type.
  
  @param context An Activity Context
  @param layoutInflater The LayoutInflater created from the Context
  @param type The desired SuperActivityToast type
  
  @return The SuperActivityToast View