Let's use Activity/Fragment's secondary constructor passing layout res id
Breaking Changes
- API Changes
dataBinding(@LayoutRes layoutResId: Int)
->dataBinding()
viewBinding()
->viewBinding(bind: (View) -> T)
Migration example
-class ExampleActivity : AppCompatActivity() {
- private val binding: ExampleActivityBinding by dataBinding(R.layout.example_activity)
+class ExampleActivity : AppCompatActivity(R.layout.example_activity) {
+ private val binding: ExampleActivityBinding by dataBinding()