You can use Theme.Holo.Light.Dialog.MinWidth
for sizing your layout properly.
From the documentation:
public static final int Theme_Holo_Light_Dialog_MinWidth
Variant of Theme.Holo.Light.Dialog that has a nice minimum width for a
regular dialog.
The way to use this would be through passing a ContextThemeWrapper in place of Context (using this) to your custom Dialog's constructor:
YourCustomDialog cDialog = new YourCustomDialog(
new ContextThemeWrapper(this,
android.R.style.Theme_Holo_Light_Dialog_MinWidth));
This is how Theme.Holo.Light.Dialog.MinWidth
is defined:
<style name="Theme.Holo.Light.Dialog.MinWidth">
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
</style>
From dimens.xml
:
@android:dimen/dialog_min_width_major:
<!-- The platform's desired minimum size for a dialog's width when it
is along the major axis (that is the screen is landscape). This may
be either a fraction or a dimension. -->
<item type="dimen" name="dialog_min_width_major">65%</item>
@android:dimen/dialog_min_width_minor:
<!-- The platform's desired minimum size for a dialog's width when it
is along the minor axis (that is the screen is portrait). This may
be either a fraction or a dimension. -->
<item type="dimen" name="dialog_min_width_minor">95%</item>
As it seems, the dialog's width in the picture you posted is around 65%. In the portrait mode, it would be 95%.
Honestly, the width doesn't look like 95 % in portrait mode, but it's better than before :):
