You can add theme to your progress bar like Make a layout surround your progress bar eg: a relativeLayout place your progressbar inside it and then apply this tag to the layout. So the layout having progressbar now will be adjusted as a dialog.
android:theme="@style/Theme.Dialog"
Second method
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
Apply the above width/2 and height/2 as the width and height of your progress bar.
Method 3
If you want the display dimensions in pixels you can use getSize:
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
Apply the above width/2 and height/2 as the width and height of your progress bar.But as these dimensions will be in pixels.So adjust them accordingly.
NOTE:
Method 3 works with ApiLevel :13 and above only.