Advertisement
BlackZerg

Untitled

Sep 26th, 2021
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.35 KB | None | 0 0
  1. abstract class BaseFragment<VB: ViewBinding> : Fragment() {
  2.  
  3.     abstract val inflate: Inflate<VB>
  4.     protected abstract var binding: VB
  5.  
  6.     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? =
  7.         binding.apply {
  8.             inflate.invoke(inflater, container, false)
  9.         }.root
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement