I have a project on Java with big legacy. There always used DialogFragments, even in places where it's not actually need. I use to refactor this(75 DialogFragments), but I have doubts - should I do this. From that - question: what difference? As for me, I see only one obvious thing, DialogFragments always has this code, each I could clean:
@Override public void onStart() {
super.onStart();
Dialog d = getDialog();
if (d!=null){
Window window = d.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
MainApplication.getInstance().getScreenBrightness().observe(getViewLifecycleOwner(), (screenBrightness) -> {
WindowManager.LayoutParams lp = window.getAttributes();
lp.screenBrightness = screenBrightness;
window.setAttributes(lp);
});
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NO_TITLE, android.R.style.Theme_DeviceDefault_Light_NoActionBar_Fullscreen);
}
But maybe exist any more important differencies?