Skip to content

Commit

Permalink
Remove null-ing of view binding
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Scherzinger <[email protected]>
  • Loading branch information
AndyScherzinger committed Apr 9, 2024
1 parent 19178d5 commit 4fa3917
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {

private lateinit var viewModel: FileActionsViewModel

private var _binding: FileActionsBottomSheetBinding? = null
private val binding
get() = _binding!!
private lateinit var binding: FileActionsBottomSheetBinding

private lateinit var componentsGetter: ComponentsGetter

Expand All @@ -80,7 +78,7 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
viewModel = ViewModelProvider(this, vmFactory)[FileActionsViewModel::class.java]
_binding = FileActionsBottomSheetBinding.inflate(inflater, container, false)
binding = FileActionsBottomSheetBinding.inflate(inflater, container, false)

viewModel.uiState.observe(viewLifecycleOwner, this::handleState)

Expand Down Expand Up @@ -154,11 +152,6 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
}
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}

override fun onAttach(context: Context) {
super.onAttach(context)
require(context is ComponentsGetter) {
Expand Down

0 comments on commit 4fa3917

Please sign in to comment.