What I am trying to achieve is to have a fragment that on tablet it shows as a DialogFragment, while on smartphone it would be shown as a regular fragment. I am
OK, I have been there and done that. To make a DialogFragment you need a layout defined in XML. Say, for this you have LinearLayout as root. In this LinearLayout you can add a fragment class="...." and when you display your DialogFragment, it will be the same Fragment you displayed side by side on the tablet now displayed in a DialogFragment.
Like so. And inflate this in your DialogFragment