I'm trying to implement two types of
I'd suggest some kind of facade pattern for a situation like this.
With that you would create a common facade for both dialog types (or for even more if you need later on), so you can implement the common logic there.
The facade could have a
createBottomSheetDialogFragment and a
createDialogFragment method, and both calling an inner method for the common logic.
Or you could implement the logic which decides which dialog fits for the current situation right inside your own class, and decide which dialog you need.