code: private void adaptProgressBarSize() {
          if (progressBar != null) {
              progressBar.setVisibility(progressBarSize > 0 ? View.VISIBLE : View.GONE);
              ViewGroup.LayoutParams layoutParams = progressBar.getLayoutParams();
              layoutParams.width = progressBarSize;
              layoutParams.height = progressBarSize;
          }
      }
docs: Adapts the size of the dialog's circular progress bar.