Created
March 29, 2021 15:39
-
-
Save mzaimilzam/0c15300cc5f1477f8cf10ee7f489dead to your computer and use it in GitHub Desktop.
old way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mzaiilzam.viewbindingdelegate | |
import android.os.Bundle | |
import androidx.fragment.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import com.mzaiilzam.viewbindingdelegate.databinding.FragmentFirstBinding | |
class FirstFragment : Fragment() { | |
private var _binding: FragmentFirstBinding? = null | |
private val binding get() = _binding!! | |
override fun onCreateView( | |
inflater: LayoutInflater, container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { | |
// Inflate the layout for this fragment | |
_binding = FragmentFirstBinding.inflate(inflater, container, false) | |
return binding.root | |
} | |
override fun onDestroyView() { | |
super.onDestroyView() | |
_binding = null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment