In the demo app, there is an example of a custom dialog by extending SimpleDialogFragment and specifying a new layout in the .setView() method.
In my experience, setting the builder.setView() to a custom layout .xml file has no effect, and the dialog simple shows up as a neutral close button (no title, body, custom layout elements, etc).
My use case is pretty straight forward:
public class CancelDialog extends SimpleDialogFragment {
public static String TAG = "CancelDialog";
public static void show(FragmentActivity activity) {
new CancelDialog().show(activity.getSupportFragmentManager(), TAG);
}
@Override
public BaseDialogFragment.Builder build(BaseDialogFragment.Builder builder) {
builder.setTitle(R.string.cancel_dialog_title);
builder.setView(LayoutInflater.from(getActivity()).inflate(R.layout.dialog_cancel, null));
builder.setIcon(R.drawable.ic_action_discard);
return builder;
}
}
In the demo app, there is an example of a custom dialog by extending SimpleDialogFragment and specifying a new layout in the .setView() method.
In my experience, setting the builder.setView() to a custom layout .xml file has no effect, and the dialog simple shows up as a neutral close button (no title, body, custom layout elements, etc).
My use case is pretty straight forward:
Use case:
The layout XML is a linear layout (vertical) with 2 TextViews and an input EditText.
What am I missing here?