I have to implement the same screen, as a bottom s...
# android
m
I have to implement the same screen, as a bottom sheet at one place and as a normal fragment in a viewpager at a different place. If I extend BottomSheetDialogFragment for the first case, I cannot use it as a normal fragment in the other case. Any suggestions so I can avoid duplicate logic/classes?
s
custom view that you put in those two types of fragment
t
Just like with
DialogFragment
, you should be able to use the same fragment for both embedding in a layout or and a dialog. Use
show()
for the dialog, and return an instance in your viewpager adapter for the normal fragment
Ô׼ 1
­čśŹ 1