code: public void showProgress(boolean show) {
          Log.v(TAG, show ? "Disabling the button while showing progress" : "Enabling the button and hiding progress");
          setEnabled(!show);
          progress.setVisibility(show ? VISIBLE : GONE);
          if (show) {
              icon.setVisibility(INVISIBLE);
              labeledLayout.setVisibility(INVISIBLE);
              return;
          }
          icon.setVisibility(shouldShowLabel ? GONE : VISIBLE);
          labeledLayout.setVisibility(!shouldShowLabel ? GONE : VISIBLE);
      }
docs: Used to display a progress bar and disable the button.
  
  @param show whether to show the progress bar or not.