Releases: derysudrajat/inline-view-binding
Releases · derysudrajat/inline-view-binding
v1.0.1
Release new Inline ViewBinding
Easy use binding on Activity and Fragment
In Activity
class MainActivity : AppCompatActivity() {
// just using delegate by view binding to and inflate your layout like this
private val binding by viewBinding(ActivityMainBinding::inflate)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
// ... do your magic here
}
}
In Fragment
// extend your fragment class to BindingFragment with your generic layout
class SampleFragment : BindingFragment<FragmentSampleBinding>() {
// just using delegate by view binding and inflate your layout like this
override val binding by viewBinding(FragmentSampleBinding::inflate)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
// ... do your magic here
}
}
v1.0.0
Release new Inline ViewBinding
Easy use binding on Activity and Fragment
In Activity
class MainActivity : AppCompatActivity() {
// just using delegate by view binding to and inflate your layout like this
private val binding by viewBinding(ActivityMainBinding::inflate)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
// ... do your magic here
}
}
In Fragment
// extend your fragment class to BindingFragment with your generic layout
class SampleFragment : BindingFragment<FragmentSampleBinding>() {
// just using delegate by view binding and inflate your layout like this
override val binding by viewBinding(FragmentSampleBinding::inflate)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
// ... do your magic here
}
}