Skip to content

Let's use Activity/Fragment's secondary constructor passing layout res id

Compare
Choose a tag to compare
@wada811 wada811 released this 21 Jan 15:21
· 177 commits to master since this release
e187668

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()