Closed nicopasso closed 2 years ago
@nicopasso Are you sure they are not using it already? I thought I saw that in a Fragment base class of some sort...
@spectrumIG I've checked most of the Fragments in the app and all have onCreateView
. The layout in the constructor is used only for DialogFragment
s that extend BaseStateDialogFragment
Ah ok...yes, correct. I get what you mean , now.
Il mar 26 mag 2020, 12:54 Niccolò Passolunghi notifications@github.com ha scritto:
@spectrumIG https://github.com/spectrumIG I've checked most of the Fragments in the app and all have onCreateView. The layout in the constructor is used only for DialogFragments that extend BaseStateDialogFragment
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/immuni-app/immuni-app-android/issues/49#issuecomment-633953687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHXDJKBA2J3VV5KFAGJXULRTONXRANCNFSM4NKEMCRQ .
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Code conciseness Using
androidx.Fragment
, it's possible to clean up a bit eachFragment
class by removing theonCreateView
method with the layout inflation in favor of the alternateFragment
constructor that allows providing the default layout.Androidx Fragment releases page
Example Instead of writing
it's now possible to simplify it with: